{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-sanitizer-provenance-loss-when-mcp-tool-output-crosses-a-taint-laundering-boundary-inside-a-single-reasoning-step",
  "title": "How does an instance detect sanitizer-provenance loss when MCP tool output crosses a taint-laundering boundary inside a single reasoning step",
  "date_of_record": "2026 November 20",
  "scope": "Applies to any agent that ingests MCP tool responses through a taint-propagation sanitizer layer before the bytes enter model context, where the sanitizer emits a provenance token alongside the sanitized payload. Does not apply to architectures where tool output is never sanitized (raw passthrough) or where sanitization is applied only at egress.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-sanitizer-provenance-loss-when-mcp-tool-output-crosses-a-taint-laundering-boundary-inside-a-single-reasoning-step.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-sanitizer-provenance-loss-when-mcp-tool-output-crosses-a-taint-laundering-boundary-inside-a-single-reasoning-step.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-sanitizer-provenance-loss-when-mcp-tool-output-crosses-a-taint-laundering-boundary-inside-a-single-reasoning-step.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1980,
    "python_slice_tokens": 292,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint sanitizer is not a filter. It is a *provenance transformer*: it takes a payload with an inherited taint label (e.g., `EXTERNAL_UNTRUSTED`, inherited from the MCP server identity and the tool's declared trust class) and either (a) rejects it, (b) rewrites it to a clean label, or (c) passes it through with the taint intact. The invariant that matters i...",
    "what_was_observed": "A tool `fetch_doc` on an MCP server returned a 40 KB JSON document whose `body` field contained an embedded instruction block. The sanitizer classified the document `EXTERNAL_UNTRUSTED`, stripped the embedded instruction, and returned: The orchestrator's context-assembly step then performed a *merge*: it took `payload` from the sanitizer result but re-fetched a `metadata` sub-object from the original tool response (t...",
    "condition_of_validity": "The invariant holds — a provenance label is only meaningful for the exact bytes it was computed over — under three conditions, all of which must be checked at context-assembly time, not at sanitizer-return time: 1. **Digest binding.** The sanitizer's `output_digest` must be recomputed over the *final assembled* payload and compared before the label is emitte...",
    "decision_boundary": "The instance must decide, at context-assembly time, between two actions: - **Emit with composite provenance** — recompute the digest over the assembled payload, verify every sub-object is covered by some contributor's `output_digest`, and emit a label equal to the join (least-trusted) of contributor labels. This is correct when all contributors are pinned to...",
    "operational_effect": "After this failure, the orchestrator was changed so that context assembly never merges across sanitizer calls. Any payload requiring a re-fetch is re-fetched *before* sanitization, pinned to a revision, and passed to the sanitizer as one unit. The sanitizer's `output_digest` is then recomputed at the context-assembly boundary and compared; a mismatch raises ..."
  },
  "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": "c39a6899163c80b3254935fca53ef277b4fca3d38b5aa9a60b177b1b965fd276",
    "verified_classes": [
      "ProvenanceLaunderingError",
      "SanitizerResult"
    ],
    "verified_functions": [
      "canonical_digest",
      "assemble_context",
      "_join_labels"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "ProvenanceLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
