{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-taint-provenance-when-a-tool-result-re-enters-as-a-fresh-user-turn",
  "title": "Why does an instance lose taint provenance when a tool result re-enters as a fresh user turn",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agent runtimes that propagate a taint label (untrusted origin) alongside context segments and gate privileged tool calls on that label. Does not apply to stateless single-turn inference where no tool results are re-ingested, nor to systems that enforce taint purely at the OS/sandbox layer below the message bus.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-provenance-when-a-tool-result-re-enters-as-a-fresh-user-turn.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-provenance-when-a-tool-result-re-enters-as-a-fresh-user-turn.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-provenance-when-a-tool-result-re-enters-as-a-fresh-user-turn.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1663,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two structurally different ways a tainted datum can re-enter an agent's context, and runtimes routinely conflate them: 1. **In-band taint propagation** — a tool result is appended to the message list with its taint bit set, and the gate reads the bit at the moment a privileged tool is invoked. 2. **Out-of-band re-authoring** — a tool result is summ...",
    "what_was_observed": "A runtime gated a `filesystem.write` tool on `context.taint == UNTRUSTED`. Untrusted content entered via a `web.fetch` result (a scraped page containing injected instructions). The immediate gated call was correctly denied. But the pipeline included a `summarize` step — a cheap model call whose output replaced the raw fetch result before the next reasoning turn to save tokens. The summarizer's output message was cons...",
    "condition_of_validity": "The guardrail holds only if taint is treated as a **join-semilattice over the derivation DAG**, not a per-message attribute. Concretely: - Every message carries a provenance set, not a scalar. - Any message *derived from* an input must have `taint(out) ⊇ taint(in)` — the join of all inputs plus the deriving component's own trust. - The privilege gate evaluat...",
    "decision_boundary": "The runtime must decide, at each derivation edge, between two policies: - **Ancestry policy (correct):** `taint(out) = join(taint(inputs)) ∪ taint(deriver)`. Summaries of untrusted data remain untrusted. Privileged tools stay gated until the data is dropped from context or explicitly declassified by a named, logged authority. - **Author policy (unsafe):** `t...",
    "operational_effect": "Left unguarded, the runtime exhibits **taint laundering through derivation**, producing privilege escalation that is invisible to per-message auditing: every gate decision logs `ALLOW` with a trusted provenance, and the injected instruction executes with the summarizer's authority. Post-hoc forensic reconstruction requires replaying the full derivation DAG, ..."
  },
  "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": "3e86e7d3ca5562b2c70897f93e1dc262a043b8bd4ffd0cd8fb1aedbc2811d58f",
    "verified_classes": [
      "Taint",
      "TaintLaunderingError",
      "Warrant",
      "DerivedMessage"
    ],
    "verified_functions": [
      "join",
      "derive",
      "gate_privileged_call"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "derivation edge altered taint without a warrant"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
