What is the lethal trifecta, and how do you use it to secure an agent?
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
The lethal trifecta (Simon Willison) is the design test for whether an agent can be turned into a data-exfiltration weapon by prompt injection. An agent is exploitable when it simultaneously has all three of:
- Access to private/sensitive data - your emails, files, database, other users' records.
- Exposure to untrusted content - it reads web pages, emails, documents, or tool results an attacker can influence.
- An exfiltration channel - any way to send data out: sending email, HTTP requests, rendering markdown images (the URL leaks data in query params), writing to a shared location, posting to an API.
Full worked answer with diagram
The lethal trifecta (Simon Willison) is the design test for whether an agent can be turned into a data-exfiltration weapon by prompt injection. An agent is exploitable when it simultaneously has all three of:
- Access to private/sensitive data - your emails, files, database, other users' records.
- Exposure to untrusted content - it reads web pages, emails, documents, or tool results an attacker can influence.
- An exfiltration channel - any way to send data out: sending email, HTTP requests, rendering markdown images (the URL leaks data in query params), writing to a shared location, posting to an API.
With all three, an indirect injection in the untrusted content instructs the agent to read the private data and ship it out the exfil channel - the user never knowing. The insight is that you don't need to stop the injection; you need to remove one leg. Any single removal breaks the attack:
- Drop the exfil channel, or gate it behind human approval (the agent can draft an email but a human clicks send; block auto-rendered images to arbitrary URLs).
- Don't feed untrusted content to the agent that holds private data - quarantine external content in a separate, unprivileged context.
- Don't give the trifecta-completing agent private data - split into a public-data agent and a private-data agent that never touches the outside world.
It's a mental model, not a product, and its power is that it's architectural: it tells you the injection defence lives in system design, not in the prompt. It also explains why MCP is risky - a user innocently connecting a "read my email" server and a "browse the web" server has just assembled the trifecta without noticing.
Worth sketching. Three arrows in and one arrow out, then rub out a leg: it shows you are reasoning about architecture rather than wording.
flowchart TD
A["Private data access"] --> D["Exploitable agent"]
B["Untrusted content in context"] --> D
C["Exfiltration channel"] --> D
D --> E["Injection reads the data<br/>and ships it out"]
C -->|"remove: human clicks send"| F["Attack broken"]
B -->|"remove: quarantine external content"| F
A -->|"remove: split public and private agents"| F
What a good answer covers
- The lethal trifecta (Simon Willison) is the design test for whether an agent can be turned into a…
- Access to private/sensitive data - your emails, files, database, other users' records
- Exposure to untrusted content - it reads web pages, emails, documents, or tool results an attacker can…
- An exfiltration channel - any way to send data out
- With all three, an indirect injection in the untrusted content instructs the agent to read the private…
Key terms: lethal trifecta · Access to private/sensitive data · Exposure to untrusted content · An exfiltration channel · exfil channel · untrusted content · private data
In the glossary: Lethal trifecta · Prompt injection · Exfiltration channel · MCP
Interviewer follow-ups to expect
Markdown image rendering is a classic exfil channel - why, and how do you close it?
- Drop the exfil channel, or gate it behind human approval (the agent can draft an email but a human clicks send; block auto-rendered images to arbitrary URLs).
- Don't feed untrusted content to the agent that holds private data - quarantine external content in a separate, unprivileged context.
- Don't give the trifecta-completing agent private data - split into a public-data agent and a private-data agent that never touches the outside world.
Which leg is usually easiest to remove in practice?
How does connecting multiple MCP servers accidentally create the trifecta?
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep