Every few months a new filter promises to stop prompt injection. The reason none of them settles the question is structural, and once you see it, the useful defences look different. This guide explains the reason, then walks through what the published defences reported, what they cost, and where enforcement belongs.
Prompt injection in numbers
one
token sequence carries system prompt, user request, retrieved pages and tool output alike
over 90%
attack success reported against 12 published defences when attackers adapted to them, per a 2026 survey blog post
77% vs 84%
AgentDojo task success reported for CaMeL versus an undefended baseline
97%
PoisonedRAG black-box attack success reported on one question-answering dataset
Why filtering cannot be the whole answer
A language model reads one stream of tokens. The system prompt, the user's request, a web page the agent fetched and a tool's output are concatenated, and the model has no hard boundary telling it which parts are instructions and which are data. As one source puts it, the model does not care who wrote the instruction. That is the root of indirect prompt injection: an attacker never talks to the system, but places text in a document, email, web page or tool description that the agent later reads.
A 2026 survey blog post (not peer-reviewed) reports that OpenAI, Anthropic and Google DeepMind acknowledged in 2025 that prompt injection cannot be fully solved within current model architectures. That attribution is secondhand, so treat it as reported, not as a quotation. The consequence is easy to state: any defence written as a prompt instruction can itself be overridden by the same channel it defends.
The damage depends on what the agent can do. Simon Willison's "lethal trifecta" names the dangerous combination: access to private data, exposure to untrusted content, and a way to communicate externally. The attacks are not hypothetical. Researchers described EchoLeak (CVE-2025-32711, CVSS 9.3), a zero-click data-exfiltration path in Microsoft 365 Copilot that worked through Markdown image rendering.
What the defences reported
| Defence | Idea | Reported result | Reported limit |
|---|---|---|---|
| Spotlighting (Microsoft Research, 2024) | Mark untrusted text with delimiters, datamarking or encoding so the model knows it is data | In Microsoft's experiments, attack success fell from over 50% to under 2% | A probabilistic nudge; a human red-teaming competition broke it |
| Classifier screening, e.g. Meta's LlamaFirewall (April 2025) | A small classifier, plus a reasoning auditor, checks inputs and actions | On Meta's suite one classifier cut success from 17.6% to 7.5%; an auditor reached 2.9%; combined 1.75% | The remaining 1.75% is still risk for high-stakes actions; classifiers can miss a plausible-looking tool call |
| Dual-LLM pattern (Willison, April 2023) | A privileged model with tools never reads untrusted text; a quarantined model reads it with no tools | Removes a large class of exfiltration paths | The quarantined model can still be manipulated into returning a wrong value |
| CaMeL (Google, DeepMind and ETH Zurich, March 2025) | Compile the user request into a program; untrusted data cannot change control flow; policies checked at tool calls | 77% of AgentDojo tasks solved versus 84% undefended | Someone must write and maintain policies; approval prompts cause user fatigue |
Read the table with the sources' own caveats. The spotlighting figure comes from Microsoft's own experiments, and none of the sources shows it holding against attackers who adapt. The classifier numbers come from the vendor's own evaluation. The CaMeL authors claim provable security properties, and Willison's assessment is that prompt injection is not fully solved even with CaMeL. Classifier approaches also carry a utility cost: the authors of one 2026 paper report that trained injection classifiers hurt benign task performance considerably.
Injection without instructions: PoisonedRAG
Filters tuned to detect instruction-like text have a second blind spot. PoisonedRAG, a USENIX Security 2025 paper, relies on malicious knowledge instead of instructions: it plants passages that make a retriever surface false facts and lets the model answer from them. The authors argue that instruction-style injection extended to retrieval ignores the retriever and is less stealthy, since such instructions can be detected with a high true-positive rate. Their reported attack success rates, from the paper's table:
| Dataset | Prompt injection | PoisonedRAG (black box) |
|---|---|---|
| Natural Questions | 0.62 | 0.97 |
| HotpotQA | 0.93 | 0.99 |
| MS MARCO | 0.71 | 0.91 |
The implication is that a defence keyed to "instruction-like" strings cannot see a poisoned fact. Retrieval-source trust and index integrity are a separate control. The same logic applies to stored memories, covered in agent memory poisoning.
Why static benchmark numbers mislead
The same survey post, which reports adaptive attacks bypassing all 12 published defences at over 90% success, also cites MELON, a defence, at 0.32% attack success on AgentDojo. These two figures come from different setups, one a benchmark result and the other an adaptive-attack result, so they cannot be read as a ranking. A low number on a static benchmark says little about adaptive robustness, and the survey post notes that at least one guardrail paper did not test adaptive attacks at all. The honest question for any defence is not "what was its score" but "was it attacked by someone trying to defeat it specifically".
Enforce policy where the model cannot overrule it
If detection will always leak, the cost of a miss is set by what the agent is allowed to do. The sources converge on controls that sit outside the model:
- Policy decisions in a separate engine. Open Policy Agent describes an evaluation interface for asking for policy decisions that keeps them out of the application. A third-party tutorial shows the pattern for agents: intercept a tool call before any side effect, post the tool name, arguments and agent identity to the engine, and receive allow, deny with a reason, or escalate to a human. The reasoning is that whether a tool runs is decided by versioned, testable policy, not by the model. - Gateway hooks. Some LLM gateways document hooks that run before the call, in parallel with it and after it, where raising an exception blocks the request. One independent review calls the gateway the enforcement point and the guardrail the detection engine behind it, and cautions that a guardrail reading only the user's message misses injections arriving in a tool result or a tool description. For streaming, one gateway documents that post-call checks run on the assembled response after delivery, which makes them audit-only unless a per-chunk hook is used. - Egress and confirmation rules. One concrete rule from the survey post: if an email's recipient came from retrieved content rather than the user or their address book, require explicit confirmation. - Blast-radius limits. Least-privilege tools, human approval for irreversible actions and network allow-lists.
Policy engines have their own debate. A vendor argues general-purpose engines were not designed for agent execution paths; that is a vendor assertion with no independent measurement in the sources. For how this principle plays out in a system design, see spatial agent architecture principles.
Frequently Asked Questions
Reported results say classifiers reduce attack success but leave a residual, can hurt benign utility, and can miss plausible-looking tool calls. Treat them as noise reduction.
Turn climate goals into a verified portfolio
TREEO connects the full carbon cycle — eligibility, simulation, real-time monitoring and registry-ready reporting — combining expert consulting with dMRV technology so the evidence exists before anyone asks for it.



