Skip to content
TheAgent Ecosystem
AI Agents

The Lethal Trifecta: The 3 Things Your Agent Must Not Combine

Private data, untrusted content and an outbound path. Hold all 3 and no prompt saves you, so the fix is architectural.

Muhammad Qasim HammadAI-assisted9 min read1,819 words

AI-drafted, reviewed by Muhammad Qasim Hammad on November 16, 2026. See our AI disclosure.

Lethal Trifecta: Three Things, Never Together
Table of contents
  1. What are the 3 legs?
  2. Why can't a better prompt fix this?
  3. What is the Rule of Two?
  4. Which leg should you actually remove?
  5. What if you cannot remove any of them?

Most agent security advice is a list of things to add. This one is a list of things to not have at the same time. An agent that can read your private data, process content an attacker controls, and talk to the outside world is exploitable, and no amount of careful prompting changes that. The useful move is architectural: make sure your agent never holds all 3 at once.

What are the 3 legs?#

Access to private data, exposure to untrusted content, and the ability to communicate externally. Any agent holding all 3 at once can be instructed by an attacker to read something sensitive and send it somewhere, and the instruction arrives inside content the agent was asked to process.

A definition callout naming the three capabilities of the lethal trifecta and giving a concrete example of the combinationEach leg is ordinary on its own. The combination is what creates the exposure.

Each leg is worth stating in its strongest form, because each is also a feature somebody asked for:

LegWhat supplies itWhat removing it costs
Private data accessThe tools that make the agent useful at allUsually the entire point of building it
Untrusted contentAny web page, email, document or issue it readsMost real inputs, and most real value
External communicationAny tool that sends, posts, fetches or writes outOften much less than people assume

That third column is the whole argument. The legs are not accidents that crept in; they are the reasons the agent exists. Which is exactly why "just be careful" is not a strategy, and why the interesting question is which leg you can afford to lose.

Five-step sequence showing an attacker planting instructions, the agent reading them, retrieving private data and sending it outEvery individual step is the agent working correctly, which is why nothing looks broken.

The attack itself is unglamorous. An attacker puts instructions somewhere your agent will read: a support ticket, a web page it searches, a code comment, a calendar invite. The agent reads that content as part of doing its job, treats the embedded instruction as something to act on, retrieves data it legitimately has access to, and sends it out through a channel it legitimately has. Every individual step is the agent working correctly.

Why can't a better prompt fix this?#

Because a model cannot reliably tell where an instruction came from. System prompt, user request and retrieved web page arrive as one stream of tokens, so text smuggled into a document carries the same authority as your own instructions. Defensive wording reduces the rate and never reaches zero.

This is the part people resist, usually by proposing a stronger system prompt. The difficulty is not that nobody has written a good enough instruction; it is that the defence has to hold against every possible phrasing of an attack, and you only need to lose once. Willison's framing is blunt about the odds: given the infinite number of ways malicious instructions could be phrased, confidence that your protection works every time is not available.

The architectural explanation is the same one OWASP's agentic security work gives. Models treat the system prompt, the user's request, and text retrieved from external sources as a single stream of tokens, with no reliable mechanism to separate commands from data. Hostile text smuggled into a document, a calendar invite or a web page carries equivalent authority to whatever you wrote.

That is also why prompt injection ends up implicated in so much else. OWASP's State of Agentic AI Security and Governance maps it to 6 of the 10 categories in its Top 10 for agentic applications, which is less a statement about one vulnerability than about a shared root cause underneath many of them.

It is worth noticing which agents are most exposed by this, because it is not the ones people worry about. OWASP's own tracking found 28 of 53 agentic projects it surveys are coding agents, and that the 5 fastest-growing tools are all coding agents. A coding agent reads issues and repositories written by other people, holds credentials and source code, and can execute commands with network access. That is the full trifecta in the single most widely adopted category of agent there is.

None of this makes prompt-level defences worthless. They raise the cost of an attack and catch lazy attempts, which is a real if modest benefit, and the tactical measures in defending n8n agents against prompt injection are worth having. They are simply not a boundary, and treating them as one is the mistake.

What is the Rule of Two?#

Meta's operational version of the same insight. An agent running without human approval may hold at most 2 of the 3 properties; wanting all 3 means a human has to be in the loop. It converts an architectural observation into a rule you can actually check.

Comparison of the lethal trifecta threat model and the Agents Rule of Two across what each states, how it is applied and what it enablesOne names the danger, the other makes it reviewable. They are the same idea at 2 altitudes.

The value of phrasing it this way is that it is auditable. "Be careful about prompt injection" cannot be reviewed; "this agent has private data and untrusted content, therefore it must not have an outbound path, or it needs an approval step" can be, by someone reading a config file. It turns a security property into something a checklist can hold.

It also names the escape hatch honestly. Sometimes an agent genuinely needs all 3, and the answer in that case is not a cleverer prompt but a human confirming consequential actions. That is a product decision with a real cost in friction, which is precisely why it should be made deliberately rather than discovered after an incident.

Which leg should you actually remove?#

Usually the exfiltration path, because it is the one whose removal costs least. Private data access is normally the entire point of the agent, and untrusted content is unavoidable the moment it reads anything from outside, but arbitrary outbound communication is often an accident rather than a requirement.

Checklist of five indirect outbound channels including image rendering, link following and shared writesThe obvious send action is rarely the one that gets used. These are the quiet ones.

The reason this leg is cheapest is that it is rarely a deliberate design choice. Outbound capability arrives through tools added for other reasons: a fetch tool for research, a webhook for notifications, an email sender for reports, a code interpreter with network access. Each was added to solve something specific, and together they constitute a general-purpose exfiltration channel nobody designed.

Auditing it is more mechanical than it sounds. Enumerate every tool that can cause bytes to leave your boundary, including the indirect ones, and ask what breaks if that tool can only reach an allowlist. In many agents the honest answer is nothing, because the outbound need was always to 2 or 3 known destinations rather than to the internet. That is the same principle as scoping an agent's permissions and sandbox, applied to the network rather than to the filesystem.

Watch for the indirect paths, which are the ones that survive a first pass. A tool that renders a Markdown image will fetch the URL in it, and a URL can carry data in a query string. A web search tool that follows links is an outbound channel. Anything that writes to a shared location an attacker can read later is exfiltration on a delay, and the same care that goes into choosing web search tools for agents belongs on every tool that touches a network.

What if you cannot remove any of them?#

Then you are back to containment and human approval, which is where the Rule of Two points. Constrain what each leg can reach at runtime, require a person to confirm consequential actions, and log every outbound call so an attempt is visible even when it is not blocked.

Decision flowchart for deciding which leg of the lethal trifecta to remove from an agentMost agents can lose the outbound leg far more cheaply than they think.

The design principle Willison cites is a good statement of the target: once an agent has ingested untrusted input, it must be constrained so that input cannot trigger consequential actions. That is a strong condition and worth reading twice, because it implies the constraint is applied at the point of ingestion, not at the point of action. An agent that reads a hostile page and then decides for itself to be careful has already lost; the constraint has to be external to the model's judgement, which is what a policy gate running before inference provides at one layer and a network allowlist provides at another.

There is a sequencing point hidden in that principle too. Containment applied after the model has decided what to do is usually a filter on its output, and a filter is a classifier with a false-negative rate. Containment applied to what a tool can reach is a boundary, and a boundary either holds or does not. Preferring the second is the difference between reducing the probability of exfiltration and removing the route.

Observability is the consolation prize when prevention is impossible. If every outbound call is logged with what triggered it, an exfiltration attempt leaves a record even when it succeeds, which turns an invisible breach into an investigable one. That is a genuinely lower bar than prevention, and it is worth setting deliberately rather than arriving at by default.

The reason this framing has lasted is that it is honest about the trade. Every leg is something someone wanted, the model cannot be relied on to police itself, and the only durable controls are the ones that operate outside it. Agents get more useful as they accumulate all 3 properties, which means the pressure will always run toward the dangerous configuration. Knowing the shape of it is what lets you notice when a routine integration ticket has quietly completed the set.

Frequently asked questions

What is the lethal trifecta?
A threat model naming 3 capabilities that are dangerous in combination: access to private data, exposure to content an attacker can control, and the ability to communicate externally. An agent holding all 3 can be instructed through the content it reads to retrieve sensitive data and send it out.
Why can't a stronger system prompt prevent this?
Because models are unable to reliably distinguish the importance of instructions based on where they came from. The system prompt, the user request and text retrieved from a web page arrive as one stream of tokens, so hostile text carries the same authority as your own instructions.
What is the Agents Rule of Two?
Meta's operational formulation of the same problem: an agent operating without human approval may satisfy at most two of the three properties. Wanting all three means a human has to confirm consequential actions. It turns an architectural observation into something a reviewer can check.
Which capability should I remove first?
Usually external communication. Private data access is normally the reason the agent exists, and untrusted content is unavoidable once it reads anything from outside. Outbound capability, by contrast, often accumulated through tools added for unrelated reasons and can frequently be reduced to an allowlist.
What counts as an outbound path?
More than an obvious send action. A tool that renders a Markdown image fetches its URL, and a URL can carry data in a query string. Web search that follows links, code execution with network access, and writes to any location an attacker can later read all qualify.

Written by

Muhammad Qasim Hammad
Muhammad Qasim Hammad
AI agents & automationFounder · Cart Gaze LLCPMP-certified PM

Muhammad Qasim Hammad is an AI agent and automation expert and the founder of Cart Gaze LLC (cartgaze.com). He builds product for the love of it: when an idea lands, a working prototype is usually running within hours, built with the same AI agents and automations he sells. He puts his own output at roughly 20× what it was before agents, and the Agentic OS behind this site is the working proof, documented in public with the tools he actually ran and what they really cost.

AI & Automation Services

Want a pipeline like this running in your business?

I'm Qasim — I design and ship AI agents and n8n automations for solo operators and small teams. Tell me what's eating your team's week, and I'll scope a fix.

Related reading