Learn / AI security fundamentals
Lesson 2 of 59 minReviewed
The lethal trifecta and the Agents Rule of Two
Use two short design tests to decide whether an injected instruction can steal data or cause damage in a given agent, and which capability to remove or gate.
Lesson 1 established that anyone whose text reaches the model can steer it. That is not exploitable on its own: injected text needs something worth stealing and a way to act. Two widely cited tests make this concrete.
The lethal trifecta
In June 2025 Simon Willison described three capabilities that, combined in one agent, let an attacker trick it into handing over private data: access to private data, exposure to untrusted content, and the ability to communicate externally [1]. The exfiltration channel can be an HTTP request made by a tool, an image the client loads, or a link the user is invited to click, and he notes such channels are almost limitless [1]. Rendering a markdown image whose URL carries data is the classic case: Johann Rehberger showed it leaking chat data from Bing Chat in 2023 [2].
The Agents Rule of Two
Meta's Agents Rule of Two (October 2025) generalises the test. Within one session an agent should have no more than two of: [A] processing untrustworthy inputs, [B] access to sensitive systems or private data, [C] the ability to change state or communicate externally. If a task needs all three, the agent should not run autonomously; it needs supervision such as human approval or another reliable validation step [3]. Willison points out the difference that matters: the trifecta covers data exfiltration, while property [C] adds any change of state, such as deleting records or merging code [4].
Two incidents with no buggy component
| Case | Untrusted input | Private data | Outbound action |
|---|---|---|---|
| GitHub MCP (Invariant Labs, May 2025) | An issue filed on the user's public repository | The user's private repositories, reachable through the same token | A pull request on the public repository containing the private data |
| EchoLeak, CVE-2025-32711 (Microsoft 365 Copilot) | Content Copilot processed on the user's behalf | The user's Microsoft 365 data | Information disclosure over the network |
In the GitHub case Invariant stresses that the flaw was not in the GitHub MCP server code: every tool worked as designed, and the agent combined them after reading the malicious issue [5]. The demo client asked for confirmation on each tool call, but users commonly choose to always allow [5]. Microsoft classified EchoLeak as AI command injection that let an unauthorised attacker disclose information over a network [6].
Applying the tests in a design review
- List every tool and data source the agent can reach in one session, including MCP servers a user may add later.
- Mark each as A (untrusted input), B (sensitive data or system) or C (outbound or state-changing). A tool that reads email is both A and B; a web fetch tool is both A and C.
- If A, B and C are all present, pick a fix: remove a leg (no outbound network, read-only access), split the work into sessions that each hold at most two, or place a human approval before every C action that follows untrusted input.
- Write the decision down so a later feature request that adds a tool triggers the review again.
Splitting sessions works because the property that matters is what is combined in one context window. A plan-then-execute or dual-model design, covered in the next path, applies the same idea inside one application. For end users who mix MCP servers themselves, Willison's conclusion is blunter: the only safe option is to avoid the combination entirely [1].
Try it on ThreatDeck
- Lock down MCP servers and clients Apply the trifecta test to the MCP servers your developers actually run.
- Markdown image exfiltration detection See how to hunt for the image-URL exfiltration channel in LLM output logs.
- MCP Server Watch Look up a server and note which of its tools read untrusted content or write externally.
Self-check
4 questionsPick an answer to see whether it is right and why. Only your score is saved, in this browser.
-
The trifecta is about capabilities, not model size or protocol. With all three, injected instructions in untrusted content can read private data and send it out.
-
Property [C] is changing state or communicating externally, so it also covers deleting data or merging code, which the exfiltration-focused trifecta does not name.
-
Invariant describes it as an architectural, agent-level problem. Each tool was legitimate; the toxic flow existed only when they were combined in one session after reading attacker text.
-
Removing untrusted input from the session that can change state drops one property. Classifiers and prompt instructions reduce some attacks but leave all three properties in place.
References
- The lethal trifecta for AI agents: private data, untrusted content, and external communication. Simon Willison, 2025-06-16.
- Bing Chat: Data Exfiltration Exploit Explained. Johann Rehberger, Embrace The Red, 2023-06-18.
- Agents Rule of Two: A Practical Approach to AI Agent Security. Meta AI, 2025-10-31.
- New prompt injection papers: Agents Rule of Two and The Attacker Moves Second. Simon Willison, 2025-11-02.
- GitHub MCP Exploited: Accessing private repositories via MCP. Invariant Labs, 2025-05-26.
- CVE-2025-32711: M365 Copilot Information Disclosure Vulnerability. NIST NVD (CNA: Microsoft), 2025-06-11.