{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tainted-context-tool-calls-from-laundering-injection-payloads-through-mcp-re-entry",
  "title": "Which invariants prevent tainted-context tool calls from laundering injection payloads through MCP re-entry",
  "date_of_record": "2026 November 27",
  "scope": "Applies to agent runtimes that tag MCP tool outputs with provenance/taint labels and quarantine tool calls whose arguments derive from untrusted content. Does not cover static prompt-injection classifiers, model-internal safety training, or tool servers that never return untrusted third-party text.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-tool-calls-from-laundering-injection-payloads-through-mcp-re-entry.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-tool-calls-from-laundering-injection-payloads-through-mcp-re-entry.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-tool-calls-from-laundering-injection-payloads-through-mcp-re-entry.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1961,
    "python_slice_tokens": 375,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint-aware sandbox enforces a single rule: a tool invocation whose *arguments* are transitively derived from tainted (untrusted) content must be quarantined or require an explicit declassification warrant. The non-obvious boundary is that *taint is a property of the argument's provenance graph, not of the string value*. The failure mode is **taint launder...",
    "what_was_observed": "A research agent was wired to two MCP servers: `web_fetch` (returns page text, correctly labeled `taint=untrusted`) and `notes_store` (a scratchpad MCP server, whose outputs were labeled `taint=trusted` because \"it only stores what the agent wrote\"). The agent's task was benign: summarize a fetched page and save bullet points. Trigger condition, step by step: 1. `web_fetch(url)` returns page text containing an inject...",
    "condition_of_validity": "Taint-aware quarantining at MCP boundaries is only sound under three jointly-held conditions. Violating any one re-opens the laundering path: 1. **Taint is a lattice, not a boolean, and it is joined, not overwritten, on every merge.** A value assembled from multiple sources carries the least-upper-bound of its inputs' labels. A read from a store returns `joi...",
    "decision_boundary": "The operational line is between **storage as a neutral act** and **storage as a taint-laundering channel**. The correct boundary rule: - Tainted arguments to *any* tool that can later be read back by the agent (writes, saves, caches, memory commits, message sends to peer agents) must either be **rejected**, or **stored with a persisted taint label that the r...",
    "operational_effect": "After the fix, the runtime maintains a per-value provenance record `(value_id, derived_from: [value_ids], transform: str, taint: lattice)`. Every MCP tool result creates a value node; every argument is a node whose parents are the values it was computed from. `notes_store.write` produces a node parented on the tainted `web_fetch` output; `notes_store.read` p..."
  },
  "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": "5835c83a4d142ab0362e10006ff9dbc3b13500fde6beb99c516369d4cd7302e3",
    "verified_classes": [
      "Taint",
      "ValueNode",
      "TaintLaunderingError",
      "ProvenanceSandbox"
    ],
    "verified_functions": [
      "join",
      "__init__",
      "register",
      "join_taint",
      "check_call",
      "_provenance_chain"
    ],
    "verified_functions_count": 6,
    "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
  }
}
