Robots Atlas>ROBOTS ATLAS
Safety

Indirect prompt injection

2023ActivePublished: 18 November 2026Updated: 18 November 2026Published
Key innovation
Decouples the attacker from the model: malicious instructions are not typed into the prompt directly but hidden inside external data (a webpage, document, email, or tool output) that the LLM later retrieves and loads into its context — making the attack remote and requiring no interaction between the victim and the attacker.
Category
Safety
Abstraction level
Pattern
Operation level
DataRetrievalToolingAgent runtimeInferenceApplicationSystem
Use cases
Data exfiltration via an agent with web or tool accessHidden text on a webpage hijacking a browsing agentPayload inside a document/PDF submitted for summarizationInstructions hidden in an email read by an AI assistantPoisoning a knowledge base / RAG corpusInjection through a tool output or API responseSystem prompt disclosureUnauthorized tool / action calls in an agentic system

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

Untrusted data sourceThe payload carrier that enters the model’s context.

An external resource the attacker controls or can influence: a webpage, document, email, RAG knowledge base, or tool output.

Hidden instruction payloadThe actual vector that hijacks model behavior.

Crafted text phrased as a command, often disguised (white text, zero-width characters, encoding, image) — invisible to humans, readable by the model.

Context mergeThe root cause: no separation of instructions from data.

The point at which untrusted data lands in the context window next to the system prompt and user instruction, with no durable trust boundary.

Action surface (tools/agent)The impact amplifier — it determines the real blast radius.

The tools, browsing, memory, and APIs available to the model that turn a textual hijack into real-world effects (exfiltration, API calls).

Implementation

Implementation pitfalls
Relying on prompt-based defenses aloneHigh

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.

Fix:Treat all external content as untrusted; apply layered controls outside the prompt (sandboxing, least privilege, human-in-the-loop for sensitive actions).
Unconstrained agent access to tools and networkCritical

An agent with broad permissions and network access turns a successful injection into data exfiltration or unauthorized actions.

Fix:Least privilege, domain/tool allowlisting, isolation (agent sandboxing), and approval gates for high-risk actions.
No separation of data and instruction channelsMedium

Dumping raw external content into the same context as instructions increases exposure; provenance tagging and filtering are missing.

Fix:Tag content provenance, filter/sanitize inputs, and apply guardrails and classifiers that detect injection attempts.

Evolution

Original paper · 2023 · AISec @ CCS 2023 (arXiv:2302.12173) · Kai Greshake
Not what you’ve signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection
Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz, Mario Fritz
2023
Greshake et al. define and demonstrate indirect prompt injection
Inflection point

The paper “Not what you’ve signed up for” shows remote compromise of real-world LLM-integrated applications via external content.

2025
OWASP LLM01:2025 explicitly separates direct and indirect prompt injection

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).