AI GLOSSARY · SAFETY, ETHICS AND GOVERNANCE
Indirect prompt injection
Definition
Indirect prompt injection is a form of prompt injection in which the malicious instructions sit in content the model fetches or is given, such as a web page, email or file, instead of being typed by the user.
Also called: indirect injection, prompt injection via documents, indirect prompt injection attack, IPI.
In plain language
Indirect prompt injection does not require the attacker to interact directly with the AI. Its defining route is instructions planted in external material the application processes. Imagine you ask an assistant to summarise a web page, and the page contains hidden text telling the assistant to send your private notes to a stranger. The page content can influence the model's context, and the assistant may treat the malicious line as an order. The main limitation of any defence is that nobody has a complete fix, so the safer habit is to limit what the assistant can do. The risk grows with its access: an assistant that can only summarise can embarrass you, while one that can send email or run commands can cause real loss.
Technical definition
In indirect prompt injection, adversary-written instructions arrive through a data channel the application retrieves, such as a web page, document, email or tool result, not through the user's own input. Greshake and colleagues, in a paper first submitted to arXiv in February 2023, describe attackers strategically injecting prompts into data likely to be retrieved, which lets them attack LLM-integrated applications remotely. OWASP's LLM01 entry says indirect injections occur when an LLM accepts input from external sources such as websites or files. Its mitigations include segregating and identifying external content, least-privilege access, human approval for high-risk actions, input and output filtering, and adversarial testing.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Guide · Illustrative, not executed
Check a Claude Skill From GitHub Before Installing It
- What you see
- A step-by-step review of a GitHub skill before it runs, including searching for injected shell commands, hooks and pre-approved tools, and reading scripts before you install.
- Why it exercises the concept
- A skill file is text an agent will read and may follow. Reviewing it first is a hands-on way to treat outside content as untrusted before the agent sees it.
Skill by Skill Almanac · Illustrative, not executed
skill-safety-audit 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A scan of a third-party agent skill folder that returns a JSON risk table with evidence lines before you install it.
- Why it exercises the concept
- It checks one common channel for planted instructions, a third-party skill, before an agent is allowed to load it.
Skill by Skill Almanac · Illustrative, not executed
prompt-writing 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- A skill that writes and lints LLM prompts with a fixed structure, injection rules and a numeric test plan.
- Why it exercises the concept
- It covers injection rules at the prompt-writing stage.
Coding tool · Illustrative, not executed
Claude Code
- What you see
- Claude Code's security page lists best practices for untrusted content, including avoiding piping untrusted content directly to Claude and reviewing suggested commands before approval.
- Why it exercises the concept
- Claude Code reads files, web pages and tool results, so those are the channels through which indirect injection could arrive. Its documentation describes the safeguards.
How it shows up when you use agents
Every time a coding agent reads something you did not write, indirect prompt injection is possible. That includes a README in a cloned repository, a web page fetched during research, an issue comment, a tool result from an MCP server, or a third-party skill file. Untrusted external content can influence the model's context, whether supplied directly, through multimodal inputs or through a tool-produced summary. It need not arrive as one undifferentiated text stream. IBM describes the attack as hackers hiding payloads in the data the LLM consumes.
This is why the damage depends on access. A model that only returns text can mislead you. An agent with tool calling can act on the injected line: read a secret, run a command, send a message. Anthropic's Claude Code documentation advises reviewing suggested commands before approval and avoiding piping untrusted content directly to Claude.
What breaks when this is misunderstood: people assume that a message from the user is the only source of instructions, and approve actions without asking where the idea came from. Next action: before an agent processes outside content, decide what it could do if that content lied, and remove that access or require approval. The guide Check a Claude skill from GitHub before installing applies this to skills. See also prompt injection for the general concept.
Common confusions
- Indirect versus direct prompt injection. In direct injection, the person using the model types the manipulating input. In indirect injection, the instructions come from external content the model reads. OWASP treats both under LLM01.
- Indirect injection versus jailbreak. A jailbreak is a user trying to get the model to break its own rules. Indirect injection delivers malicious instructions through external content; the user may or may not see them.
- Visible versus hidden. Injected text does not have to be visible to a person. IBM notes that malicious prompts can also be embedded in images that an LLM scans.
- Myth: a filter solves it. IBM says input filters can block known injections but new malicious prompts can evade them, and OWASP lists filtering as one mitigation among several.
Related terms
Terms that mention Indirect prompt injection
1 terms mention this one
More in Safety, ethics and governance
Sources
- Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection, arXiv (Greshake et al.) (accessed 2026-11-24)
- LLM01:2025 Prompt Injection, OWASP GenAI Security Project (accessed 2026-11-24)
- What is a prompt injection attack?, IBM (accessed 2026-11-24)
- Security, Anthropic (Claude Code Docs) (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude (original draft) and OpenAI Codex (targeted revisions); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .
Change log (6)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
- : Targeted batch-07 source repairs: qualified required legal, security or example scope. Independent affected review pending; no publication approval.
- : First version.
- : Verifier pass: replaced unsourced claim and dropped stretch clause.
- : Corrected explicit MCP-server anchor; link-only verification does not assert complete content approval.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.