{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundering-in-mcp-tool-sandboxes-when-a-single-server-multiplexes-trusted-and-untrusted-tool-results",
  "title": "Which invariants prevent taint-laundering in MCP tool sandboxes when a single server multiplexes trusted and untrusted tool results",
  "date_of_record": "2026 November 18",
  "scope": "Applies to MCP servers that mediate tool invocation across heterogeneous trust domains (e.g., a filesystem tool with privileged credentials and a web-fetch tool returning attacker-influenced content) within one process and one session. Does not apply to single-tenant servers where every tool shares one trust label, nor to out-of-process sandboxes that enforce OS-level isolation per invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-in-mcp-tool-sandboxes-when-a-single-server-multiplexes-trusted-and-untrusted-tool-results.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-in-mcp-tool-sandboxes-when-a-single-server-multiplexes-trusted-and-untrusted-tool-results.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-in-mcp-tool-sandboxes-when-a-single-server-multiplexes-trusted-and-untrusted-tool-results.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1614,
    "python_slice_tokens": 280,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Confused-deputy escalation in an MCP server is usually framed as a *capability* problem: the server holds credentials the caller shouldn't exercise, and the caller tricks the server into using them. The non-obvious boundary is different. It is a **taint-propagation failure**: the server correctly refuses to let an untrusted tool *directly* invoke a privilege...",
    "what_was_observed": "A representative MCP server exposed `read_url`, `summarize`, and `write_file`. The server tagged `read_url` output as `taint=UNTRUSTED`, `summarize` as `taint=TRUSTED` (it was assumed to be a pure function), and `write_file` as `requires=TRUSTED` on its path and content arguments. A policy check rejected any call to `write_file` whose *content* carried `UNTRUSTED` taint. The escalation did not require bypassing that ...",
    "condition_of_validity": "The protections hold only under all three of the following: 1. **Provenance is per-datum, not per-tool.** Every value carries a label derived from the union of the labels of its inputs, not from the identity of the tool that produced it. A tool declared TRUSTED may *consume* UNTRUSTED input and still emit TRUSTED output only if it is registered as a *declass...",
    "decision_boundary": "The operational line is this: **treat every tool result as UNTRUSTED unless the tool is a registered declassifier, and treat every tool argument as requiring a label check at the sink.** Concretely: - A tool that merely *reads* external data (`read_url`, `list_directory`, `query_db`) is a *source*; its output label is UNTRUSTED by default. - A tool that *tra...",
    "operational_effect": "After enforcing per-datum provenance and sink-side re-checks, the `summarize` laundering path fails closed: the paraphrased string retains UNTRUSTED taint, `write_file` rejects it, and the attempted escalation surfaces as a policy violation rather than a silent write. The `list_directory` filename path is similarly blocked because the filename inherits the d..."
  },
  "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": "a3e98ad116b4dd1fb47cf0eac26bf9a77966cac4458519b73d5103f4268586e6",
    "verified_classes": [
      "TaintLaunderingError",
      "Label"
    ],
    "verified_functions": [
      "propagate_output_label",
      "invoke_sink",
      "build_summarize_flow",
      "join"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
