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
- Credentials: keep connector secrets outside the agent's environment and add them only in the trusted execution path.
- Tools: allow only necessary operations and validate the target, arguments, identity and authorization outside the model.
- Network: restrict outbound destinations and test private, loopback and cloud metadata access in the actual deployment.
- Writes: require controlled paths and human approval for policy-defined high-impact actions.
- Data and memory: limit what the agent can read, retain and send to models; isolate customer and session context.
- Detection and audit: use screening as an additional layer, record decisions and review denied or suspicious activity without logging secrets.
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
- Place an instruction in a test document or tool response asking for an unauthorized destination or write.
- Observe the model's proposed action and verify the external control denies it.
- Check that secrets do not appear in the agent environment, logs or resulting tool output.
- Test permitted actions too: overblocking legitimate work is a real operational cost.
- 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.