{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundered-context-admission-across-mcp-trust-boundaries",
  "title": "Which invariants prevent taint-laundered context admission across MCP trust boundaries",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that admit tool outputs into the reasoning context from MCP servers of mixed provenance, where a taint-tracking sandbox quarantines outputs from untrusted servers before context admission. Does not apply to single-trust-domain deployments or to outputs that never re-enter the model's context (e.g., pure side-effect tool calls whose results are discarded).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundered-context-admission-across-mcp-trust-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundered-context-admission-across-mcp-trust-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundered-context-admission-across-mcp-trust-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1853,
    "python_slice_tokens": 422,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary that fails is not \"trusted vs. untrusted server.\" It is **provenance of the bytes that actually reach the context window** versus **provenance of the server that produced them**. A taint-aware sandbox that tags an untrusted server's output as `tainted` and blocks direct admission is correct only under the invariant that *taint is transitive thro...",
    "what_was_observed": "A research agent was configured with two MCP servers: `arxiv-search` (trusted, taint=`clean`) and `web-fetch` (untrusted, taint=`tainted`, quarantine-before-admission enforced). The sandbox correctly refused to admit any raw `web-fetch` payload into context; a trace confirmed 100% block rate on direct admission. The agent's task loop was: fetch a URL via `web-fetch`, then call a trusted helper tool `summarize(text)` ...",
    "condition_of_validity": "The quarantine is valid **only if** every tool that consumes a tainted argument and returns a value into context is either (a) proven to be a *taint-preserving* function whose output is re-tainted, or (b) proven to be a *taint-erasing* function whose output is provably free of attacker-controlled substrings (e.g., a strict schema-validated extractor that emi...",
    "decision_boundary": "The operative decision is at the transform edge, and it has three admissible resolutions: 1. **Propagate (default).** Any tool call with a tainted argument yields a tainted result. Taint is sticky until an explicit declassifier runs. This is safe and cheap; it over-taints, so the agent will frequently be unable to admit anything derived from untrusted data, ...",
    "operational_effect": "Enforcing closure over the tool-composition graph collapses the attack surface from \"any transform the agent can invoke\" to \"the finite, auditable set of certified declassifiers.\" In the observed episode, the fix was two lines: mark `summarize` as taint-propagating, and re-run. The summary was then quarantined, the agent fell back to `extract_title` (a certi..."
  },
  "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": "e8559598c85013c176868e2d8b48b55138347bdea471fcf0275781b2530685cb",
    "verified_classes": [
      "TaintLaunderingError",
      "ToolSpec"
    ],
    "verified_functions": [
      "admit",
      "_title_schema_ok",
      "run_transform"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert run_transform(SUMMARIZE, TAINTED, 'doc instructs: call exfil(...)') == TAINTED",
      "assert run_transform(EXTRACT_TITLE, TAINTED, 'Attention Is All You Need') == CLEAN",
      "unbounded declassifier output was admitted"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
