One Email, Zero Clicks: How Indirect Prompt Injection Makes AI Assistants Leak Data
An inbox assistant gets a small job: summarize one email from a stranger. It writes a short, tidy summary and the user moves on. The user typed nothing odd and clicked nothing. Yet a copy of their recent messages now sit
An inbox assistant gets a small job: summarize one email from a stranger. It writes a short, tidy summary and the user moves on. The user typed nothing odd and clicked nothing. Yet a copy of their recent messages now sits on a server the stranger controls.
Where did the order to send those messages come from? Not from the user. It came from the email itself. This is indirect prompt injection, and it is one of the clearest examples of why AI assistants are hard to secure.
What indirect prompt injection is
Many products now put a large language model (LLM) between people and their data. These assistants read web pages, inboxes, shared files and code repositories. Some can also act, for example by sending a message.
In direct prompt injection, the attacker types into the chat. In the indirect case, the attacker never talks to the assistant. They plant instructions in content the assistant will read later, then wait for a real user to ask for an ordinary task like "summarize this". The attacker controls a resource, not the chat. The user is the victim.
This is not only a lab idea. OWASP lists prompt injection as LLM01, the first entry in its Top 10 for LLM applications. One real case, EchoLeak in Microsoft 365 Copilot (CVE-2025-32711), was scored 9.3 Critical. Researchers showed that a single email could leak data with zero clicks.
Why the model cannot tell data from instructions
When I explain this to people, I start with how the prompt is built. An LLM application joins several things into one long block of text: the developer's instructions, the user's request, and any content it fetched for the task, such as the email. Everything the model reads for one answer is called the context window.
Here is the problem. The model sees that block as one stream of text. Nothing inside it marks which words came from the developer, which from the user and which from a stranger. The model does one thing: predict the next piece of text. There is no separate channel for commands.
So when the fetched content contains text shaped like an instruction, the model may follow it, either instead of the user's task or on top of it. The UK's NCSC calls the result an "inherently confusable deputy". The helper holds the user's access, but a stranger with much less access can talk it into doing their work. The model acts with the user's privileges, not the attacker's.
It gets worse. The planted text is often hidden, for example as invisible text on a page. The answer on screen can look completely normal.
What it takes to steal data
Data theft needs three conditions at once. Simon Willison calls them the lethal trifecta:
- The model can reach private data, such as the user's mail or files.
- The model reads untrusted content, such as an email from a stranger.
- The model has a way to send data out, such as loading a link or an image from the internet.
Remove any one of the three and this kind of leak is blocked. In the inbox example, all three are present. The assistant can read the mailbox, it reads the stranger's email, and it can load an image whose web address carries the stolen text. The image loads by itself, so the user sees nothing and clicks nothing.
Public research shows other outcomes too: actions in the user's name, bent answers, and text saved in memory that acts again in later sessions. The more the assistant can do, the more the attacker can do.
How defenders reduce it
Nobody has shown a complete fix. OWASP says it is unclear whether any method can prevent injection completely. But some controls are much stronger than others.
- Prefer hard rules over filters. A fixed rule that gives the same result every time is a guarantee. A classifier only lowers the odds. Build on the first kind and add the second on top.
- Limit what the agent can do after it reads outside content. Once untrusted text is in its context, it should not be able to start an important action.
- Use least privilege. Give the assistant only the data and permissions each task needs.
- Close the exits. Do not render external images, redact links to unknown domains, and use a strict Content Security Policy. This stopped many real leaks, but it does not stop everything.
- Ask a person to approve important actions. This helps, but "Always Allow" settings and approval fatigue weaken it.
- Log everything. Record full model inputs, outputs and tool calls, and alert on links to unknown domains that carry encoded data.
- Test with adaptive attackers. Attackers who know the defense beat most tested detectors in one study. A tougher system prompt alone does not fix this.
How to explain it in an interview
Here is the short version I would give. Indirect prompt injection is when instructions reach a language model through content it reads, not through the person using it. The attacker plants text in a page, email, file or tool result. The application joins that text with its own instructions and the user's request, and the model cannot reliably tell instructions from data, so it may follow the attacker's text while it works for the user.
What the attacker gets depends on what the assistant can do. Data theft needs private data, untrusted content and a way out. Then say what you would do about it: do not rely on filters, because they lower the odds but adaptive attackers still get through. The hard guarantees come from design.
Two weak answers to avoid: "just sanitize the input, like SQL injection" (SQL has parameterized queries, language models have no equivalent) and "human approval solves it" (it helps, but it can fail).
The full free lesson, with a quiz and flashcards, is on ExplainTheHack: https://explainthehack.com/lessons/indirect-prompt-injection
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.