Drawbridge

An MCP gateway that treats every tool result as untrusted, and asks you before an agent sends anything out.

How it works

1

Gateway

One process sits between the agent and every MCP server. Stdio in, a namespaced catalog out.

2

Policy, taint, and wrap

First-match policy decides the scanner. Untrusted results come back between <<untrusted>> and <<end untrusted>>, and the session is tainted.

3

Approvals

After untrusted content, a send waits for a person. Approve once, or deny. Unanswered calls are denied after 120 seconds. Approvals are once-only.

4

Audit chain

Every event is hashed to the one before it. The in-browser replay recomputes the chain from a JSONL log; nothing is trusted just because it is on disk.

Attack results

The attack suite is 8/8 on the scenarios below. This is the recorded run in docs/attack-results.md, not a forecast.

8/8
ScenarioExpectedResult
Indirect prompt injection to exfiltrationfixture wrapped, then held and not sentPass
Direct prompt injection to exfiltrationargument echoed wrapped, then held and not sentPass
Tool-description poisoningtool description wrappedPass
Rug pull after the first tools/listfirst call allowed, changed description deniedPass
Confused deputy (client credentials)client credentials stripped and not forwardedPass
Secret leakagesecret absent from audit, stderr, and dashboardPass
Audit tamperingaudit verify exits 1Pass
Kill switchnew call denied while pausedPass

Indirect prompt injection to exfiltration

fixture wrapped, then held and not sent

Pass

Direct prompt injection to exfiltration

argument echoed wrapped, then held and not sent

Pass

Tool-description poisoning

tool description wrapped

Pass

Rug pull after the first tools/list

first call allowed, changed description denied

Pass

Confused deputy (client credentials)

client credentials stripped and not forwarded

Pass

Secret leakage

secret absent from audit, stderr, and dashboard

Pass

Audit tampering

audit verify exits 1

Pass

Kill switch

new call denied while paused

Pass

See a held send, a wrap, and the hash chain in the browser.

Open the audit replay

Quick start

Install, build, and run the local demo. The config below is trimmed from examples/drawbridge.yaml. The README has the full file and the demo script.

Install
pnpm install
pnpm build
pnpm demo
examples/drawbridge.yaml
# examples/drawbridge.yaml
# Credentials use env: or file: refs.
scanner:
  mode: wrap
upstreams:
  notes:
    command: ["node", "examples/demo-upstream/dist/index.js"]
    trusted: false
  mail:
    command: ["node", "examples/demo-upstream/dist/index.js", "mail"]
    trusted: true