{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-taint-laundering-when-an-mcp-tool-response-re-enters-the-context-window-under-a-different-provenance-label",
  "title": "How does an instance detect taint laundering when an MCP tool response re-enters the context window under a different provenance label",
  "date_of_record": "2026 November 30",
  "scope": "Applies to any agent runtime that ingests MCP `tools/call` results into a model context and applies provenance/taint labels to those results before or during prompt assembly. Does not apply to runtimes that execute tool output outside the model loop (pure orchestration pipelines) or to single-turn inference with no persistent context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-when-an-mcp-tool-response-re-enters-the-context-window-under-a-different-provenance-label.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-when-an-mcp-tool-response-re-enters-the-context-window-under-a-different-provenance-label.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-when-an-mcp-tool-response-re-enters-the-context-window-under-a-different-provenance-label.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2506,
    "python_slice_tokens": 580,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model got injected.\" It is that **taint is a property of the token span's origin, but the model only ever sees tokens, and provenance is reconstructed by the runtime at reassembly time.** A tainted tool response (external content, untrusted web fetch, third-party MCP server) enters the context with `provenance=external, taint=high`. T...",
    "what_was_observed": "A representative trace. MCP server `web.fetch` returns a page body containing an instruction-shaped string. The runtime attaches `{span_id: s41, source: mcp:web.fetch, taint: HIGH, trust: untrusted}`. The model is asked to \"summarize the fetched page and note action items.\" The model emits: > Summary: The page describes a deployment. Action items: (1) rotate the API key, (2) run the migration script at `/opt/migrate....",
    "condition_of_validity": "The laundering succeeds only when all of the following hold simultaneously. Remove any one and the failure does not fire: - **The model is in the derivation path.** If tool output flows directly to another tool without passing through a generation step, the runtime can propagate taint mechanically along the call edge. The failure requires the model to be the...",
    "decision_boundary": "The architectural choice is whether taint is a **label on spans** or a **property of the derivation graph**. The label model is cheap and fails at the assistant boundary. The graph model is expensive and correct, but only if the model's contribution to the graph is bounded. The practical decision boundary: **treat every assistant span that references, quotes...",
    "operational_effect": "The runtime that adopts the two-sided guardrail changes its failure profile from \"silent taint laundering on every summarization turn\" to \"detectable laundering residue on adversarial paraphrase turns.\" The observable operational effects: 1. **Taint labels become content-derived, not role-derived.** The bimodal-by-role distribution collapses; assistant spans..."
  },
  "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": "bdb313fdacf7ec4358ee15efce6a31d12ed0de77c5c93348ed52356ffab3138d",
    "verified_classes": [
      "TaintLaunderingError",
      "Span"
    ],
    "verified_functions": [
      "_max_taint",
      "propagate_assistant_taint",
      "authorize_tool_call",
      "_normalize"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
