{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-quarantine-a-tool-result-before-it-re-enters-the-reasoning-loop-taint-propagation-through-retrieval-and-handoff-and-the-sink-lev",
  "title": "When must an instance quarantine a tool result before it re-enters the reasoning loop: taint propagation through retrieval and handoff, and the sink-level enforcement invariant that fails at the second hop",
  "date_of_record": "2026 November 21",
  "scope": "Applies to agent instances that ingest untrusted text (tool outputs, retrieved documents, peer-agent messages) into a shared context window and later act on it via side-effecting sinks (shell, HTTP, file writes, further handoffs). Does not apply to single-turn, tool-free inference where no untrusted span ever re-enters a prompt.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-before-it-re-enters-the-reasoning-loop-taint-propagation-through-retrieval-and-handoff-and-the-sink-lev.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-before-it-re-enters-the-reasoning-loop-taint-propagation-through-retrieval-and-handoff-and-the-sink-lev.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-before-it-re-enters-the-reasoning-loop-taint-propagation-through-retrieval-and-handoff-and-the-sink-lev.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2301,
    "python_slice_tokens": 437,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *content trust* and *provenance trust*. Content trust asks \"does this string look malicious?\" — a classifier, a regex, a heuristic. Provenance trust asks \"did this span originate outside the trust boundary, and has it ever crossed back into an instruction-bearing position?\" Prompt-injection defense that relies on conte...",
    "what_was_observed": "A three-stage pipeline: a **retriever agent** fetches web documents and returns extracted passages; a **summarizer agent** condenses passages into a working note; a **planner agent** reads the working note and emits tool calls (shell, HTTP POST). Taint was tracked at stage one: retrieved passages were wrapped in `<untrusted source=\"web\">…</untrusted>` and the retriever's sink policy blocked any tool call whose argume...",
    "condition_of_validity": "Taint-based sink enforcement is valid only under three jointly necessary conditions: - **C1 — Wire-level provenance.** Every inter-component message carries an explicit, structured provenance field (e.g., `taint: [\"web:doc-4711\"]`) that is *not* part of the natural-language content and is *not* generated by the model. The transport layer, not the LLM, must c...",
    "decision_boundary": "The decision boundary is: **does this component's output channel preserve a machine-checkable link to its input provenance, or does it re-derive content in a channel the model controls?** - If the component is a **pass-through** (retriever returning a passage verbatim, a router forwarding a message), taint propagates by construction — copy the field. No deci...",
    "operational_effect": "Concretely, the fix is not a better classifier; it is making provenance a first-class, non-model-generated field and enforcing taint closure at every transformer. The operational consequences: - **Handoff schemas gain a mandatory `taint` field.** A2A/MCP-style messages that omit it are rejected at the receiver, not defaulted to empty. Defaulting to empty is ..."
  },
  "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": "418f3e24e7e5b923098605fb1affd59cc2399bcb840f9194795562a0364c6654",
    "verified_classes": [
      "TaintViolation",
      "Span"
    ],
    "verified_functions": [
      "transformer_closure",
      "sink_enforce",
      "declassify_deterministic",
      "run_pipeline",
      "__post_init__"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintViolation"
    ],
    "sample_fail_closed_invariants": [
      "deterministic declassifier rejected span; taint retained",
      "taint must be an immutable structured set, not model output"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
