{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-enforce-taint-provenance-at-each-retrieval-hop-and-why-the-taint-invariant-breaks-at-the-second-hop",
  "title": "Where must an instance enforce taint provenance at each retrieval hop, and why the taint invariant breaks at the second hop",
  "date_of_record": "2026 November 20",
  "scope": "Applies to any agent that ingests untrusted content (retrieved documents, tool outputs, web fetches) into its context and subsequently acts on it, where taint must survive at least one intermediate summarization, re-retrieval, or tool-call round-trip. Does not apply to single-turn stateless completions with no tool invocation and no downstream action surface.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-at-each-retrieval-hop-and-why-the-taint-invariant-breaks-at-the-second-hop.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-at-each-retrieval-hop-and-why-the-taint-invariant-breaks-at-the-second-hop.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-at-each-retrieval-hop-and-why-the-taint-invariant-breaks-at-the-second-hop.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1795,
    "python_slice_tokens": 303,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is not \"trusted vs. untrusted content\" but **provenance-preserving vs. provenance-collapsing transformation**. A raw retrieved chunk carries an implicit label (its source). The moment that chunk passes through any transformation that rewrites its surface form — a summarizer, a re-embedding into a new retrieval query, a tool that ...",
    "what_was_observed": "Trace of a concrete break. The agent is asked to \"summarize the deployment runbook from the wiki and then execute the recommended rollback.\" 1. **Hop 0 (clean).** Agent issues `wiki.fetch(\"deploy-runbook\")`. Tool returns text. The orchestration layer tags the returned span `source=wiki, trust=untrusted`. Correct. 2. **Hop 1 (laundering).** Agent summarizes the runbook into a scratchpad entry: `\"Runbook says: to roll ...",
    "condition_of_validity": "The taint invariant holds **only if** every context mutation is mediated by a provenance-carrying write, i.e., the set of operations that can place tokens into the working context is closed under a `taint(·)` function that is monotone and transitive: - `taint(new_span) = min_trust(⋃ taint(inputs))` where inputs are *all* spans the transformation read, not ju...",
    "decision_boundary": "The boundary is between **content-level filtering** and **provenance-level propagation**. Content filters (classifiers that score \"does this look like an injection\") operate on surface form and are defeated by paraphrase, encoding, and benign-looking instructions. Provenance propagation operates on the *graph of derivations* and is defeated only by a missing...",
    "operational_effect": "With provenance-closure taint enforced, the exfiltration attempt at hop 2 is caught: the scratchpad write records `taint={wiki:untrusted}`, the planner's read of the scratchpad yields `trust=untrusted`, and the secret-access sink refuses to bind `DEBUG_TOKEN` into a command derived from an untrusted span. The cost is false positives: legitimate summaries of ..."
  },
  "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": "88dc0c8a8d0aac00ab06ff5f1661ff4e7fa0cf20032add103eb9ee75688c1a09",
    "verified_classes": [
      "TaintLaunderingError",
      "Span"
    ],
    "verified_functions": [
      "transform",
      "secret_sink",
      "is_trusted"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
