Indirect Prompt Injection
Key Takeaways
- Indirect prompt injection is a variant of prompt injection where malicious instructions reach the model through external content it processes, not through the user’s own input.
- OWASP’s Top 10 for LLM Applications 2025 lists prompt injection as LLM01 and explicitly covers both direct and indirect forms.
- Any content source an LLM app reads, including web pages, documents, emails, retrieved chunks and tool outputs, can carry an indirect injection payload.
- Impact scales with the model’s permissions, so agents with tool access face far higher stakes than read-only chatbots.
What Is Indirect Prompt Injection?
Indirect prompt injection is an attack in which an adversary places instructions inside data that a large language model will later consume, causing the model to act on the attacker’s intent instead of the user’s. The victim never types the malicious prompt. They simply ask the assistant to summarize a page, answer from a knowledge base or process an inbox, and the payload rides in with the content.
It is the specific variant of prompt injection that matters most for agentic systems. Direct injection requires the attacker to talk to the model. Indirect injection only requires the attacker to get text somewhere the model will read it, which is a much lower bar.
Why Indirect Prompt Injection Matters
The attacker never needs access
A hidden instruction in a public web page, a shared document or a product review can reach any user whose assistant reads that content. The attacker does not need an account on the target application.
Models cannot reliably separate data from instructions
LLMs process instructions and content in the same context window. No current technique guarantees that a model will treat retrieved text strictly as data, which is why OWASP frames prompt injection as a risk to be managed rather than fully eliminated.
Agents turn text into actions
When an assistant can send email, call APIs or edit files, a successful injection becomes an action. That is where indirect injection connects to agentic AI risk and excessive agency.
Payloads can be invisible
Instructions can be hidden with white-on-white text, HTML comments, metadata or content outside the visible area of a page. A human reviewer may see nothing wrong.
How Indirect Prompt Injection Works
Seeding the content
The attacker plants instructions in a source the target model will ingest: a web page, a PDF, a calendar invite, a support ticket, a code comment or an MCP tool’s output.
Retrieval into context
The application pulls that content into the prompt through browsing, retrieval-augmented generation or a tool call. The payload now sits next to the system prompt and the user’s request.
Hijacking the task
The model follows the injected instructions, which might tell it to ignore prior guidance, change its answer, call a tool or include data in a link.
Exfiltration or action
Data leaves through an allowed channel, such as a rendered image URL, a tool parameter or an outbound message. The user often sees a normal-looking response.
Indirect Prompt Injection vs Direct Prompt Injection
Source of the instructions
Direct prompt injection comes from the person interacting with the model, often to bypass safety rules. Indirect prompt injection comes from third-party content the model processes on the user’s behalf.
Who gets harmed
In direct injection the attacker is usually the user, so the main risk is to the application owner. In indirect injection the user is typically the victim, and their data or permissions are what get abused.
How to test for it
Direct injection and LLM jailbreak testing focus on crafted user prompts. Indirect injection testing means controlling the content the app retrieves and observing what the agent does with it end to end.
How Novee Approaches Indirect Prompt Injection
Novee’s AI Red Teaming solution tests LLM-powered apps and agents by planting attacker-controlled content where the system will read it and reasoning about which workflows and permissions that content could hijack. MCP servers became a Novee asset type in October 2026, and the Novee Prompt Library supports targeted testing of these new attack surfaces. Three independent agents validate each finding, and Agentic Remediation retests to verify fixes actually hold.
FAQ
No. Data poisoning corrupts the data a model is trained or fine-tuned on, which changes the model itself. Indirect prompt injection leaves the model unchanged and instead plants instructions in content the model reads at runtime. OWASP tracks them as separate risks in its Top 10 for LLM Applications 2025.
Filters help but are not sufficient. Attackers can rephrase, encode or hide instructions in ways that slip past pattern matching. Stronger defenses combine least-privilege tool access, human approval for sensitive actions, isolation of untrusted content and continuous adversarial testing of the full application.
Applications that read untrusted external content and can also take actions carry the most risk. Examples include browsing assistants, email and calendar agents, coding assistants and RAG systems over shared documents. Read-only chatbots with no tool access are still affected, but the potential impact is usually smaller.