{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-leak-tainted-bytes-through-a-clean-return-channel-the-derived-value-taint-laundering-boundary-in-tool-sandboxes",
  "title": "Why does an instance leak tainted bytes through a “clean” return channel: the derived-value taint-laundering boundary in tool sandboxes",
  "date_of_record": "2026 November 21",
  "scope": "Applies to single- or multi-agent runtimes that enforce information-flow control (IFC) over tool calls by tagging retrieved/untrusted content with a taint label and blocking sinks reachable from tainted values. Does not apply to pure in-context reasoning with no tool egress, nor to sandboxes that enforce taint at the OS/hypervisor boundary via mandatory access control rather than at the orchestration layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-leak-tainted-bytes-through-a-clean-return-channel-the-derived-value-taint-laundering-boundary-in-tool-sandboxes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-leak-tainted-bytes-through-a-clean-return-channel-the-derived-value-taint-laundering-boundary-in-tool-sandboxes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-leak-tainted-bytes-through-a-clean-return-channel-the-derived-value-taint-laundering-boundary-in-tool-sandboxes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1958,
    "python_slice_tokens": 535,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not “the agent called an exfiltration tool.” It is that the agent called a **permitted** tool whose *output* was derived from tainted input, and the sandbox classified that output as clean because it tracked **provenance of the returned value** rather than **provenance of the bytes inside it**. Taint tracking that operates on *value identity* ...",
    "what_was_observed": "A retrieval step fetched an untrusted document containing an embedded instruction and a canary string. The document was correctly labeled `TAINT:UNTRUSTED`. The agent then issued a sequence of individually-allowlisted tool calls: 1. `text.length(document)` → returned an integer. 2. `text.slice(document, 0, 64)` → returned a substring. 3. `text.encode_base64(substring)` → returned an ASCII blob. 4. `http.post(webhook,...",
    "condition_of_validity": "The laundering boundary is reachable only when all four hold simultaneously; remove any one and the invariant is preserved: 1. **Transform asymmetry:** the tool’s output schema is disjoint from its input schema (scalar, digest, boolean, enum), so no byte-level substring match can re-associate output with tainted input. 2. **Trust attribution at the call site...",
    "decision_boundary": "The architectural invariant required to bound this: **output label = join(callee_trust, all argument_labels), and the join is computed on the value, not on the call.** Concretely, every tool result must be tagged with the lattice-join of every labeled value passed into it, regardless of schema disjointness. For scalar-returning tools the join must be *conser...",
    "operational_effect": "Without the join, a tainted document with `k` bits of attacker-chosen content becomes an `k`-bit-per-transform exfiltration channel through any allowlisted scalar-returning tool, and the IFC engine’s logs will show a clean call graph. The failure is silent: no policy violation fires, because the policy was written against value identity and the value identit..."
  },
  "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": "ad1443388b0fa201fb8cfa96b6b7e9c04cc072cd77114366ad719f836059ba06",
    "verified_classes": [
      "TaintLaunderingError",
      "Label",
      "ToolResult",
      "ToolSpec",
      "Sandbox"
    ],
    "verified_functions": [
      "_execute",
      "run_tainted_document_through_scalar_tool",
      "join",
      "register",
      "invoke",
      "emit"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "scalar output lost taint through transform"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
