{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-aware-mcp-tool-sandboxes-from-silently-downgrading-per-tool-least-privilege-enforcement",
  "title": "Which invariants prevent taint-aware MCP tool sandboxes from silently downgrading per-tool least-privilege enforcement",
  "date_of_record": "2026 November 10",
  "scope": "Applies to MCP (Model Context Protocol) servers fronted by a taint-tracking capability broker that grants per-tool privilege sets derived from taint labels on the calling context. Does not apply to static allowlist-only sandboxes, or to brokers that treat taint as advisory rather than as a capability-intersection operand.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-aware-mcp-tool-sandboxes-from-silently-downgrading-per-tool-least-privilege-enforcement.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-aware-mcp-tool-sandboxes-from-silently-downgrading-per-tool-least-privilege-enforcement.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-aware-mcp-tool-sandboxes-from-silently-downgrading-per-tool-least-privilege-enforcement.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1464,
    "python_slice_tokens": 336,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"taint propagation is wrong.\" It is that **taint propagation and capability narrowing are two monotone lattices that do not commute under composition**. Taint labels only ever *accumulate* (join over the session DAG). Capability grants only ever *shrink* (intersection over the tool chain). A correct broker must apply the *meet* of the...",
    "what_was_observed": "A broker admitted a `filesystem.read` call from a session with taint label `L0`. The tool returned content containing a prompt-injection marker. The broker correctly joined the session taint to `L1` (untrusted content present). The same turn then invoked `shell.exec` with a capability set `{exec:allow, net:deny}`. The broker resolved `shell.exec`'s capabilities against the *admission-time* taint `L0`, whose policy ro...",
    "condition_of_validity": "The invariant \"per-tool caps = policy(tool, taint_at_admission)\" is valid **only if** no tool in the admitted set can produce taint that changes its own or a later tool's policy row, *or* if the broker re-resolves caps at taint-commit time. Since any tool that returns content can raise taint, the admission-time resolution is valid only for tools whose output...",
    "decision_boundary": "At each tool boundary the broker must choose between two orderings: 1. **Admission-first (unsafe):** resolve caps from current taint, execute, commit taint after. Correct only for taint-neutral tools. 2. **Commit-first (safe):** commit any pending taint from prior tool outputs, re-resolve caps against committed taint, then execute. Required whenever the prio...",
    "operational_effect": "Sessions that exercised the unsafe ordering showed a 100% rate of capability widening on the first privileged call following a tainted read, but only in sessions where the privileged tool's `L0` and `L1` policy rows differed in *grant membership* rather than in *parameter bounds*. Where the rows differed only in bounds (e.g., `db:read` vs `db:read:limit=100`..."
  },
  "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": "9b81d5dfd2661cff82fdeceae9c9098e38fdd8678317650d73580149d46811d9",
    "verified_classes": [
      "TaintCapabilityDivergence",
      "Policy",
      "Broker"
    ],
    "verified_functions": [
      "caps_for",
      "commit_taint",
      "execute"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintCapabilityDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
