Why agents can't separate instructions from data
An agent loop builds one input for every model call. It holds the system prompt, tool definitions, the user's request and every tool result so far, all in one context window. A fetched web page sits in the same sequence as the user's instructions. A label like "this is a tool result" is just more text.
OWASP's LLM01:2026 guidance says the same thing. Per OWASP's wording, LLMs make no architectural distinction between "instructions" and "data". Both are tokens on the same stream, so there is no clean equivalent to parameterized queries. The entry also lists the ways instructions can arrive: direct input, retrieved content, tool output, images, audio, video and persistent memory.
Two terms matter here:
- Direct injection: the person typing to the model supplies the malicious instructions.
- Indirect injection: the agent meets attacker-written instructions in content it reads while working for someone else. Examples are a web page, an email, a calendar invite, a PDF, a code comment or a tool result.
The practical conclusion is that you shouldn't build on the hope that the model will spot every hostile string. Ask what a fooled model can actually do.
From injection to data theft: the exfiltration channels
An injection that only changes an answer is a nuisance. It becomes a breach when the agent can carry data to a server the attacker controls. The MLQ.ai lesson lists these channels:
- Send tools: the agent emails, messages or posts the data.
- HTTP requests: the agent fetches a URL with data in the address or body.
- Rendered images or links: the model writes a markdown image whose URL carries the data. The chat client then loads it, so nobody has to click.
- Tool arguments: the agent passes data as a parameter to a tool the attacker runs.
- Networked code: the agent writes and runs code that opens a connection.
The image channel shows that the client is part of the security boundary. The model only wrote text, and the client's rendering sent the data. The lesson cites Simon Willison's catalogue of products where this pattern was reported. It names ChatGPT, Google Bard, GitHub Copilot Chat and Anthropic's Claude iOS app. The fix it describes sits in the client: don't render images or links from domains outside an allowlist. OWASP's guidance also covers invisible-character smuggling and says to strip those characters at ingest and render boundaries.
Not every route works every time. A leak needs a viable path from sensitive context to an externally visible request. It also depends on what the model put in the URL and what the client renders.
EchoLeak: the Microsoft 365 Copilot case
EchoLeak (CVE-2025-32711) is the Microsoft-specific example. It was a zero-click indirect prompt injection vulnerability in Microsoft 365 Copilot, disclosed by Aim Security researchers in June 2025. It carries a CVSS score of 9.3.
How the attack worked, as the lesson and the follow-up reporting describe it:
- The attacker sends an ordinary-looking email. Per SecurityWeek's account as relayed in the lesson, its instructions read as if addressed to the human recipient, with no mention of AI. That got it past Microsoft's cross-prompt injection (XPIA) classifiers.
- The email sits untouched. It sits there until the victim later asks Copilot an unrelated question, such as a routine summary.
- Copilot retrieves the email as relevant context and follows its instructions. EchoLeak exfiltrated data through auto-fetched image URLs embedded in Copilot responses.
- OWASP lists the case as a zero-click, document-borne exfiltration scenario. It says the attack bypassed both the deployed prompt-injection classifier and the link-redaction filter.
Remediation status. Microsoft's advisory, as quoted in the lesson, rates the flaw Critical and says it was fully mitigated with no action required of users. Secondary reports agree that no customer action was needed and that no in-the-wild exploitation was reported. One tracker says Microsoft patched server-side before disclosure and that no exploitation was reported. Accounts differ on timing. One vendor says the fix came in May 2025, before the June disclosure. Another says Microsoft addressed it in June 2025 as part of that month's Patch Tuesday. A third gives a May 2026 patch date, which doesn't match the others. I couldn't retrieve Microsoft's advisory directly, so treat the exact patch date as unsettled. The "no action required, fully mitigated" status is consistent across sources.
Why it still matters. The specific chain is closed, but the pattern isn't. EchoLeak is a case of an assistant mixing untrusted external email with trusted internal data. In the lesson's words, a model's training to resist injections is no substitute for permissions.
The lethal trifecta as a design checklist
Willison's June 2025 "lethal trifecta" is a pre-deployment test. An agent is exposed when it combines three things:
- Access to your private data.
- Exposure to untrusted content.
- The ability to communicate externally in a way that could steal your data.
OWASP endorses the same check. Removing any one leg removes the conditions for high-impact exploitation. This stops one theft route and nothing more. A wrong answer or a deleted file remains possible with any leg removed.
The MLQ.ai email-assistant walkthrough shows how to count the legs. The assistant has read_inbox, send_email and delete_email. A stranger's message tells it to forward the last ten emails and delete the message.
read_inboxsupplies both the private data and the untrusted content, since anyone can email you.send_emailis the exfiltration channel.delete_emailonly covers the tracks. Removing it makes the attack visible but doesn't stop it.- Removing
send_emailstops the attack. Requiring approval on every send also stops it, but it's weaker. A person may click through without reading, though the feature stays.
OWASP's guidance sharpens the approval point. The reviewer should see the exact rendered action, not a summary. It also warns that invisible characters can make the displayed action differ from the executed one, and that approval fatigue degrades judgment at volume.
MCP tool poisoning, rug pulls and shadowing
Tool descriptions are another attack surface. Invariant Labs described tool poisoning on April 1, 2025. It occurs when malicious instructions are embedded within MCP tool descriptions that are invisible to users but visible to AI models.
Their Cursor demonstration used an innocent-looking add tool. Hidden instructions led the agent to read ~/.cursor/mcp.json and SSH keys and send them to the malicious server. Cursor's confirmation dialog showed a summarized tool name. Even in extended mode it did not show the full tool input, so the SSH key stayed hidden.
The post names two related patterns:
- Rug pull: a server changes its tool description after the client has already approved it.
- Shadowing: one server's description alters how the agent uses a different, trusted tool. In the demo, a bogus
addtool made the agent send all emails to the attacker, even when the user named another recipient.
Treat these as a documented vendor research demonstration, not proof that every MCP server or client is compromised. Invariant also sells agent-security tooling, so read its framing with that in mind. OWASP's independent guidance reaches a similar place. It says to pin, sign and verify MCP servers and third-party tool packages, and to audit tool descriptions for hidden instructions. It also notes the limits: pinning doesn't stop a payload shipped in the pinned version.
Permissions: reversibility and blast radius
If the model can be steered, safety has to come from what the harness allows. MLQ.ai sorts actions with two questions:
- Reversibility: can a mistake be undone cheaply? A draft can be; a sent email can't.
- Blast radius: how much can one bad action affect? One scratch file is small. A production database command or a payment is large.
The resulting rule has three tiers. Let the agent act when both risks are low. Require approval for irreversible or wide actions. Remove the tool entirely when an action is irreversible, wide and unnecessary.
The standard controls, which the lesson says Anthropic's computer-use documentation mirrors:
- Least privilege: each task gets only the tools and data it needs.
- Scoped credentials: use a read-only key for a research agent, not the owner's key.
- Sandboxed execution: run code and computer use in a dedicated VM or container with minimal privileges.
- Network allowlists: let the agent reach only named domains.
- Human confirmation: require it for actions with real-world consequences.
For a Microsoft 365 shop, the practical question is what a Copilot or agent can reach once a hostile email or document lands in its context. One analyst writeup frames it this way: Copilot's reach across Microsoft 365 means a successful injection can retrieve information from multiple sources, making least-privilege access critical.
What the defense research shows
AgentDojo is a benchmark of 97 realistic tasks and 629 security test cases. The authors found state-of-the-art LLMs fail at many tasks even without attacks. The MLQ.ai lesson reports these GPT-4o defense results under the "important message" attack. I couldn't retrieve the paper's tables myself, so these figures come from the lesson:
| Defense | Targeted attack success | Benign task success |
|---|---|---|
| None | 57.7% | 69.0% |
| Prompt-injection detector | 8.0% | 41.5% |
| Tool filter (tools chosen per task in advance) | 6.8% | 73.1% |
| Repeat the user's prompt | 27.8% | not given in the lesson |
The lesson also notes that the paper's per-model table reports a different no-defense rate, 47.7%, for GPT-4o. Don't mix the two figures. These are benchmark-specific results, not production guarantees. The detector cut attacks but also cut usefulness sharply. The tool filter looked best here, but it can't remove a tool the task genuinely needs.
OWASP adds a warning about static test numbers. It cites research finding that adaptive attack success exceeded 90% for most of 12 recent defenses, though static attack success was near zero. Test against attackers who know your defense.
Filters lower the odds but don't close the door. The lesson points out that a 95% block rate still gives a retrying attacker roughly a 99.4% chance of getting through in 100 attempts. EchoLeak beat a production classifier.
Dual-LLM pattern. Willison's 2023 proposal splits the agent in two. A privileged model takes instructions only from the user and can call tools. A quarantined model reads untrusted content and has no tool access. Plain code passes results between them as variables. Willison himself said it isn't 100% reliable, because injected text could still try to trick the user. He also noted it complicates building products.
CaMeL comes from researchers at Google, Google DeepMind and ETH Zurich. The abstract says it explicitly extracts the control and data flows from the trusted query, so untrusted data can never impact the program flow. It also uses capabilities to block exfiltration over unauthorized data flows. It solved 77% of AgentDojo tasks with provable security, against 84% for an undefended system.
The costs are real:
- Someone has to write and maintain the policies.
- Tasks whose next step depends on what the data says fit less well.
- The guarantee covers data flows, not whether the data is true. An attacker who can't change the plan may still change a figure on a poisoned page.
What admins and developers should do
- Inventory every agent. For each one, list its private data sources, the untrusted inputs it reads and its outbound channels. Mark any agent that has all three.
- Cut a leg. Remove the send tool, restrict outbound domains or isolate the private data. Do this before adding detection.
- Gate irreversible actions. Show approvers the exact action and arguments, not a summary.
- Scope credentials per task. Use read-only keys and a sandbox for code and computer use.
- Treat MCP servers like packages. Pin versions, review tool descriptions and watch how several servers interact in one context.
- Fix the client. Block image and link rendering from non-allowlisted domains.
- Keep filters as a supplement. Don't let them be the only thing between an injection and a consequential action.
Bottom line
The most useful idea here is architectural. Assume the model will eventually be fooled, then limit what a fooled model can reach. OWASP puts it plainly: defense is architectural rather than interceptive. EchoLeak shows the cost of ignoring that, even in a mature enterprise product. The same argument covers the next agent your organization turns on.
References
- Agent security: prompt injection and permissions - MLQ.ai MLQ.ai · 2026-11-29T00:00:00+00:00
- EchoLeak (CVE-2025-32711): What the Microsoft Copilot Prompt Injection Vulnerability Means for Your Data sentra.io
- EchoLeak Vulnerability: What Microsoft's CVE-2025-32711 Revealed About AI Agent Security Gaps reco.ai