Indirect prompt injection
How it works
A typical flow: 1) The attacker places an instruction payload in a resource the victim (or their agent) is likely to process — hidden text on a page, a comment in a document, an email body, or an entry in a knowledge base used by RAG. 2) The user or agent runs a task that fetches that resource (browsing, summarizing, searching, reading a tool result). 3) The content enters the context window alongside the system prompt and the user instruction. 4) Unable to tell data from instructions, the model executes the payload: it alters its answer, leaks the system prompt, calls tools, exfiltrates data, or edits memory. 5) In agentic systems the effect can cascade into later steps and tools. Payloads are often disguised (white text, zero-width characters, encoding, hiding inside an image) so they are invisible to humans but readable by the model.
Problem solved
From the attacker’s side, IPI defeats the assumption that only user-typed input is dangerous. It shows that any untrusted content entering the model’s context (documents, pages, tool outputs) is an attack surface. From the defender’s side it is a threat vector to be modeled and contained — not a feature to be built.
Components
An external resource the attacker controls or can influence: a webpage, document, email, RAG knowledge base, or tool output.
Crafted text phrased as a command, often disguised (white text, zero-width characters, encoding, image) — invisible to humans, readable by the model.
The point at which untrusted data lands in the context window next to the system prompt and user instruction, with no durable trust boundary.
The tools, browsing, memory, and APIs available to the model that turn a textual hijack into real-world effects (exfiltration, API calls).
Implementation
Adding “ignore instructions in the data” to the system prompt is not reliable — the model still has no hard trust boundary and it can be bypassed.
An agent with broad permissions and network access turns a successful injection into data exfiltration or unauthorized actions.
Dumping raw external content into the same context as instructions increases exposure; provenance tagging and filtering are missing.
Evolution
The paper “Not what you’ve signed up for” shows remote compromise of real-world LLM-integrated applications via external content.
In the OWASP Top 10 for LLM Applications, prompt injection remains the #1 risk (LLM01), explicitly distinguishing the indirect variant (input from external sources such as websites and files).