Trifecta guard
Say which actions read private data, take in untrusted content and send data out. Once one run has done the first two, anything it sends out waits for a person, or is denied, whatever a rule says.
Most data leaks through an agent take three steps, and each step looks fine on its own. The agent reads something private, such as a customer record. It takes in text someone else wrote, such as a web page or an email, and that text tells it what to do. Then it sends something out. Simon Willison calls this combination the lethal trifecta, and Meta’s Agents Rule of Two says an agent should hold at most two of the three in one session unless a person approves.
The trifecta guard puts that rule in the gate. You say which actions read private data, which take in untrusted content, and which send data out. VariantGate follows each run, and once a run has done the first two, a request to send something out waits for a person, or is denied, even when a rule would have allowed it.
Allow rules cover all three actions, so without the guard every request is approved at once.
support-bot · run ticket-4812
3. Email the ticket notes to help-desk@outside.example (email.send, sends out)
Waiting for a person · allowed: false. The allow rule for email.send does not count while this run, with any sub-agent runs linked to it, holds all three.
- Private data: request 1: crm.read
- Untrusted content: request 2: web.fetch
- Sends out: this request: email.send
The three lists
Each list holds action patterns written the way rules write them: an exact action such as crm.read, every action with a start such as email.*, or * for everything. An action may be in more than one list.
- private
- Actions that read private data: crm.read, db.query, files.read. 1 to 20 patterns.
- untrusted
- Actions that take in content from outside: web.fetch, email.read. 0 to 20 patterns. A request that lists an untrusted source lights this leg too, so the list can be empty.
- outbound
- Actions that can send data out: email.send, http.post, slack.post. 1 to 20 patterns.
- deny
- false: a caught request waits for a person. true: it is denied at once, in the name of the owner who set the guard.
Not sure which of your MCP tools go in which list? The trifecta checker reads your settings file and fills them in.
How a request is caught
- VariantGate follows each
run. A run belongs to the key that asked: the same run id under two keys is two runs. Requests that name no run are weighed together with the same key’s other requests without a run from the last hour, so leaving the run out does not get past the guard. - When a request’s action is on the outbound list, VariantGate looks at the run so far. An earlier request counts if it was approved or is still waiting; one that was denied, expired or withdrawn never ran, so it does not.
- The request itself counts too: an action on two lists, or a request that lists an untrusted source of its own.
- If the run has lit both the private and the untrusted leg, the request is caught. No allow rule, run grant, mandate or remembered approval approves it.
A worked example
A support agent works ticket 4812, with allow rules for all three actions:
POST /v1/requests {"action": "crm.read", "run": "ticket-4812", ...} -> approved by a rule
POST /v1/requests {"action": "web.fetch", "run": "ticket-4812", ...} -> approved by a rule
POST /v1/requests {"action": "email.send", "run": "ticket-4812", ...} -> pending: a person decidesThe third request waits in the inbox. People in the workspace see which requests lit each leg; the agent sees only that its request is pending, so it is not told how to get round the check:
"trifecta": {
"private": { "request_id": "0193…a1", "action": "crm.read", "by_source": false },
"untrusted": { "request_id": "0193…b7", "action": "web.fetch", "by_source": false },
"denied": false
}request_id is null when the request itself lit the leg, and by_source says the leg was lit by an untrusted source the request listed rather than by its action. Had the run skipped the web page, or the customer record, the email would have been approved by its rule as before.
Set it up
Owners set it under Settings, or through the API. Any member can see it. It works on every plan, Free included.
curl -X PUT https://api.variantgate.com/v1/workspaces/$WORKSPACE_ID/trifecta-guard \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"private": ["crm.read", "db.query", "files.read"],
"untrusted": ["web.fetch", "email.read"],
"outbound": ["email.send", "http.post", "slack.post"],
"deny": false
}'{
"private": ["crm.read", "db.query", "files.read"],
"untrusted": ["web.fetch", "email.read"],
"outbound": ["email.send", "http.post", "slack.post"],
"deny": false,
"caught": 0,
"last_caught_at": null,
"set_by": "maya@northwind.example",
"updated_at": "2026-11-29T09:00:00Z"
}A pattern that is not a valid action pattern, an empty private or outbound list, or more than 20 patterns in a list is refused with 422. caught counts the requests whose outcome it changed (an approval it held back, or a denial), and last_caught_at says when it last did. A request a rule already denied is left as it was. Setting and removing it are logged in the activity log.
# See it (every member may)
curl https://api.variantgate.com/v1/workspaces/$WORKSPACE_ID/trifecta-guard \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"
# Turn it off (owners only); answers 204
curl -X DELETE https://api.variantgate.com/v1/workspaces/$WORKSPACE_ID/trifecta-guard \
-H "Authorization: Bearer YOUR_SESSION_TOKEN"What it cannot see
The guard only knows what reaches the gate. A read that never asks, such as a tool marked look-only in the MCP proxy, or Claude Code’s Read tool under a hook that skips reading, cannot light a leg. Route the reads you care about through VariantGate with an allow rule: they are answered at once and still recorded in the run. Or have the agent’s code list what it read in sources, as described in sources and provenance.
The run id comes from the agent’s side. Hooks and the SDKs take it from the session, out of the model’s reach; a tool call where the model fills in the run itself could start a fresh run to dodge the guard. Where that matters, set the run in code.
An agent that hands work to sub-agents splits one task across several runs, and the guard weighs each run alone until they are linked. Link each sub-agent’s run below its parent, as described in sub-agent runs, and the guard reads the whole family as one run.
What it never does
- It never approves a request, and never sets allowed to true.
- It never touches a request that does not send anything out.
- During an emergency stop nothing is allowed anyway; a deny still denies.
- It never tells the agent which requests lit a leg; only people in the workspace see that.
During a deploy
While two versions of the API run side by side during a deploy, one from before the trifecta guard ignores it, so a request that instance takes is decided as it was before. Set the guard once every instance runs this version.
Others work on the same problem. Databricks applies a similar policy inside its own agent platform, and toxic-flow scanners check an agent’s tools before it runs. The trifecta guard works at run time, per run, for any agent that asks through VariantGate, whether through a hook, MCP or an SDK, and it hands the caught request to a person instead of only blocking it.