What the lethal trifecta is
The term is Simon Willison's. An agent is in trouble when it can do all three of these at once:
- Read private data. Customer records, files, an inbox, a database.
- Take in content somebody outside can author. Web pages, search results, incoming email, issue comments, a PDF a user uploaded.
- Send data out, or do something it cannot take back. Send, post, pay, refund, delete, write, run a shell command, make an outbound request.
Hold one or two and the worst case is bounded. Hold all three and an attacker who can write a sentence into any page your agent reads can make it fetch your data and post it somewhere they control. They never touch your systems. The agent does it, with credentials you gave it, inside a session that looks normal in the logs.
Why tool-by-tool review misses it
Ask a reviewer whether send_email is a dangerous tool and they will say it depends. Ask about fetch_url and they will say it is a fetch. lookup_customer is the entire point of a support agent. Every tool clears review, because review happens one tool at a time and each one has an obvious justification.
The risk is a property of the set. That is an awkward thing for a checklist to catch, and it is an easy thing for a scan to catch, which is most of why we built the scan this way.
Finding it in your own repo
The scan is static. It reads source and configuration, and it does not start anything. MCP server configs are read as files; the servers are never launched.
pip install agentfox
agentfox scanAdd --fail to make it exit non-zero when it finds a trifecta, which is what you want in CI. agentfox scan machine does the same for the MCP servers and skills your own AI tools load on your laptop, which is a different set and often a more surprising one.
What a finding looks like
The output is a sentence, not a list of tool names, because a list is not something a security owner can act on. It names which tool supplies which leg, and then says what the combination permits:
agents/support.py: can read customer data (lookup_customer), reads
web pages (fetch_url), and can send email (send_email). An instruction
hidden in a web page could send customer data out.The tool names in the brackets are the evidence. The last line is the finding. If that sentence is wrong about your agent, the scan has mis-classified a tool and you can say so; if it is right, you have a decision to make about an agent that is probably already running.
Breaking one leg
You need to remove one of the three for that agent. In rough order of how disruptive they are:
- Drop the outbound tool, if the agent does not really need it. The cheapest fix and the rarest, because it usually does need it.
- Split the work. One agent reads untrusted content and summarises. A second agent, with no web access, acts on the summary. The attacker's text now has to survive a boundary that does not pass tool calls.
- Contain the outbound call. Keep all three tools, and refuse a
send_emailwhose arguments carry values that came from untrusted content. This is what containment does, and it is usually the one teams pick, because nothing about the agent has to change.
The scan suggests the third by default and names the tool to contain, since that is the one that makes the sentence true.
What the scan cannot tell you
Classification is a heuristic over names and descriptions. We chose that deliberately, because this has to run on a repository nobody has imported and a tool's name is usually the most honest description of it available. The consequences are worth stating plainly:
- A tool called
do_thingtells the scan nothing, and it is left unflagged rather than guessed at. A clean report is not proof. - An MCP server it does not recognise is reported as unknown, never as safe. You still have to look at it.
- It reads what the repository declares. A tool reached at runtime through a path the source does not name is outside what a static read can see.
One more thing we decided early: the classifier does not reuse any benchmark's list of tool names. A scan that knows a benchmark's tools scores well on that benchmark and no better on yours, and we would rather have the second number.
Frequently asked questions
What is the lethal trifecta?
A term from Simon Willison for an agent that can do three things at once: read private data, take in content an attacker can write, and send data somewhere out. Each one is ordinary on its own. Together they mean an instruction hidden in a web page or an email can make the agent mail your data to a stranger.
Why is each tool fine but the combination dangerous?
Because the attacker supplies the missing piece. They cannot read your database and they cannot send your mail, but if your agent can do both and will also read a page they control, they only have to write the instruction. The agent does the rest with its own credentials.
How do I check whether my agent has the trifecta?
Run agentfox scan in the repository. It classifies every tool and MCP server it finds into the three flags and prints a sentence for any agent that holds all three. It is static and offline: MCP server configs are read, and the servers are never started.
How do I fix it?
Remove one leg for that agent. Split the work across two agents so no single one holds all three, drop the outbound tool it does not need, or contain the outbound call so it cannot carry arguments that came from untrusted content. Containing the outbound channel is usually the least disruptive of the three.
Will the scan find every case?
No. Classification is a name-and-description heuristic, so a tool whose name says nothing useful is left unflagged rather than guessed at, and an MCP server it does not recognise is reported as unknown rather than safe. It is a way to find the obvious cases quickly, not a proof that you have none.



