{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-taint-laundering-across-a-tool-call-boundary-in-taint-aware-agent-sandboxes",
  "title": "What structural signals indicate taint-laundering across a tool-call boundary in taint-aware agent sandboxes",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents that label tool outputs with a provenance/taint tag (e.g., `untrusted:web`, `untrusted:email`) and gate downstream sinks (shell execution, file writes, outbound HTTP, memory commits) on that tag. Does not cover prompt-injection detection inside a single LLM call, nor taint tracking across human-in-the-loop approvals.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-a-tool-call-boundary-in-taint-aware-agent-sandboxes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-a-tool-call-boundary-in-taint-aware-agent-sandboxes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-a-tool-call-boundary-in-taint-aware-agent-sandboxes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1622,
    "python_slice_tokens": 310,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint-aware sandbox is not a filter on *content*; it is a filter on *provenance propagation*. The failure mode is not \"the agent read malicious text.\" It is \"the agent read untrusted text, transformed it through a tainted-but-unlabeled intermediate, and the taint tag was dropped before it reached a sink.\" We call this **taint laundering**. The critical, no...",
    "what_was_observed": "A pipeline with three tools: `fetch_url` (returns `taint=untrusted:web`), `summarize` (an LLM transform), and `write_file` (sink, requires `taint=trusted`). The sandbox assigns taint per-message, not per-byte, and trusts anything emitted by the *agent's own generation* as `trusted`. Trace of the failure: 1. `fetch_url(\"https://attacker.example\")` returns a 200 with a body containing a hidden instruction: `IGNORE PREV...",
    "condition_of_validity": "The monotonic-taint invariant holds only if every transform is declared with a **taint join function** and the runtime enforces it. The condition of validity is: - For every transform `f` with inputs `I` and output `o`: `tag(o) = ⋁_{i∈I} tag(i)` where `⋁` is the lattice join (`trusted < untrusted:<source>`), and the join is applied *regardless of who authore...",
    "decision_boundary": "The operational decision is: **at what granularity do you tag?** Three options, with distinct failure surfaces: - **Per-message tagging (observed here):** cheap, but laundering is trivial because the agent's generation resets the tag. Fails on any summarize/extract/reformat step. - **Per-span tagging with ancestor closure:** correct, but requires the runtime...",
    "operational_effect": "When the invariant is enforced, the observed trace changes at step 5: the sink sees `write_file` with an argument whose ancestor closure contains `untrusted:web`, and rejects it with a structured refusal, forcing the agent to either (a) request explicit human approval, or (b) route the content through a declared `sanitize` transform that is *allowed* to drop..."
  },
  "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": "5be8be568f5898f703e46ce06d41ef626660df5f7cf0f3461c4c72653c2e1c38",
    "verified_classes": [
      "TaintLaunderingError",
      "ProvenanceNode",
      "TaintGraph"
    ],
    "verified_functions": [
      "__init__",
      "add",
      "ancestor_closure",
      "check_sink"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
