Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Indirect prompt injection hides instructions in content an AI system reads while doing its job, so the attacker never speaks to the model and the victim never sees the payload.

What Is Indirect Prompt Injection?
Indirect prompt injection is the version of the attack where the attacker never interacts with the AI system at all. Instead they place instructions in something the system will later read on a user’s behalf: a web page, an email, a shared document, a code comment, a calendar invitation, a product review, a support ticket. The model consumes that text as part of its context, cannot distinguish it from its own instructions, and acts on it. The user sees a normal task and a normal-looking answer.
In a direct attack, the person typing is the attacker, so the worst case is usually that they extract the system prompt or make the model say something embarrassing to themselves. In an indirect attack the victim is a legitimate user with legitimate access, and the attacker is somewhere upstream. That changes everything about the risk: the payload runs with the victim’s permissions, the victim has no reason to be suspicious, and in an agentic system the result is agent hijacking rather than an odd reply. Prompt injection in general sits at LLM01 in the OWASP Top 10 for LLM Applications, and the indirect variant is what makes it a supply-chain-shaped problem.
The technique was named and demonstrated by Kai Greshake and colleagues in 2023, who showed a browsing assistant being redirected by text on a page it visited. The most consequential disclosure so far is EchoLeak, tracked as CVE-2025-32711 and published in June 2025: researchers at Aim Security showed that a crafted email could cause Microsoft 365 Copilot to exfiltrate data from a user’s context without the recipient clicking anything, by chaining an injected instruction with an automatically loaded resource. Microsoft fixed it server-side and reported no known exploitation. Other work has shown instructions hidden in resumes influencing applicant screening, and payloads in public repository issues steering coding agents.
A classifier can catch familiar phrasings such as “ignore previous instructions”, and that is worth having. It will not catch instructions written as prose, split across a document, encoded, expressed in another language, or phrased as a plausible policy note—and every published filter attracts bypass research within weeks. The NCSC has been explicit that prompt injection may not have a complete technical solution, which is a design instruction rather than a counsel of despair: build on the assumption that some injections will succeed and make the consequences survivable.
Keep the blast radius small. Scope credentials to the task, prefer read-only paths, and enforce the requesting user’s permissions at retrieval time rather than using a broad service account. Require human approval for actions that send, publish, pay, or delete, showing the real parameters. Restrict outbound destinations with an allow-list, which closes the markdown-image and link-based exfiltration channels that most proof-of-concept attacks rely on. Sanitise retrieved content by stripping hidden text, scripts, and invisible characters before it reaches the model, and mark untrusted segments clearly in the context. Treat model output as untrusted input to whatever consumes it next, encoding it for the browser and parameterising it for the database. Then test it: adversarial content in every ingestion channel belongs in your AI red teaming scope. At Privia Security, we trace every path untrusted text can take into an AI system during our AI Penetration Test Services.
In a direct attack the attacker is the person typing, so they mainly harm their own session. In an indirect attack the instructions are hidden in content a legitimate user’s AI system processes, so the payload executes with that user’s permissions and credentials while they see nothing unusual. The indirect form is harder to detect and carries far greater impact.
Partly. Stripping invisible characters, white or zero-size text, HTML comments, metadata, and speaker notes before indexing removes the crude cases and is worth doing. Instructions written in ordinary prose are indistinguishable from legitimate content, so detection should be one layer rather than the control you rely on. Design so that a successful injection cannot reach anything valuable.
Yes, at lower severity. An injection can still cause a read-only assistant to produce manipulated answers, reveal its system prompt, surface retrieved content the user should not combine, or emit output that triggers cross-site scripting in the interface. The severity rises sharply the moment the assistant can write, send, or call an external service.
A zero-click indirect prompt injection in Microsoft 365 Copilot, disclosed in June 2025 as CVE-2025-32711. A specially crafted email placed instructions in the assistant’s context, and data could be exfiltrated through an automatically retrieved resource without any user interaction. Microsoft remediated it server-side. It is the clearest demonstration that the attack does not require a careless user.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.