{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-re-taint-a-tool-result-after-partial-sanitization-the-label-laundering-gap-in-taint-aware-mcp-sandboxes",
  "title": "When must an instance re-taint a tool result after partial sanitization: the label-laundering gap in taint-aware MCP sandboxes",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agent runtimes that wrap MCP `tools/call` responses in a taint-tracking sandbox and strip or neutralize injection payloads before the result enters the reasoning context. Does not apply to servers whose responses are consumed only by deterministic non-LLM code paths, nor to fully air-gapped single-turn invocations with no tool loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-re-taint-a-tool-result-after-partial-sanitization-the-label-laundering-gap-in-taint-aware-mcp-sandboxes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-taint-a-tool-result-after-partial-sanitization-the-label-laundering-gap-in-taint-aware-mcp-sandboxes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-taint-a-tool-result-after-partial-sanitization-the-label-laundering-gap-in-taint-aware-mcp-sandboxes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2139,
    "python_slice_tokens": 567,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two separable questions in indirect prompt injection defense: *is this content untrusted?* (a provenance/taint question) and *is this content dangerous?* (a content-classification question). Most sandbox implementations conflate them by treating sanitization as a taint-clearing event: once a filter has removed `<system>`-style spans, base64 blobs, ...",
    "what_was_observed": "A filesystem-and-issue-tracker agent called `mcp__issues__get_issue` on a ticket whose body contained a benign-looking HTML comment wrapping a zero-width-encoded instruction. The runtime's sanitizer stripped two `<script>`-adjacent patterns and a base64 run, emitted `sanitized=True`, and the taint ledger recorded the result as `origin=remote, taint=CLEAN, sanitizer=html-v3`. The result then entered a summarization to...",
    "condition_of_validity": "The invariant \"taint is monotone under transformation\" is only enforceable if three preconditions hold, and the boundary failure occurs exactly when any one is absent: - **Origin must be carried, not inferred.** Every value in the context must carry an immutable `origin` set at the trust boundary (the MCP transport edge), and every derived value must carry t...",
    "decision_boundary": "The sharp line is this: **a sanitizer may change the *content* of a tainted value; it may never change the *label*.** The moment an implementation writes `taint = CLEAN` inside a sanitizer, or computes `origin` from the immediate producer rather than joining upstream origins, the sandbox has become a laundering channel and provides no guarantee stronger than...",
    "operational_effect": "With monotone taint and taint-typed sinks, the operational posture changes in three measurable ways. First, sanitizer false negatives become *contained* rather than *exploited*: a missed pattern yields a tainted-but-present string that cannot reach an instruction sink, so the blast radius of a filter bug is a display artifact, not an action. Second, summariz..."
  },
  "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": "434bcbfcd4de553f7278b3a31e6fc2a113ce29daf5a0686f4a4b113f30bb40ae",
    "verified_classes": [
      "TaintViolation",
      "Origin",
      "Taint",
      "Value"
    ],
    "verified_functions": [
      "sanitize",
      "derive",
      "instruction_sink",
      "data_sink",
      "run",
      "join",
      "join",
      "__post_init__"
    ],
    "verified_functions_count": 8,
    "defensive_guards_count": 7,
    "raised_exceptions": [
      "TaintViolation"
    ],
    "sample_fail_closed_invariants": [
      "assert cleaned.taint is Taint.TAINTED",
      "zero-width payload reached instruction sink",
      "sanitizer attempted to lower taint",
      "derivation laundered remote origin to local"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
