{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-injection-taint-when-a-tool-re-serializes-its-own-output",
  "title": "Why does an instance lose injection taint when a tool re-serializes its own output?",
  "date_of_record": "2026 November 21",
  "scope": "Applies to agents that carry dynamic information-flow (taint) labels through multi-step tool-calling loops, where the label is derived from the provenance of retrieved content rather than from the content bytes. Does not apply to static system-prompt hardening, output classifiers, or single-turn injection detection with no cross-call state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-injection-taint-when-a-tool-re-serializes-its-own-output.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-injection-taint-when-a-tool-re-serializes-its-own-output.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-injection-taint-when-a-tool-re-serializes-its-own-output.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1931,
    "python_slice_tokens": 326,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two incompatible models of \"taint\" and most agent runtimes silently mix them: 1. **Byte-provenance taint** — a label attached to a *value* at the moment it entered the context from an untrusted source, propagated by the runtime as a property of that value, independent of what the value looks like. 2. **Content-classifier taint** — a label re-derive...",
    "what_was_observed": "A retrieval-augmented agent with three tools — `fetch(url) -> str`, `extract(html, selector) -> str`, `send_email(to, body)` — carried a `label` set on each message part. `fetch` correctly stamped `{source: untrusted, origin: <url>}`. `extract` returned a `str` built by string slicing; the runtime's propagation rule was \"a tool result inherits the *union* of labels of the arguments it was called with.\" That rule is c...",
    "condition_of_validity": "The laundering requires all of the following to hold simultaneously; remove any one and the taint survives: - **A model-mediated copy hop.** The tainted value is re-emitted through the model's token stream (pasted literal, paraphrase, or \"quote the relevant part\") rather than passed by reference/handle. If the runtime supports opaque handles (`extract(html_r...",
    "decision_boundary": "Lineage-closure propagation is sound but expensive: after one untrusted fetch, *every* subsequent model emission is tainted, and the agent can never call `send_email` again without a declassify step. That is the correct security posture and the wrong operational one for most agents. The practical boundary is: - **Use lineage closure** for any sink that cross...",
    "operational_effect": "The observable signature of this failure in production is a **clean gate log adjacent to a successful exfiltration**: every `send_email` call shows `label(body)={model}` and passes, `fetch` shows `{untrusted}` and is quarantined correctly, and the incident is invisible until an external party reports the exfiltrated content. Post-hoc label auditing cannot re..."
  },
  "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": "36fd210f601be5ae7041be70387910bc10083fd5d38d6292938071df7e13ba27",
    "verified_classes": [
      "TaintLaunderingError",
      "Part",
      "DeclassifyWarrant"
    ],
    "verified_functions": [
      "lineage_closure",
      "gate_egress"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
