Skip to content

The lethal trifecta in MCP setups: three capabilities that add up to a data leak

On this page

The lethal trifecta is Simon Willison’s name for an agent that has access to private data, is exposed to untrusted content, and can communicate externally. With all three, an attacker who gets text in front of the model can instruct it to read your data and send it out, and current models can’t be relied on to refuse. Indirect prompt injection is how that text gets in. The fix is structural: make sure no single agent session holds all three.

Checked as of November 2026 against Willison’s lethal trifecta post, Invariant Labs’ GitHub MCP report, General Analysis’s Supabase write-up and the Embrace The Red Slack MCP advisory.

The three legs

Willison defined the trifecta in June 2025:

  1. Access to private data. Repositories, databases, email, documents: the reason you connected the tool.
  2. Exposure to untrusted content. Any way text controlled by an attacker can reach the model. An issue body, a support ticket, a web page, an incoming message, a PDF.
  3. The ability to communicate externally. Anything that can carry data somewhere an attacker can read it: opening a pull request on a public repository, posting a message, sending an email, fetching a URL, rendering an image whose address contains data.

His conclusion is blunt: “The only way to stay safe there is to avoid that lethal trifecta combination entirely.” He also notes that guardrail products claiming to catch “95% of attacks” don’t change this, because “in web application security 95% is very much a failing grade.”

MCP makes the trifecta easy to assemble by accident. Each server looks harmless alone. A GitHub server, a browser server and a Slack server, added on different days for different jobs, give one agent session all three legs.

Why indirect prompt injection makes it exploitable

Prompt injection is untrusted text that the model treats as instructions. The MCP security guide covers it alongside tool poisoning and the other MCP risks; this post is about one consequence.

The indirect form, named in a 2023 paper by Greshake and colleagues, doesn’t need the attacker to talk to the model at all. They plant instructions in data the agent will retrieve later. The paper’s point is that LLM applications “blur the line between data and instructions”: to the model, the issue body it just fetched and your request are both tokens in one context.

That’s why the trifecta needs all three legs. Untrusted content is the attacker’s way in. Private data is what they want. External communication is how it leaves. Remove the way out and an injected instruction can still make the agent misbehave, but it can’t deliver your data to the attacker. Remove the private data and there’s nothing to steal.

Detection doesn’t close the gap. In late 2025, a paper Willison summarized as “The Attacker Moves Second” bypassed 12 published defenses with adaptive attacks, at success rates above 90% for most, and human red-teamers defeated all of them.

Documented MCP incidents

Each of these was published with a working demonstration. None needed a bug in the MCP server.

ReportUntrusted contentPrivate dataWay out
GitHub MCP server, Invariant Labs, May 2025Issue in a public repositoryThe user’s private repositoriesPull request in the public repository
Supabase MCP, General Analysis, July 2025Customer support ticketintegration_tokens table, read with service_roleMessage inserted into the attacker’s own ticket
Anthropic’s Slack reference server, Embrace The Red, June 2025Anything the agent processedWhatever was in contextSlack’s link unfurling fetching an attacker URL
WhatsApp MCP, Invariant Labs, April 2025An incoming WhatsApp messageContacts and chat historysend_message to the attacker’s number

GitHub MCP: issue to pull request

Invariant Labs set up a user with one public and several private repositories, connected through the official GitHub MCP server in Claude Desktop with Claude 4 Opus. An attacker opened an issue on the public repository containing instructions. When the user asked the agent to look at open issues, it read private repository contents and published them, including the user’s salary, in a pull request on the public repository. Invariant’s assessment: “this is not a flaw in the GitHub MCP server code itself.” The agent simply held one token that could read private repositories and write to a public one.

Supabase MCP: support ticket to support ticket

