Indirect Prompt Injection
Indirect prompt injection is a type of attack against AI systems that use large language models to read outside content, such as web pages, documents, or emails. Instead of typing a malicious instruction directly into the AI, the attacker hides instructions inside content the AI will later pull in and process, so the system may follow those hidden instructions without the user realizing it. Because the attacker never interacts with the AI directly, this route can be harder to detect than a direct prompt.
Indirect prompt injection (IDPI) is an adversarial technique in which malicious or manipulated instructions are embedded within untrusted external data sources that an LLM-based system ingests and processes, rather than being supplied directly by the user. As described in the evidence, such payloads may be hidden in text, code, emojis, website content, or other retrieved material, and are typically activated when the model incorporates that content into its context (for example, during retrieval, browsing, or document processing). The attack exploits the model's difficulty in distinguishing trusted system or user instructions from instructions contained in the data it is asked to handle. Note: the evidence describes the attack pattern and its risk surface but does not establish a single authoritative definition or standardized taxonomy; detection, mitigation efficacy, and scope may vary by system architecture and are not fully characterized in the sources provided.
Why it matters
Indirect prompt injection matters because it targets a structural weakness in how large language model systems operate: as described in the evidence, these systems often ingest and process untrusted external data, and the model can struggle to distinguish trusted user or system instructions from instructions hidden inside that data. As AI systems are increasingly connected to web browsing, document processing, email, and retrieval pipelines, the attack surface expands to include any content the system might pull in. This shifts the threat model away from what a user types directly and toward whatever untrusted material the system is asked to handle.
A distinguishing risk is that the attacker never interacts with the AI directly. Because the malicious instructions arrive through content the system later ingests, this route can be harder to detect than a direct prompt, and the affected user may be unaware that hidden instructions were followed. This has implications for organizations deploying LLM-based agents or assistants with access to sensitive data or downstream actions, since the pathway for manipulation lies in the data sources rather than in a monitored input field.
It is worth noting the limits of current understanding. The sources describe the attack pattern and its risk surface but do not establish a single authoritative definition or standardized taxonomy. Detection and mitigation efficacy may vary substantially by system architecture and are not fully characterized in the evidence provided, so organizations should treat controls as measures that reduce and manage this risk rather than eliminate it.
Who it's relevant to
Inside IDPI
Common questions
Answers to the questions practitioners most commonly ask about IDPI.