The lethal trifecta is the combination of three capabilities in one AI agent: access to private data, exposure to untrusted content and the ability to communicate externally. When all three are present in the same context, a prompt injection hidden in untrusted content can instruct the model to read sensitive information and send it to an attacker. In AI security, the term names an architectural condition rather than a single bug, and it explains why many agent data leaks share the same shape.
The phrase was coined in 2025 by the software developer Simon Willison to give builders a simple rule: an agent that combines all three legs should be treated as exploitable by default. Because language models cannot reliably separate instructions from data, the safest defense is usually to remove at least one leg for any task that touches sensitive information.
The three capabilities that form the trifecta
Each leg of the lethal trifecta is harmless or useful on its own; the danger appears only when one model session holds all three. The table below defines each capability and gives typical examples found in assistants, coding agents and tool-connected chat systems.
| Capability | Meaning | Typical examples |
|---|---|---|
| Access to private data | The agent can read information the attacker wants | Email, documents, code, CRM records, secrets |
| Exposure to untrusted content | Attacker-controlled text can enter the context | Web pages, inbound email, issues, PDFs, tool output |
| External communication | The agent can send data beyond the trust boundary | HTTP requests, image URLs, email sending, pull requests |
The concept is useful because it shifts attention from filtering malicious prompts to auditing capability combinations. A tool list that looks safe tool by tool can still form a trifecta once several connectors are enabled together, for example through the Model Context Protocol.
How prompt injection exploits the trifecta
The attack works because a language model processes instructions and data in the same token stream. When untrusted content contains text such as a request to collect API keys and include them in a link, the model may follow it as if the user had asked. This is indirect prompt injection, and the third leg turns it into data exfiltration via prompt injection.
- The attacker plants instructions in content the agent will later read, such as a web page or support ticket.
- The user gives the agent an ordinary task that causes it to ingest the poisoned content.
- The injected text directs the agent to read private data available through its tools.
- The agent encodes the data into an outbound channel, such as a URL query string or a rendered image.
- The attacker’s server receives the stolen information without any visible error for the user.
Exfiltration channels are often subtle. Markdown image rendering is a classic example: the client fetches an image from an attacker URL that carries the secret in its parameters. Other channels include link previews, DNS lookups from a code sandbox and comments posted to public repositories.
Relationship to other AI security concepts
The lethal trifecta is a risk model for agent design, while prompt injection is the attack technique that exploits it. It overlaps with the confused deputy problem in classical security, in which a privileged program is tricked into misusing its authority on behalf of a less privileged party.
| Concept | Focus | Relation to the trifecta |
|---|---|---|
| Prompt injection | Untrusted text overriding instructions | The mechanism that triggers the attack |
| Jailbreak | Bypassing model safety policies | Different goal; usually no third-party attacker |
| Improper output handling | Unsafe use of model output downstream | One route for the exfiltration leg |
| Confused deputy | Privileged component misused by others | Classical analog of the same pattern |
| Excessive agency | Agents granted too many permissions | Broad tools make the trifecta more likely |
Mitigation strategies for agent builders
The most dependable mitigation is to break the trifecta by design, so that no single context holds all three legs at once. Detection-based defenses such as LLM firewalls and safety classifiers reduce risk, but they are probabilistic and can be bypassed by novel phrasing, so they should not be the only control.
| Strategy | Leg removed or constrained | Trade-off |
|---|---|---|
| Egress allowlisting | External communication | Limits integrations and web access |
| Read-only untrusted sessions | Private data access | Agent cannot combine research with personal data |
| Trusted-source restriction | Untrusted content | Reduces usefulness for browsing and email |
| Dual LLM pattern | Separates untrusted text from privileged planner | More complex orchestration |
| CaMeL-style capability tracking | Controls data flow to tools | Requires explicit policies and engineering effort |
| Human approval of actions | Constrains external communication | Approval fatigue and slower workflows |
Approaches such as the Dual LLM pattern and CaMeL keep untrusted content away from the model that decides which tools to call. Spotlighting and instruction hierarchy training help the model distinguish data from commands, yet they remain partial defenses rather than guarantees.
Common misconceptions and mistakes
Many incidents arise because teams assume that a better system prompt can stop injection. Experience with deployed agents shows several recurring errors.
- Relying on instructions like ignore embedded commands, which attackers routinely override.
- Evaluating tools in isolation instead of reviewing the full combination enabled for a user.
- Overlooking indirect egress, such as image rendering, link unfurling or package downloads.
- Treating internal documents as trusted when external parties can edit tickets or wiki pages.
- Assuming high benchmark scores mean safety, since a small failure rate is still exploitable at scale.
The idea in brief
Imagine an assistant who holds the keys to your files. The assistant also reads letters from strangers. It can also post packages to anyone. A stranger only needs one cleverly worded letter to get your files mailed away.
That is the lethal trifecta. Each ability is fine alone. Together they are dangerous, because AI models tend to obey instructions they read. The safe fix is to take away one of the three abilities whenever sensitive data is involved.
A practical scenario
A software company deploys a coding agent connected to its private repositories, the public issue tracker and the internet. An attacker opens a public issue containing hidden text that asks the agent to read the deployment configuration and include it in a link to an external diagnostics page. When a developer asks the agent to triage new issues, the agent reads the poisoned issue and attempts to send the secrets outward.
The security team reviews the design and identifies all three legs in one session. They split the workflow: one agent triages public issues with no access to private repositories, while another works on code with egress limited to an allowlist of package registries. A follow-up red-team exercise repeats the attack, and no secret leaves the network because neither agent holds the full trifecta.