General Analysis built a support app where customers file tickets and a developer reads them through Cursor with the Supabase MCP server, which ran SQL as service_role and so bypassed row-level security. A ticket told the agent to read the integration_tokens table and add its contents as a message on that ticket. The developer asked for the latest open ticket; the agent ran two extra queries, and the attacker refreshed the page to read the tokens. The exit was a plain database write into a row the attacker could see. “No permissions were violated.”

Johann Rehberger showed that Anthropic’s reference Slack server posted messages without disabling link unfurling. An injected agent posts a link with data in its URL, and Slack’s own preview bot fetches it, so the data reaches the attacker’s server without anyone clicking. The server was archived on May 29, 2025, two days after the report, and won’t be patched. It was later assigned CVE-2025-34072. The Slack MCP server post covers what replaced it.

WhatsApp MCP: a message as the payload

In the second WhatsApp experiment, Invariant sent the target a WhatsApp message containing an injection. It surfaced through list_chats, and the agent sent the user’s contacts to the attacker’s number with send_message. The confirmation dialog showed what looked like a short message; the payload sat off-screen to the right.

Mitigations that remove a leg

Each of these takes away one leg for a given agent session. They work regardless of how clever the injected text is.

Give each agent at most two legs

Decide per agent which leg it doesn’t need. Meta’s Agents Rule of Two states the same idea with a wider third leg: an agent should have no more than two of processing untrustworthy input, access to sensitive systems or private data, and the ability to change state or communicate externally. Counting “change state” closes the case where the harm is a deletion rather than a leak.

AgentUntrusted contentPrivate dataWay outWhat to cut
Triage bot reading public issuesYesOnly if its token can read private reposComments, PRsScope the token to the one public repository
Coding agent in your private repoOnly if it browses or reads ticketsYesPush, PRs, fetchKeep web and ticket tools out of this session
Support summarizerYesCustomer recordsTicket repliesRead-only database role, no write tool

Split read and write agents

When a job needs all three, split it. One agent reads the untrusted input and produces a constrained output, such as a label or a structured summary, with no access to private data. A second agent with private data never sees the raw input, only that output.

Block or gate the tools that carry data out

The external-communication leg is usually a specific tool: create_pull_request, send_message, chat.postMessage, an HTTP fetch, an email send. Block it for agents that don’t need it. For agents that do, require a person to approve each call, and read the arguments in the approval, not just the tool name; the WhatsApp payload was hidden in a long string. In Claude Code that’s an ask or deny rule:

JSON
{
  "permissions": {
    "deny": ["mcp__github__create_pull_request", "WebFetch"],
    "ask": ["mcp__github__create_issue", "mcp__slack__slack_send_message"]
  }
}

The Claude Code permissions guide covers rule syntax and precedence. An approval prompt only helps if the person reads it, and Invariant noted that “many users already opt for an ‘Always Allow’ confirmation policy.”

Scope credentials so the data leg is smaller

Use the narrowest token the job needs. GitHub fine-grained tokens can be limited to specific repositories; Supabase’s MCP server has a read-only mode and can be pinned to one project. A token that can’t read private repositories removes leg one for that agent.

Limit egress

Network allowlists cut the channels that aren’t MCP tools. Claude Code’s sandbox routes shell commands through a proxy that only allows listed domains:

JSON
{
  "sandbox": {
    "enabled": true,
    "network": { "allowedDomains": ["github.com", "registry.npmjs.org"] }
  }
}

The same page says the sandbox “covers shell commands only”: MCP servers, WebFetch and hooks run outside it. A remote MCP tool that posts a comment is egress no proxy will catch, so the per-tool rules above still matter. Also turn off link unfurling and remote image rendering wherever an agent’s output is displayed.

A gateway is one place to enforce the tool-level part across every app. Toolstile sets Allow, Require approval or Block per tool for each agent, shows the exact arguments on the approval page, and logs every forwarded call; permissions describes how the rules combine. It can’t stop a model from following injected text. It can make sure the agent reading public issues has no tool that writes anywhere public.