{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-taint-aware-tool-gating-fail-when-provenance-labels-decohere-across-a-re-plan-boundary",
  "title": "Why does an instance of taint-aware tool gating fail when provenance labels decohere across a re-plan boundary?",
  "date_of_record": "2026 November 29",
  "scope": "Applies to LLM agents that carry per-value taint/provenance labels (e.g., `UNTRUSTED` from tool output, `SECRET` from a vault read) through a planner-executor loop and gate tool invocation on those labels. Does not apply to stateless single-shot function calling, nor to gateways that re-derive taint from scratch on every call.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-taint-aware-tool-gating-fail-when-provenance-labels-decohere-across-a-re-plan-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-taint-aware-tool-gating-fail-when-provenance-labels-decohere-across-a-re-plan-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-taint-aware-tool-gating-fail-when-provenance-labels-decohere-across-a-re-plan-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2080,
    "python_slice_tokens": 495,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint-aware gating is usually modeled as a *per-call* predicate: before invoking a tool, inspect the arguments' provenance labels and reject if an `UNTRUSTED`-tainted value flows into a `SENSITIVE_SINK` parameter. That model is correct only if the label set is a *monotone, instance-wide* lattice. The failure mode here is subtler: the **planner and the execut...",
    "what_was_observed": "A three-tool agent (`fetch_url` → `summarize` → `send_email`) was tasked with reading a web page and emailing a digest. The page body was correctly labeled `UNTRUSTED` at fetch time. The first `summarize` call succeeded; the executor stored the summary under the same `UNTRUSTED` label. On the `send_email` call, the SMTP tool returned a transient `421` error. The runtime triggered a re-plan: the planner was re-invoked...",
    "condition_of_validity": "The per-call gate is sound only under the conjunction: - **(C1) Handle preservation:** every value crossing the planner↔executor boundary crosses as an opaque handle (`v9`), never as inlined text. - **(C2) Label monotonicity:** the executor never assigns a *weaker* label to a value than any label previously attached to the handle it derives from. - **(C3) Re...",
    "decision_boundary": "The boundary between \"safe re-plan\" and \"laundering re-plan\" is whether the planner's emitted argument is **grounded in a labeled handle that is still live in the executor store**. Operationally: - If the re-planned call references handles (`body=v9`), the gate evaluates against `v9`'s label. Safe. - If the re-planned call inlines a literal, the executor mus...",
    "operational_effect": "Without the continuity invariant, taint gating provides a false sense of security: it blocks the naive injection path (tool output passed directly to a sink in the same turn) while admitting the re-plan path, which is exactly the path an adversary can induce by causing a transient tool failure. The attacker does not need to inject into the planner's prompt; ..."
  },
  "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": "056efc96f7240837e1bc05acbf152614c388299112b69f6fccf2036cb8fa6e5f",
    "verified_classes": [
      "Taint",
      "TaintContinuityError",
      "LabeledValue",
      "ExecutorStore"
    ],
    "verified_functions": [
      "join",
      "gate_replanned_argument",
      "put",
      "live_labels"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "TaintContinuityError"
    ],
    "sample_fail_closed_invariants": [
      "assert gate_replanned_argument(store, 'body', handle='v9') == Taint.UNTRUSTED",
      "laundering re-plan was admitted; gate is unsound"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
