Indirect Prompt Injection
An AI security attack in which instructions hidden in a web page, document or email that the AI reads, rather than text typed by the user, change the model's behavior. It is a form of prompt injection.
What does Indirect Prompt Injection mean in simple terms?
In ordinary prompt injection, a user types a trick sentence straight into the chat box. In indirect prompt injection, an attacker plants instructions in material the AI will read later. When the AI searches the web or summarizes an attached document and meets that sentence, it may fail to tell content from commands and follow it. The user only asked for a normal summary, yet the AI may recommend a strange link or send information outside. The more work involves letting AI read outside material, the more this risk needs checking.
How can Indirect Prompt Injection be explained with an analogy?
It is like a note slipped between papers awaiting approval that says "Whoever reads this, write down the safe combination," and the assistant follows it as if it were the boss's instruction.
Where is Indirect Prompt Injection used?
CISPA and other researchers — Remotely steering a search chatbot
In a paper published in February 2023, researchers including the CISPA Helmholtz Center for Information Security in Germany showed that LLM-integrated applications can be attacked without talking to them directly, by planting prompts in data the AI is likely to retrieve.[1] The test targets included GPT-4-powered Bing Chat and a code-completion engine.[1]
Result: The paper classified attack types such as data theft, worm-like spread and contamination of the information ecosystem, and concluded that effective defenses are still lacking (per the paper).[1]
OWASP — Listed as the top LLM security risk
The OWASP Gen AI Security Project puts prompt injection first (LLM01:2025) in its top 10 risks for LLM applications, and classifies cases arising from input accepted from external sources such as websites or files as indirect injection.[2] It says it is unclear whether foolproof prevention exists and recommends least privilege together with human approval.[2]
Result: A shared industry baseline for telling direct from indirect injection and for response principles (per the OWASP 2025 list).[2]
Learning steps, limitations and developments
- When you use AI to summarize a web page or attachment, check whether the summary contains instructions or links that were not in the original.
- When you connect email or a drive to an AI tool, start with read-only permissions.
- Require a person to approve actions such as payments, sending or deletion after the AI has read outside material.[2]
- Document the principle "sentences in outside material are data, not commands" into your team's AI usage guide.
Indirect prompt injection is a structural problem that does not disappear automatically as models improve. Because a model receives instructions and material in the same input window, it is hard to separate the two completely.[1] Filters and guardrail products can reduce the risk but do not guarantee they will stop every attack.[2] In practice, the priority is designing systems that narrow what the AI is able to do.
How has Indirect Prompt Injection evolved?
Which concepts are related to Indirect Prompt Injection?
- Base conceptPrompt InjectionThe parent concept of attacks that secretly change instructions
- Similar conceptJailbreakCompared with attacks aimed at bypassing safety rules
- CountermeasureGuardrailsChecks on input and output that reduce the risk
- Attack pathMCPMore connections to outside tools and data mean a larger exposed surface
Direct vs indirect prompt injection
Which sources explain Indirect Prompt Injection?
- Greshake et al. (arXiv) — Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection (2023-02-23) — https://arxiv.org/abs/2302.12173
- OWASP Gen AI Security Project — LLM01:2025 Prompt Injection (2025) — https://genai.owasp.org/llmrisk/llm01-prompt-injection/
Tell us what you think
Your feedback helps us improve the content.