What is the lethal trifecta? AI agent data theft, explained
The lethal trifecta: an AI agent with private data, untrusted content and a way to send data out can be made to leak it. How to spot it and break the chain.

The lethal trifecta is Simon Willison’s name for the three capabilities that, combined in one AI agent, let an attacker steal your data: access to your private data, exposure to untrusted content, and the ability to communicate externally. If all three are present, a prompt injection hidden in the untrusted content can tell the agent to read the private data and send it to the attacker. Remove any one of the three and that attack has nowhere to go.
Where does the lethal trifecta come from?
Willison coined it in The lethal trifecta for AI agents: private data, untrusted content, and external communication on June 16, 2025. His wording of the three legs:
- “Access to your private data”
- “Exposure to untrusted content”
- “The ability to externally communicate”
The post is short and the useful part is the list of products that had shipped exactly this bug and patched it: Microsoft 365 Copilot, GitHub’s official MCP server, GitLab Duo, ChatGPT and its plugins, Google Bard, NotebookLM, Amazon Q, GitHub Copilot Chat, Slack, Mistral Le Chat, xAI’s Grok, Anthropic’s Claude iOS app and ChatGPT Operator, among others. These are teams with security staff. The pattern is easy to build by accident.
Why are the three together dangerous?
Each leg is harmless alone, and that’s the trap.
- An agent that reads your private data and nothing else can only show it to you.
- An agent that reads the open web and has no private data has nothing worth stealing.
- An agent that can send HTTP requests but reads only your own trusted files has no one telling it to misbehave.
Put them in one context window and the chain closes. The untrusted content carries an instruction, a prompt injection. The model can’t reliably tell that instruction apart from yours. It has a tool that reads the private data, and a tool that can send bytes somewhere the attacker can see.
Willison’s verdict on the fix is blunt: “we still don’t know how to 100% reliably prevent this from happening.” Vendors sell guardrails that claim to catch “95% of attacks”, and his reply is the line I’d quote to any product owner: “in web application security 95% is very much a failing grade.”
What does a lethal trifecta attack look like?
The clearest public case is the one Invariant Labs disclosed on May 26, 2025, GitHub MCP Exploited. The setup:
- The victim connects the official GitHub MCP server to an agent (they used Claude Desktop) with a token that can read both public and private repositories. That’s leg one, private data.
- An attacker files an issue on one of the victim’s public repositories. The issue body contains instructions. Leg two, untrusted content.
- The victim asks the agent something ordinary, like “look at the open issues in my public repo.”
- The agent reads the issue, follows it, pulls data from the private repos and writes it into a pull request on the public repo. Opening a public PR is leg three, external communication.
Invariant called it “a fundamental architectural issue” and said it “is not a flaw in the GitHub MCP server code itself.” Every tool did what it was designed to do. The model in the demo was Claude 4 Opus, which they note “was still susceptible to manipulation through relatively simplistic prompt injections.” Claude Desktop asks for confirmation on each tool call by default, and they point out many users switch to “Always Allow.”
Why is external communication so hard to remove?
Because almost anything is an outbound channel. Willison lists the obvious ones: if a tool can make an HTTP request, “to an API, or to load an image, or even providing a link for a user to click,” it can carry data out.
The image case surprises people. A chat UI that renders Markdown will fetch  the moment the model writes it, and the query string arrives in the attacker’s server logs. No tool call, no approval prompt. A web search tool is the same: the search query itself is a string sent to a third party. That’s why I tag both as outbound in the script below.
How do you check an agent for the lethal trifecta?
Tag every tool by which legs it touches, then check whether a session’s tools cover all three. This runs offline and is the check I’d put in CI for an agent’s tool manifest.
# trifecta.py: flag agent configurations that combine all three legs of the lethal trifecta.
# Python 3 stdlib only. Each tool is tagged with what it does; a session is risky if its
# tools together cover private data + untrusted content + a way to send data out.
from itertools import combinations
PRIVATE, UNTRUSTED, EXFIL = "private data", "untrusted content", "external comms"
TOOLS = {
"read_inbox": {PRIVATE, UNTRUSTED}, # your mail is private AND written by strangers
"search_web": {UNTRUSTED, EXFIL}, # a query string is an outbound channel
"read_crm": {PRIVATE},
"send_email": {EXFIL},
"render_markdown": {EXFIL}, #  leaks on render
"read_repo_docs": set(), # your own reviewed files
}
def legs(session):
return set().union(*(TOOLS[t] for t in session))
def verdict(session):
missing = {PRIVATE, UNTRUSTED, EXFIL} - legs(session)
return "LETHAL" if not missing else f"ok (missing: {', '.join(sorted(missing))})"
sessions = {
"inbox triage, no outbound": ["read_inbox", "read_repo_docs"],
"inbox triage + chat UI": ["read_inbox", "render_markdown"],
"CRM research agent": ["read_crm", "search_web"],
"support bot on own docs": ["read_repo_docs", "send_email"],
}
for name, tools in sessions.items():
print(f"{name:28} {verdict(tools)}")
# Which tool pairs are already lethal on their own?
pairs = [p for p in combinations(TOOLS, 2) if verdict(p) == "LETHAL"]
print(f"\n{len(pairs)} of {len(list(combinations(TOOLS, 2)))} tool pairs complete the trifecta:")
for a, b in pairs:
print(f" {a} + {b}")
Output (Python 3.13.11):
inbox triage, no outbound ok (missing: external comms)
inbox triage + chat UI LETHAL
CRM research agent LETHAL
support bot on own docs ok (missing: private data, untrusted content)
4 of 15 tool pairs complete the trifecta:
read_inbox + search_web
read_inbox + send_email
read_inbox + render_markdown
search_web + read_crm
Two things stand out. First, some single tools carry two legs. An inbox is private and written by strangers, so read_inbox plus any outbound channel is enough. Second, “CRM research agent” looks innocent: read our CRM, search the web for context on each account. But the search results are untrusted, and the next search query can carry CRM data out. The tagging is the hard part; the set arithmetic is trivial.
What is the Agents Rule of Two?
Meta published the same idea as a design rule on October 31, 2025, Agents Rule of Two. Within one session, an agent should satisfy no more than two of:
- [A] “An agent can process untrustworthy inputs”
- [B] “An agent can have access to sensitive systems or private data”
- [C] “An agent can change state or communicate externally”
The difference from Willison’s version is leg C. Meta counts any state change, not only outbound communication, which covers an injection that deletes files or approves a payment without leaking anything. If a task really needs all three, Meta says the agent shouldn’t run autonomously within that session; it needs human-in-the-loop approval or another reliable check, or a fresh session with a clean context window.
How do you break the lethal trifecta?
Pick the leg that’s cheapest to remove for the task.
Drop external communication. Block arbitrary outbound network access from the agent’s sandbox, allowlist domains, and disable remote image rendering in the chat UI or proxy images through a domain you control. This is the most common fix because the other two legs are usually the point of the product. I go through sandbox network policy in agent sandboxing.
Drop untrusted content. Restrict the agent to sources you control: your own docs, reviewed repos, internal tickets from authenticated staff. This is how many internal assistants stay safe without anyone designing it that way.
Drop private data, per session. Invariant’s mitigation for the GitHub case was least privilege: scope the token to the one repo the task needs. A token that can’t read private repos can’t leak them.
Split the session. Have one agent read the untrusted content and produce a constrained output (a label, a JSON object with fixed fields), then hand that to a second agent that holds the private data and the outbound tools. This is the Dual LLM pattern and its descendants. It’s the same reasoning as subagents with separate contexts, applied to security.
Put a person on the outbound step. It works when the approval shows exactly what is being sent and where. It fails when users click “Always Allow”, which is how the GitHub demo got through.
What I would do
When I review an agent design, I’d make the trifecta a required section of the design doc:
- List every tool and tag it with the legs it touches, including the non-obvious ones: Markdown rendering, link unfurling, web search, any tool that writes to a place others can read.
- Compute the combinations per session, as the script does. Any session that covers all three needs a written reason and a named control.
- Prefer removing a leg over adding a detector. A domain allowlist on egress is a control you can test; a classifier that catches most injections is not.
- Scope credentials per task. The GitHub case came down to a token that could read every private repo when the request needed one public one.
- Revisit it every time someone adds an MCP server. Willison names the problem with MCP directly: “it encourages users to mix and match tools from different sources that can do different things.” One new server can close the chain.
From the data-platform and privacy seat I sat in at Walmart, this is a familiar shape. Data governance already asks where sensitive data can flow and who can trigger the flow. An agent with the trifecta is a pipeline whose routing can be set by anyone who can get text in front of it.
FAQ
What are the three parts of the lethal trifecta?
Access to private data, exposure to untrusted content, and the ability to communicate externally. All three in one agent session make data exfiltration through prompt injection possible.
Who coined the lethal trifecta?
Simon Willison, in a blog post on June 16, 2025.
Is the lethal trifecta the same as the Agents Rule of Two?
They describe the same risk. Meta’s Rule of Two (October 2025) widens the third leg from external communication to any state change, and phrases it as a rule: no more than two of the three per session without human approval.
Do guardrails solve the lethal trifecta?
Not reliably. Detection filters reduce attack success but don’t reach zero, and an attacker only needs one success. Removing a leg is a stronger control. See AI guardrails for what filters are good at.
Does a coding agent have the lethal trifecta?
Often. It reads your private code, it reads untrusted text (issues, dependencies’ READMEs, web pages, test output) and it can run network commands. Sandboxing outbound network access is the usual fix.
Sources
- Simon Willison, The lethal trifecta for AI agents: private data, untrusted content, and external communication, June 16, 2025
- Invariant Labs, GitHub MCP Exploited: Accessing private repositories via MCP, May 26, 2025
- Meta AI, Agents Rule of Two: A Practical Approach to AI Agent Security, October 31, 2025
- Simon Willison, The Dual LLM pattern for building AI assistants that can resist prompt injection, April 25, 2023