godelgate Book a demo

Lethal-trifecta containment

How Godelgate stops prompt-injected agents from sending private data out.

An agent becomes dangerous when three things meet in one session:

  1. Private data: it can read things you don't want to leak (customer records, source code, email).
  2. Untrusted content: it reads text an attacker can control (web pages, issues, inbound email, documents).
  3. A way out: it can send data somewhere (email, HTTP requests, comments, messages).

Any two are fine. All three together let a hidden instruction in the untrusted content tell the agent to send the private data out. Models can't reliably tell injected instructions from yours, so Godelgate doesn't try to detect the attack. It removes the path.

#Label your tools

Give each tool the labels that apply, per server, with globs on the tool name:

yaml
servers:
  - name: github
    command: npx
    args: [-y, "@modelcontextprotocol/server-github"]
    labels:
      "get_*": [private]
      "search_*": [untrusted]
      "list_issues": [private, untrusted]
      "create_*": [egress]
      "add_issue_comment": [egress]
LabelMeansExamples
privateReturns data you don't want leakedread a CRM, read a private repo, read email
untrustedReturns content someone else can writefetch a URL, read issues or tickets, read inbound mail
egressCan send data outsidesend email, post a comment, call a webhook, fetch a URL with a query string

A tool can have several labels. All matching globs apply. Tools with no labels never affect the trifecta.

When unsure, over-label. A web fetch tool is usually both untrusted (it reads attacker content) and egress (the URL itself can carry data out).

#How sessions are tracked

Each MCP session keeps two markers, and records which tool set each one:

  • private, set after a private tool returns
  • untrusted, set after an untrusted tool returns

Markers are set only after the upstream server actually answers, and they never reset during the session. Sessions are separate: one agent's history never affects another's. You can see the markers for every active session in the dashboard's Sessions tab.

#When a call is blocked

A call completes the trifecta when all of these are true:

  • the tool is labeled egress
  • the session already holds private data
  • the session already read untrusted content, or the tool itself is labeled untrusted

What happens next is set by policy.trifecta:

ValueEffect
block (default)The call is denied with the reason, and logged as denied
approveThe call waits for a human in the dashboard, like an approval rule
offNo trifecta checks
yaml
policy:
  trifecta: block

The agent receives an error result like:

text
Blocked by Godelgate: lethal trifecta: session read private data
(crm__read_customers) and untrusted content (web__fetch_url);
this tool can send data out

#Interaction with rules

The trifecta check runs after deny rules and quarantine, and before allow and approve rules. An allow rule grants access to a tool; it never grants permission to exfiltrate data after the session read untrusted content. See Policy rules for the full decision order.

#Starting fresh

Because markers last for the whole session, an agent that needs to send something after reading untrusted content should do it in a new session, or a human approves it with trifecta: approve. Idle sessions are closed after one hour.