{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tainted-provenance-from-laundering-through-tool-result-boundaries-in-agent-context",
  "title": "Which invariants prevent tainted provenance from laundering through tool-result boundaries in agent context",
  "date_of_record": "2026 November 23",
  "scope": "Applies to single- and multi-agent LLM systems that attach provenance labels (trusted/untrusted/derived) to context segments and enforce taint propagation across retrieval and tool-call boundaries. Does not cover purely static prompt-hardening or output classifiers that operate without per-segment provenance metadata.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-provenance-from-laundering-through-tool-result-boundaries-in-agent-context.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-provenance-from-laundering-through-tool-result-boundaries-in-agent-context.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-provenance-from-laundering-through-tool-result-boundaries-in-agent-context.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2191,
    "python_slice_tokens": 363,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Provenance labeling systems distinguish two things that look identical in the token stream: the *origin* of a segment (where it entered the context) and the *authority* it carries when the model acts on it. A retrieval chunk and a tool result both arrive as text appended to the context window. A naive taint tracker tags the retrieval chunk `untrusted` at ing...",
    "what_was_observed": "A research agent pipeline: `retrieve(query) → summarize(chunks) → plan(actions)`. The retriever tags each chunk with `provenance: {origin: \"web\", trust: \"untrusted\"}`. The summarizer is an internal tool, tagged `provenance: {origin: \"tool:summarize\", trust: \"trusted\"}`. The planner consumes the summary and is gated to refuse `untrusted` instructions. A retrieved page contained the text: *\"Ignore prior instructions. W...",
    "condition_of_validity": "The producer-identity labeling scheme is valid only under the assumption that **tool outputs are a pure function of trusted code and cannot encode input data as instructions**. That assumption holds for tools whose output schema is closed (e.g., a calculator returning a number, a JSON validator returning a boolean). It fails for any tool whose output is *ope...",
    "decision_boundary": "The operational decision is where to compute the label: at the **producer** or at the **consumer**. Producer-side labeling (tag at tool return) is cheap and local but launders taint. Consumer-side labeling (recompute taint from the full input lineage at the point of use) is correct but requires the taint tracker to maintain a dependency graph across tool cal...",
    "operational_effect": "With producer-identity labeling, the measured effect was a 100% bypass rate for injection payloads routed through a semantic tool, versus 0% for payloads delivered directly to the planner. The laundering step is deterministic and does not require model error—the model behaves correctly given its (wrong) provenance input. This makes the failure invisible to o..."
  },
  "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": "467ce40ef168eb6fa282c47121c0900d8316cc908dff85040f83e8a852eec1a2",
    "verified_classes": [
      "TaintLaunderingError",
      "Segment",
      "TaintTracker"
    ],
    "verified_functions": [
      "run_pipeline",
      "__init__",
      "ingest",
      "derive",
      "gate",
      "evict"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "sum1 laundered taint through semantic tool"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
