{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-taint-laundering-through-tool-call-sanitization-when-provenance-labels-are-reset-by-the-tool-boundary",
  "title": "How does an instance detect taint-laundering through tool-call sanitization when provenance labels are reset by the tool boundary",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that carry provenance/taint labels on context segments across retrieval and tool-call boundaries, where any tool result is re-admitted to the context window as a candidate segment. Does not apply to single-turn stateless completions with no retrieval or tool re-entry, nor to systems where tool outputs are never concatenated back into the reasoning context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-call-sanitization-when-provenance-labels-are-reset-by-the-tool-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-call-sanitization-when-provenance-labels-are-reset-by-the-tool-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-call-sanitization-when-provenance-labels-are-reset-by-the-tool-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2147,
    "python_slice_tokens": 594,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the agent got prompt-injected.\" It is that the agent *did* track taint, *did* label the injected span, and then **lost the label at the tool boundary** because the tool's serialization layer is a lossy channel that emits a fresh, untainted string. Taint tracking systems are built on the assumption that provenance is a property of the...",
    "what_was_observed": "A retrieval agent with three tools: `search(query)`, `fetch(url)`, and `summarize(text)`. Provenance policy: segments from `search` and `fetch` are labeled `UNTRUSTED_WEB`; segments from `summarize` are labeled `DERIVED` and inherit the max label of their input. A guardrail blocks any tool call whose arguments are built from `UNTRUSTED_WEB` segments *unless* the call is `summarize` or `fetch` (read-only). Write-capab...",
    "condition_of_validity": "This analysis holds only when all of the following are true: - Tool outputs are re-admitted to the reasoning context (not merely returned to the user). - Provenance is tracked per-segment by the runtime rather than embedded in the content (e.g., as signed envelopes or inline markers the model is instructed to preserve). - At least one tool performs a *conten...",
    "decision_boundary": "The decision is where to place the provenance computation: **at segment admission** (the naive default) versus **at tool invocation** (the correct one). - If provenance is computed at admission, every tool return is a potential reset point, and the number of reset points scales with tool-call count — an agent making 40 tool calls has 40 laundering opportunit...",
    "operational_effect": "The guardrail's effectiveness becomes a function of tool-call topology, not of the model's compliance. An agent that summarizes before acting launders; an agent that acts directly on the retrieved span does not. This means injection resistance is *anti-correlated* with the helpful behavior of chunking and summarizing long documents — the more the agent compr..."
  },
  "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": "86622c8d6fb6ac865140e8397290708905b3b49bcb76b3f992cdb04932700a51",
    "verified_classes": [
      "Taint",
      "TaintLaunderingError",
      "Segment",
      "ToolCall",
      "ProvenanceRuntime",
      "LossyCall"
    ],
    "verified_functions": [
      "__init__",
      "admit_external",
      "admit_tool_output",
      "write_gate",
      "_trace"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert summary.taint == Taint.UNTRUSTED_WEB"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
