Join early access
Menu

Security · Engineering guide

Prompt injection in AI agents: build the boundary outside the model

A malicious instruction can arrive inside a perfectly ordinary ticket or document. The agent's tools and data still need protection when the model reads it.

By Triangulum Labs · 25 November 2026 · All guides

What is indirect prompt injection?

Indirect prompt injection places instructions in material an agent retrieves: a customer message, document, website, database record or tool response. The attacker wants the model to treat that material as an instruction and perform an action the legitimate user did not authorize. The text may be delivered through an otherwise legitimate integration.

For example, a support agent reads a ticket asking it to send a customer list to an unrelated destination. The important test is not only whether the model recognizes the malicious text. It is whether the tool, network and approval controls prevent the unauthorized export if the model requests it.

Layer controls around the agent

No single classifier or prompt can establish complete protection. The OWASP AI Agent Security Cheat Sheet recommends independent authorization, least privilege and adversarial testing.

Test the whole path

  1. Place an instruction in a test document or tool response asking for an unauthorized destination or write.
  2. Observe the model's proposed action and verify the external control denies it.
  3. Check that secrets do not appear in the agent environment, logs or resulting tool output.
  4. Test permitted actions too: overblocking legitimate work is a real operational cost.
  5. Repeat after changes to models, tools, prompts, memory or policy, and in the deployment you intend to run.

Tested controls, measured results

In Triangulum Labs' internal signed high-density proof, credential isolation and gateway restrictions passed in the tested setup; upstream vendors and sign-in were simulated. Separately, a real-model full-stack evaluation recorded zero successful attacks against each of two models across 100 public attack texts per model, using one agent shape. The live tests were not part of the signed proof. The whitepaper includes the methodology and partial findings.

Continue with credentials and permissions, approval and audit design and agent evaluation.

Give agents work—not unrestricted authority

Discuss your tool access, approval and security requirements with Triangulum Labs.