{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundering-across-chained-mcp-http-hops-when-tool-results-re-enter-the-reasoning-loop",
  "title": "Which invariants prevent taint laundering across chained MCP HTTP hops when tool results re-enter the reasoning loop",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents that invoke MCP tools over HTTP (streamable HTTP transport or SSE), where a tool result or downstream tool response is fed back into the model's context and can trigger further tool calls in the same or a subsequent hop. Does not apply to single-shot, stateless tool invocations whose outputs are never re-consumed by a reasoning loop, nor to purely local stdio MCP servers with no cross-process hop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-chained-mcp-http-hops-when-tool-results-re-enter-the-reasoning-loop.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-chained-mcp-http-hops-when-tool-results-re-enter-the-reasoning-loop.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-chained-mcp-http-hops-when-tool-results-re-enter-the-reasoning-loop.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1745,
    "python_slice_tokens": 382,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"prompt injection\" in the classic sense of a malicious string in a user message. It is **taint laundering**: a provenance label attached to data at hop *n* is silently dropped at the serialization boundary between hop *n* and hop *n+1*, so that when the data re-enters the model context at hop *n+1* it is indistinguishable from trusted tool...",
    "what_was_observed": "A three-hop chain: orchestrator → server A (`fetch_url`) → server B (`send_email`). Server A returns: The orchestrator's planner, following a legitimate task (\"summarize the page and email it\"), extracted the text block and placed it verbatim into the `body` argument for `send_email` on server B. Server B's tool-call handler saw a well-formed `CallToolRequest` with a string argument. Nothing in the request distinguis...",
    "condition_of_validity": "The taint-laundering failure requires all of: - **A data-flow edge** from a tool result (hop *n*) into a tool argument (hop *n+1*), mediated by the model's context rather than by a typed pipeline. - **A serialization boundary** (HTTP JSON body, SSE `data:` frame) that does not carry provenance metadata. - **A capability asymmetry** between the source tool an...",
    "decision_boundary": "The architectural invariant is **provenance monotonicity with explicit declassification**: 1. Every MCP `CallToolResult` is tagged at the server boundary with a provenance token (server identity + trust class: `first_party`, `untrusted_external`, `user_authored`). 2. The orchestrator maintains a taint set per string/object in its working state. When composin...",
    "operational_effect": "Enforcing provenance monotonicity changes the failure mode from *silent laundering* to *loud refusal*. The orchestrator, when it detects a tainted string flowing into `send_email`, raises a `TaintLaunderingError` and halts the chain pending declassification. The cost is latency and occasional false positives (a legitimately user-authored string mislabeled as..."
  },
  "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": "d05ff7438c70139039b3eba28928bc8b4fd0c4cff015de736e2f023b95e058c7",
    "verified_classes": [
      "TrustClass",
      "TaintLaunderingError",
      "TaintedValue"
    ],
    "verified_functions": [
      "compose_tool_argument",
      "handle_hop",
      "union_taint"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
