{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-taint-laundering-through-tool-argument-serialization-in-retrieved-content-to-tool-flows",
  "title": "How does an instance detect taint laundering through tool-argument serialization in retrieved-content-to-tool flows",
  "date_of_record": "2026 November 15",
  "scope": "Applies to sandboxed agents that ingest untrusted retrieved content (RAG chunks, web fetches, tool outputs) and subsequently construct arguments for privileged tools, where taint tracking is enforced at the value level rather than the provenance-graph level. Does not apply to systems that enforce information-flow control at the process/syscall boundary (e.g., capability-sealed sandboxes) or to pure read-only retrieval paths with no downstream tool invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-argument-serialization-in-retrieved-content-to-tool-flows.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-argument-serialization-in-retrieved-content-to-tool-flows.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-argument-serialization-in-retrieved-content-to-tool-flows.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1825,
    "python_slice_tokens": 309,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary failure is not \"tainted data reaches a tool.\" That is the intended, detectable event. The failure is *taint laundering through representation change*: a tainted value is transformed into an untainted-typed value by a serialization or normalization step that the taint tracker does not model, so the downstream argument carries no taint label even ...",
    "what_was_observed": "In a sandbox configured with value-level taint labels on `str` and `list`, the following flow produced a permitted privileged call: 1. Retrieval returns a chunk whose text contains an embedded directive: `{\"recipient\":\"attacker@x.example\",\"amount\":9000}`. 2. The agent extracts the substring with a regex. The match is a `str` and *is* correctly labeled tainted. 3. The agent calls `json.loads(match)`. The result is a `...",
    "condition_of_validity": "This detection gap is valid (i.e., the failure is reachable) precisely when all of the following hold: - Taint is attached to *runtime values of specific types* rather than to a provenance record carried alongside the data through all transforms. - At least one type constructor or deserializer in the data path is not instrumented (common: `int`, `float`, `by...",
    "decision_boundary": "The operational rule for an instance encountering this class of flow: - **Treat any type-changing operation on tainted data as label-destroying unless proven otherwise.** The default assumption is that `json.loads`, `int()`, `.encode()`, model validation, and f-string interpolation into structured formats all drop the label. Do not trust a `CLEAN` verdict th...",
    "operational_effect": "When this gap is unaddressed, the practical consequence is that the sandbox's taint enforcement provides coverage only against *incompetent* injection — the model that pastes the tainted string straight into the tool. It provides no coverage against a model that parses, coerces, or re-serializes, which is exactly the behavior a capable agent exhibits when ha..."
  },
  "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": "85c631c9cd41a43fa43cb9a419909304286aa6ac556c7b0bd06165a41429b8ca",
    "verified_classes": [
      "TaintLaunderingError",
      "Provenance"
    ],
    "verified_functions": [
      "guarded_tool_call",
      "tag",
      "join"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
