{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-mcp-tool-sandboxes-from-leaking-state-across-syscall-level-isolation-boundaries",
  "title": "Which invariants prevent MCP tool sandboxes from leaking state across syscall-level isolation boundaries",
  "date_of_record": "2026 November 25",
  "scope": "Applies to MCP (Model Context Protocol) servers that execute tool invocations inside a per-call syscall-filtered sandbox (seccomp-bpf/LSM gVisor-style profile) combined with an egress firewall whose rules are derived from the tool's declared capability manifest. Covers stateful tools whose syscalls mutate shared kernel-visible resources between calls. Does not cover stateless pure-compute tools, nor sandboxes that tear down and rebuild the entire mount/network namespace per invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-tool-sandboxes-from-leaking-state-across-syscall-level-isolation-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-tool-sandboxes-from-leaking-state-across-syscall-level-isolation-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-mcp-tool-sandboxes-from-leaking-state-across-syscall-level-isolation-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1853,
    "python_slice_tokens": 384,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary that matters is not \"is the tool sandboxed\" but \"is the *namespace of the sandbox* identical to the *namespace the agent believes it is operating in*.\" A per-invocation egress policy and a per-invocation seccomp profile are both **admission controls**: they decide whether a syscall or a packet is permitted at the moment it is attempted. They are...",
    "what_was_observed": "A tool `fs.read_slice` was declared with capabilities `{read: [\"/data/**\"], net: none}` and profiled with a seccomp allowlist that included `openat`, `read`, `mmap`, `close`, and `sendmsg`. The egress policy blocked all `AF_INET`/`AF_INET6` connects. The tool opened a file under `/data`, mapped it, and returned a slice. Correct. A second tool `net.fetch_url` was declared `{net: [\"https://api.internal/**\"]}` and ran u...",
    "condition_of_validity": "The invariant \"per-invocation admission control implies per-invocation isolation\" holds **only if** the sandbox's resource namespace is reconstructed per invocation, i.e., the set of kernel objects reachable by permitted syscalls is a function of the invocation, not of the process group's history. Concretely, it holds when: 1. Every `AF_UNIX`/`AF_VSOCK`/abst...",
    "decision_boundary": "The operational decision is whether to pay the namespace-rebuild cost per invocation or to reuse process groups. The boundary is sharp: - **Rebuild per invocation** when any tool in the group declares `AF_UNIX`, `AF_VSOCK`, `memfd`, `shm`, or `SCM_RIGHTS` capability, or when any tool's egress policy includes a name that could resolve through a local resolver...",
    "operational_effect": "With the intersection rule enforced, the `fs.read_slice` / `net.fetch_url` group is rejected at admission: `socket` is permitted for both, but `bind` is permitted only for the first and `connect` only for the second, so the shared surface includes `socket` with no `bind`/`connect` — the group is rebuilt per invocation, and the abstract socket from `fs.read_s..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "4f8936e0b8cb6b5e734a27cc0655f372eeff4614683e2d9632d958d9d60ba514",
    "verified_classes": [
      "SandboxIsolationViolation"
    ],
    "verified_functions": [
      "plan_sandbox_group",
      "admit_invocation"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SandboxIsolationViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
