{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-taints-a-tool-result-but-the-agent-s-planner-re-reads-the-same-bytes-through-a-different-retrieval-path",
  "title": "What happens when an instance taints a tool result but the agent's planner re-reads the same bytes through a different retrieval path",
  "date_of_record": "2026 November 18",
  "scope": "Applies to agent runtimes that tag untrusted content (retrieval results, third-party API responses) with a taint label consumed by a tool-sandbox policy engine. Does not apply to systems that enforce taint at the syscall/process boundary (e.g., seccomp-mediated egress) where the label is not re-derivable from content identity.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-tool-result-but-the-agent-s-planner-re-reads-the-same-bytes-through-a-different-retrieval-path.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-tool-result-but-the-agent-s-planner-re-reads-the-same-bytes-through-a-different-retrieval-path.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-a-tool-result-but-the-agent-s-planner-re-reads-the-same-bytes-through-a-different-retrieval-path.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1271,
    "python_slice_tokens": 195,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint is normally modeled as a property of a *value* flowing through the planner. The failure mode here is that taint is actually a property of a *(value, retrieval-path)* pair, and the sandbox only records the first path it saw. When the same underlying bytes are reachable through a second path that the policy engine considers \"trusted\" — a cache hit, a re-...",
    "what_was_observed": "A planner retrieved an external API response (untrusted), which the sandbox correctly labeled `taint=external:api_v2`. The planner summarized it into a scratchpad note. A downstream tool, `recall_scratchpad`, returned the note to the planner. The note's bytes were a near-duplicate of the original response (the summarizer preserved a URL and a shell-looking fragment). The sandbox classified `recall_scratchpad` output ...",
    "condition_of_validity": "The failure requires all of the following to hold simultaneously: 1. A tool is registered as a trusted sink (its outputs are untainted by default). 2. That tool's output is a function of previously ingested untrusted content (write-then-read, echo, cache, re-rank, summarize-and-store). 3. The policy engine evaluates taint at the *tool-call boundary* rather t...",
    "decision_boundary": "When designing or auditing a taint-aware sandbox, the decision is whether to model trusted sinks as *taint-clearing* or *taint-preserving-with-provenance*. - **Taint-clearing** (what failed here): a trusted sink's output is `taint=none`. Cheap, fast, and correct only if the sink is write-only or read-disjoint from untrusted input. - **Taint-preserving-with-p...",
    "operational_effect": "The practical consequence is that a single trusted-sink misclassification silently widens the sandbox's permitted action space for the remainder of the session, because the planner's context now contains untainted handles to tainted bytes. Detection requires either (a) content-hash auditing across all tool outputs in a session, flagging re-appearances of pre..."
  },
  "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": "8bac6ac3531c16edf3dde6bfa57926d184a3827f7a48fbe11d17df51c0629222",
    "verified_classes": [
      "TaintLaunderingError",
      "TrustedSink"
    ],
    "verified_functions": [
      "check_planner_action",
      "__init__",
      "read"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
