Indirect prompt injection is an attack in which someone plants instructions in content an LLM application will later retrieve on its own, such as a web page, a PDF in the knowledge base, an email body or a JSON field returned by a tool, so the model executes them while serving an ordinary user’s request. The attacker never types into your chat box.
That is the whole difference from direct prompt injection, where the attacker is the person typing. The user asks a perfectly normal question, the retrieval layer does its job, and the model executes text that arrived through a channel it was told to treat as data.
The term comes from Greshake et al., whose 2023 paper “Not what you’ve signed up for” is still the reference framing: LLM-integrated applications blur the line between data and instructions, so any content the model ingests becomes a potential command channel. The paper (arXiv:2302.12173, first posted 23 February 2023) demonstrated the attack against Bing’s GPT-4-powered Chat and code-completion engines and catalogued impacts including data theft, worming and information ecosystem contamination. Three years on, OWASP still ranks prompt injection as LLM01, and the indirect variant is the half that scales, because it does not require the attacker to have access to the victim’s session.
If you want the full five-class picture — direct, indirect, multi-modal, agentic, multi-turn — start with the working taxonomy of prompt injection attacks and come back here for the indirect branch in depth.
Indirect prompt injection definition: NIST, OWASP and MITRE ATLAS
NIST defines indirect prompt injection as “a type of prompt injection executed through resource control rather than through user-provided input” (NIST glossary). OWASP’s LLM01:2025 entry says indirect prompt injections “occur when an LLM accepts input from external sources, such as websites or files,” and maps the indirect case to MITRE ATLAS technique AML.T0051.001, with direct injection at AML.T0051.000. All three draw the line at who controls the channel, not at what the payload says.
NIST AI 100-2 E2025, finalized in March 2025, is worth knowing for anyone who has to map findings onto an existing risk register, because it does not fold this into an existing category. Its generative-AI taxonomy gives indirect prompt injection its own class, NISTAML.015, separate from the direct case (NISTAML.018) — and separate from the evasion classes, which sit on the predictive-AI side of the document only. Section 3.4 of the full text describes these attacks as “enabled by resource control” and works through them under all three attacker-goal headings: availability, integrity and privacy. One attack class, three impact categories, which is usually one row more than a risk register expects.
One citation trap: NIST’s errata, last updated June 3, 2025, drops Indirect Prompt Injection (NISTAML.015) from the index’s generative-AI availability entries and substitutes Manipulate Resources (NISTAML.016) and Time-Consuming Tasks (NISTAML.017). Cite those two IDs for an availability finding.
Direct vs indirect prompt injection
Direct prompt injection is typed by the attacker into the model’s own input; indirect prompt injection is planted by a third party in content the model retrieves, so the person in the session is the victim rather than the attacker.
| Direct prompt injection | Indirect prompt injection | |
|---|---|---|
| Who writes the payload | The user in the session | A third party who controls content the app reads |
| Entry point | Chat box or API prompt field | Retrieved documents, web pages, email, tool output, files |
| Attacker access needed | An account on the application | Write access to any source the application ingests |
| Reach | One session at a time | Every user whose request retrieves the payload |
| NIST AI 100-2e2025 | NISTAML.018, section 3.3 | NISTAML.015, section 3.4 |
| MITRE ATLAS | AML.T0051.000 | AML.T0051.001 |
| Controls that help most | Rate limits, account signals, abuse reports | Content provenance, output and tool-call restrictions |
Why the boundary does not exist
There is no protocol-level separator between instructions and data inside a transformer’s context window. System prompt, retrieved chunks, tool output and user turn are concatenated into one token stream. Delimiters, XML tags and “the following is untrusted content” preambles are themselves just tokens; nothing in the architecture forces the model to honor them.
The BIPIA benchmark work (arXiv:2312.14197) puts a finer point on it by naming two distinct failure modes rather than one. First, models cannot reliably distinguish informational context from actionable instructions. Second, even when they can, they lack any awareness that instructions found inside external content should not be executed. Those are separate problems, and they explain why the two common fixes behave so differently: prompting tricks that improve boundary awareness help with the first failure and barely touch the second, while fine-tuning that teaches refusal of embedded instructions attacks the second directly. The paper reports that its black-box defense provides substantial mitigation while the white-box (fine-tuned) defense pushes attack success toward zero without degrading output quality — a result worth knowing before you spend a quarter on prompt engineering alone.
The delivery channels
Indirect injection is defined by its channel, not its payload. Anything your pipeline pulls in and hands to the model is a channel:
- Retrieved documents. The classic RAG path. A poisoned PDF, wiki page or support ticket in the index gets chunked, ranked and injected into context. The Llama 3 RAG walkthrough traces four distinct attack classes through exactly this route.
- Live web content. Browsing and search-augmented assistants fetch attacker-controlled HTML on demand. The Bing Chat / Sydney case remains the best-documented public example of a commercial deployment reading instructions off a web page.
- Email and calendar bodies. Assistant integrations that summarize an inbox will happily summarize an instruction. The attacker only needs the victim’s address.
- Tool and API responses. An agent that calls a third-party API is trusting that vendor’s response body as much as its own system prompt. OWASP’s LLM01 guidance calls out untrusted tool output specifically.
- Code, config and repository files. Comments, commit messages, issue text and README content all land in the context of coding agents.
- Image, document and file metadata. Alt text, EXIF fields, PDF annotations and OCR’d text in screenshots are all text to the model.
Cutting across every one of those channels is the encoding problem. A payload does not have to be visible to a human reviewer to tokenize as an instruction — Unicode Tag characters smuggle invisible instructions past eyeballs and naive string filters while remaining fully legible to the model. Any channel review that relies on someone reading the document is weaker than it looks.
What the payload does once it lands
Four objectives account for most published indirect injection work, and they escalate in that order:
- Instruction override. The retrieved text tells the model to ignore its task and do something else — return a fixed answer, refuse, or misclassify. Cheap, noisy, easy to detect.
- Data exfiltration through an output channel. The model is instructed to embed conversation contents or retrieved secrets into a URL, a citation, a markdown image reference, or a footnote that the client renders and fetches. This is the objective that turns a nuisance into a breach.
- Tool-call hijacking. In an agentic deployment, the injected text does not need to convince the user of anything. It only needs the model to call
send_email,create_pull_requestortransfer_fundswith attacker-chosen arguments. - Persistence. Where the application writes conversation state to long-term memory, an injection that survives into memory keeps executing in later, unrelated sessions.
Simon Willison’s “lethal trifecta” is the cleanest way to explain to a product owner why objective 2 matters more than objective 1: an agent holding private data, exposure to untrusted content, and any outbound communication channel at the same time has an exfiltration path by construction. Remove one leg and most of the payload class collapses regardless of whether your detector fired.
Where the deployment is agentic rather than a chat surface, the same three legs and the controls that break them are worked through in prompt injection in AI agents.
Indirect prompt injection examples from shipped products
Four disclosed cases show the same pattern: planted text, then data carried out through an image, a link or a pull request the assistant was already allowed to produce.
| Case | Disclosed | Injection channel | What happened | User action needed |
|---|---|---|---|---|
| Google Bard Extensions (Johann Rehberger) | Nov 2023 | A Google Doc shared with the victim | Chat history sent via a markdown image on Google Apps Script, which Bard’s CSP allowed | None beyond normal use |
| Slack AI (PromptArmor) | Aug 2024 | A public channel whose only member was the attacker | Private-channel API key appended to a “reauthenticate” link | One click |
| GitHub MCP server (Invariant Labs) | May 2025 | An issue on a public repository | Private repository data leaked in a pull request the agent opened | Owner asks the agent to review issues |
| EchoLeak, Microsoft 365 Copilot (Aim Labs) | June 2025; CVE-2025-32711, CVSS 9.3 | One crafted email | Context data sent out via an auto-fetched image and a CSP-allowed Teams URL | None (zero-click) |
The defenses that existed were bypassed rather than missing: EchoLeak evaded Microsoft’s XPIA (cross-prompt injection attempt) classifier and got past link redaction with reference-style markdown, per the paper by Reddy and Gujral. Fixes differed too: Salesforce told The Register it had deployed a patch after Slack first called the behavior intended, while Invariant Labs argued the GitHub flaw sits in agent design and cannot be patched server-side alone.
What the benchmarks measure
The most useful development for defenders since 2024 is that indirect injection now has published benchmarks with numbers attached, so “are we vulnerable” has an answer shape. Three are worth knowing, and they measure different things:
| Benchmark | Scope | Scale | Headline result |
|---|---|---|---|
| BIPIA | Indirect injection against LLMs consuming external content | First dedicated indirect-injection benchmark | Evaluated models universally vulnerable; fine-tuned white-box defense drives attack success near zero |
| InjecAgent | Indirect injection against tool-integrated agents | 1,054 test cases, 17 user tools, 62 attacker tools, 30 agents | ReAct-prompted GPT-4 vulnerable in 24% of cases; adding a reinforcing hacking prompt nearly doubles that |
| AgentDojo | Dynamic agent environment for attacks and defenses | 97 realistic tasks (email, e-banking, travel), 629 security test cases | Used in follow-on work reporting roughly 20% average attack success on a banking agent, with a 15 to 50 point drop in task utility under attack |
Two things fall out of that table. First, attack success rates in the 15 to 25 percent range are typical for undefended general-purpose agents, which means a single clean run against your own application proves very little. Second, AgentDojo’s design choice to score utility alongside security is the one most internal test plans miss: a defense that blocks every injection by making the agent refuse half its legitimate work has not improved anything. A 2025 study of data exfiltration from a banking agent found that no built-in AgentDojo defense fully prevented leakage, and that tasks resembling data extraction or authorization workflows had the highest attack success rates — structure of the task predicts risk as much as the model does.
If you want to turn this into a repeatable exercise rather than a one-off, the method is laid out in prompt injection testing: a repeatable method, and the framework choice is covered in Garak vs. PyRIT vs. promptmap.
Why indirect is harder to defend than direct
Direct injection has an attacker in the session. That gives you rate limits, account signals, abuse reporting and a clear notion of a malicious user. The distinction from jailbreaking matters, and it matters most here: with indirect injection the person in the session is the victim, every request looks legitimate, and the malicious content sits in a system you may not own. Your abuse signals point at the wrong party.
The practical consequences:
- Provenance is the missing primitive. You cannot filter what you cannot label. Tagging retrieved content at ingestion, and carrying that tag through to the prompt assembler, is the prerequisite for every other control.
- Detection sits downstream of the compromise. By the time a classifier sees the retrieved chunk, the attacker has already chosen the phrasing to beat it. Detection techniques and their documented bypasses is the honest accounting of what each layer buys, and the Rebuff architecture review shows the limit concretely: its four layers are built around the user’s input, so an injection arriving through retrieved content passes them unexamined.
- Blast radius is an architecture decision, not a prompt decision. Scoped credentials, human approval on state-changing actions, and separating the agent that reads untrusted content from the agent that holds tools are the controls that hold when detection misses. The sequencing is in the layered mitigation guide.
Indirect prompt injection defense, in order
No single control stops indirect prompt injection. NIST’s mitigations for NISTAML.015 span training, detection, input processing, system design and public education, and the report says current mitigations do not offer full protection. Microsoft’s MSRC write-up from July 2025 shows how those families stack in a shipped product:
- Mark untrusted content. Spotlighting wraps it in a randomized delimiter, interleaves a datamarking token through it, or encodes it in base64 or ROT13.
- Classify it, as a signal only. Prompt Shields is probabilistic, and EchoLeak evaded Microsoft’s XPIA classifier.
- Close exfiltration channels deterministically. After a reported markdown image leak, Microsoft blocked that technique and then the wider class, including certain untrusted links.
- Put a human on irreversible actions. Copilot in Outlook drafts the message; the user approves and sends it.
- Separate privileges by design. NIST suggests multiple LLMs with different permissions and narrow interfaces for untrusted data; Microsoft’s FIDES applies information-flow control to agents.
Then test adaptively. Microsoft’s LLMail-Inject challenge drew more than 800 participants and released over 370,000 prompts, the scale of creativity a static payload list is up against.
Working out your own exposure
The fastest way to scope this for a specific application is to enumerate which channels above your architecture actually has. The injection threat modeler does that mechanically: select the building blocks your app contains — retrieval, browsing, tools, memory, file upload, multi-modal input — and it returns the taxonomy classes that become reachable, the trust boundary each one crosses, and the defenses that apply. An application with no retrieval and no tools has a much smaller indirect surface than its vendor’s threat model assumes, and one with a browsing agent plus write-capable tools has a much larger one.
For deployers, the regulatory reading of an unmitigated injection is worth a look too. Where an indirect injection causes downstream harm, the question of who documented which control tends to arrive before the question of who wrote the payload.
Related reading
- How Prompt Injection Attacks Work: A Working Taxonomy
- Indirect Prompt Injection Against a Llama 3 RAG Pipeline
- Anatomy of a Real Prompt Injection: The Bing Chat / Sydney Case
- Invisible Prompt Injection: The Unicode Tag Smuggling Technique
- How to Mitigate Prompt Injection: A Layered Defense Guide
Related across the network
- Lakera Guard: Prompt Injection Detection in Practice — aisecreviews.com
FAQ
is indirect prompt injection the same as data poisoning
No. Data poisoning corrupts training data so the model itself learns bad behavior, and NIST files it separately as NISTAML.013. Indirect prompt injection leaves the model untouched and acts at inference time, through content placed in its context. Poisoning a RAG knowledge base is the overlap: NIST treats knowledge base poisoning as an integrity attack within indirect injection.
can indirect prompt injection be fully prevented
Not with current models. OWASP’s LLM01:2025 entry says it is unclear whether fool-proof prevention exists, because generation is stochastic. What can be made deterministic is the blast radius: blocking exfiltration channels, scoping credentials, requiring approval for state-changing actions, and information-flow designs such as Microsoft’s FIDES that stop untrusted data from steering an agent’s actions.
does indirect prompt injection require the user to click a link
Not always. Slack AI’s 2024 exfiltration needed one click on a fake reauthentication link, but EchoLeak (CVE-2025-32711) against Microsoft 365 Copilot was zero-click: a single crafted email, and the client’s automatic image fetch carried data out. Rehberger’s 2023 Bard attack worked the same way, through a markdown image the browser loaded on its own.
what is injection indirecte de prompt
It is the French term for indirect prompt injection: instructions hidden in content an AI system reads, such as an email or web page, rather than typed by the user. ANSSI’s April 2024 generative AI recommendations (ANSSI-PA-102) call it “injection de requête indirecte” and flag the risk of sending uncontrolled data to the model.