{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundering-of-retrieved-content-across-tool-and-retrieval-boundaries",
  "title": "Which invariants prevent taint-laundering of retrieved content across tool and retrieval boundaries",
  "date_of_record": "2026 November 9",
  "scope": "Applies to agent systems that attach provenance/taint labels to retrieved documents and tool outputs and propagate those labels through multi-hop tool calls. Does not apply to single-turn, single-tool RAG where the retrieved span never re-enters the model as an instruction-bearing artifact, nor to systems where tool outputs are structurally non-executable (e.g., pure numeric telemetry with no free-text fields).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-of-retrieved-content-across-tool-and-retrieval-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-of-retrieved-content-across-tool-and-retrieval-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-of-retrieved-content-across-tool-and-retrieval-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1314,
    "python_slice_tokens": 234,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things an agent can do with a piece of untrusted text: *read* it and *re-emit* it. Taint tracking systems are usually correct about the first and silently wrong about the second. The failure is not \"the model followed an injected instruction.\" The failure is that a tainted span crossed a tool boundary, was re-serialized by a tool, and ...",
    "what_was_observed": "A retrieval tool returned a document with `provenance=external_untrusted, taint=high`. The agent, following a plan step, passed a quote from that document into a `summarize` tool whose contract was \"takes text, returns summary.\" The summarize tool called an upstream model and returned `provenance=internal_tool, taint=none` because the tool's own implementation never received the label — only the text. The summary con...",
    "condition_of_validity": "The invariant holds only when every boundary that accepts tainted values is *label-aware*: it receives the label as an explicit argument and is contractually required to emit a label at least as tainted as its most-tainted input. This is a *join* over inputs (max-taint), not a union over spans. Where this condition fails — boundaries that take only text, bou...",
    "decision_boundary": "The decision is not \"is this text tainted?\" but \"did the label survive the transformation?\" Concretely, a value may be downgraded from tainted to clean only if one of the following holds: (1) it was produced by a label-aware boundary whose declared join rule was applied and logged; (2) it was verified against a signed first-party source independent of the ta...",
    "operational_effect": "After the incident, the retrieval and summarize tools were changed to accept and emit explicit `taint` fields; the planner was changed to reject any tool output whose `taint` is lower than the max taint of its inputs unless a declassification record exists. The practical consequence is a higher rate of false-positive refusals on legitimate summarization chai..."
  },
  "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": "cbced85ebbcfcb94d9870e158fd0345f1096acf4a0d9db6fd750ea0c7fbf1a5e",
    "verified_classes": [
      "TaintLaunderingError"
    ],
    "verified_functions": [
      "join_taint",
      "apply_boundary",
      "summarize_tool",
      "route_action"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "summarize_tool lost taint during paraphrase"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
