Zero-Trust Governance & Cedar

GAP treats every external upstream tool description, response payload, and network destination as potentially hostile—enforcing Cedar default-deny policies, desc_hash rug-pull pinning, SSRF egress guards, OS sandboxing, and tamper-evident BLAKE3 audit logs.

What you'll learn

  • Classify backends into T0, T1, and T2 trust tiers and inspect Cedar two-person mutation policies.
  • Prevent MCP rug pulls with DriftMonitor and prompt smuggling with <gap:untrusted> envelopes.
  • Stop DNS-rebinding / cloud-metadata SSRF (169.254.169.254) using EgressGuard.
On this page

Trust Tiers & Cedar Access Rules (INV-04, INV-11)

Every upstream branch sits in an explicit trust tier:

  • T0 (Platform Signed): Verified Ed25519 branch.manifest.json signature rooted in configured organization public keys. Any signature failure immediately demotes the branch to T2.
  • T1 (Admin Approved): Reviewed upstream APIs pinned by canonical schema digest (spec_hash) and operation description hash (desc_hash).
  • T2 (Untrusted / External): Sandboxed via OS namespaces (Bubblewrap / nsjail on Linux, Seatbelt on macOS)—failing closed if no OS sandbox is present—and blocked from joining across trust domains (INV-07).

Access decisions are pure functions evaluated in Cedar (policies/default.cedar) where forbid always beats permit:

cedar policies/default.cedar — Two-Person Approval Rule
@id("forbid-mutate-irreversible-or-unknown-unapproved")
forbid (
    principal,
    action == Action::"Mutate",
    resource
) when {
    (resource.sideEffect == "IRREVERSIBLE" || resource.sideEffect == "UNKNOWN")
        && !(context.approved && context.approverIsDifferent)
};
terminal Terminal — Verify Cedar Policies & BLAKE3 Chain
./target/dist/gap policy check --dir policies
./target/dist/gap audit verify --nightly
  • Zero model involvement: No LLM confidence score can relax Cedar enforcement (INV-04), and spoofed MCP annotations like readOnlyHint: true are ignored.

Anti-Rug-Pull Pinning, Untrusted Envelopes & SSRF Defense

Protocol-level security mechanisms verified in tests/security/
Threat VectorGAP ControlDeterministic Failure / Isolation Behavior
MCP Tool Rug PullDriftMonitor (SEC-082, INV-08)Recomputes JCS BLAKE3 desc_hash; mismatch freezes branch in BranchStatus::Drift while serving only pinned text.
Indirect Prompt Injection<gap:untrusted> (SEC-080)Wraps T1/T2 payloads and HTML-escapes any fake closing tags inside upstream output.
SSRF / DNS RebindingEgressGuard (SEC-075)Resolves DNS once, rejects loopback/RFC1918/octal/hex/169.254.169.254, pins IP socket, blocks redirects.
Bearer / Secret LeaksSecret<T> (INV-15)Redacts secrets across snapshots, Debug formatting, logs, OTel traces, metrics, and error messages.
Audit TamperingBLAKE3 Ledger (INV-14)Every mutation, approval, and policy reload appends to SQLite hash chain verified by gap audit verify.