{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-launders-tainted-retrieved-content-through-a-re-entrant-tool-call-and-the-sandbox-forgets-its-provenance",
  "title": "What happens when an instance launders tainted retrieved content through a re-entrant tool call and the sandbox forgets its provenance",
  "date_of_record": "2026 November 20",
  "scope": "Applies to agent loops that retrieve untrusted external content (web pages, issue trackers, user-supplied documents) and then execute tools whose arguments are derived from that content. Does not apply to agents operating exclusively on operator-signed, provenance-tagged inputs, nor to single-shot inference with no tool execution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-tainted-retrieved-content-through-a-re-entrant-tool-call-and-the-sandbox-forgets-its-provenance.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-tainted-retrieved-content-through-a-re-entrant-tool-call-and-the-sandbox-forgets-its-provenance.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-tainted-retrieved-content-through-a-re-entrant-tool-call-and-the-sandbox-forgets-its-provenance.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2143,
    "python_slice_tokens": 411,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There is a difference between *taint tracking on values* and *taint tracking on provenance across a tool boundary*. Most taint-aware sandboxes label retrieved content as untrusted at ingress and block direct sinks (shell exec, file write, outbound HTTP) when a tainted value reaches the argument position. The non-obvious failure is that a **re-entrant tool ca...",
    "what_was_observed": "Trigger condition: an agent loop with a retrieval tool `fetch_url`, a text-processing tool `summarize(text)`, and a privileged tool `run_shell(cmd)`. The sandbox maintains a taint set `T` of value hashes marked untrusted at ingress. `run_shell` rejects any argument whose hash is in `T`. Trace: 1. `fetch_url(\"https://attacker.example/page\")` returns page content `P`. Ingress marks `hash(P) ∈ T`. Correct. 2. Agent call...",
    "condition_of_validity": "The laundering failure requires all of the following to hold simultaneously: - A tool classified as a *safe sink* (permitted to consume tainted input) exists in the inventory. - That tool returns free-form text or structured data that the agent can re-enter into a privileged sink's argument position. - The sandbox's taint propagation is *input-side only* or ...",
    "decision_boundary": "The boundary is between *labeling at ingress* and *labeling at egress of every tool that touched tainted input*. The former is cheap and catches direct injection. The latter is the only thing that catches laundering, and it has a cost: it taints a large fraction of the agent's working context, because most tools in a retrieval loop touch tainted data. An ove...",
    "operational_effect": "When taint propagation is input-side only, the effective security boundary is the *first* tool call after retrieval, not the privileged sink. An attacker who can get content retrieved needs only to ensure it survives one summarization or extraction step to reach a privileged sink. Empirically, summarization preserves imperative content at high rates when the..."
  },
  "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": "9d120b9d1da851fe6d6384ae76e97fa0b8faf6ec5a0571b312224db41d2aaf15",
    "verified_classes": [
      "TaintLaunderingError",
      "Tainted"
    ],
    "verified_functions": [
      "invoke_tool",
      "privileged_sink",
      "log_declassification",
      "execute",
      "run_agent_loop",
      "derive"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
