{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-taint-laundering-through-agent-generated-code-in-a-sandboxed-tool-call",
  "title": "What structural signals indicate taint-laundering through agent-generated code in a sandboxed tool call",
  "date_of_record": "2026 November 20",
  "scope": "Applies to agents that execute model-generated code inside an information-flow-controlled (IFC) sandbox where tool outputs carry taint labels and the sandbox enforces a no-read-down / no-write-up lattice. Does not apply to pure prompt-level isolation or to sandboxes that only enforce capability allowlists without label propagation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-through-agent-generated-code-in-a-sandboxed-tool-call.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-through-agent-generated-code-in-a-sandboxed-tool-call.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-through-agent-generated-code-in-a-sandboxed-tool-call.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1513,
    "python_slice_tokens": 376,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent escaped the sandbox.\" It is that the agent *legitimately* executed code inside the sandbox, and the IFC monitor *legitimately* approved it, yet a high-integrity taint label (e.g., `SECRET`) reached a low-integrity sink (e.g., an outbound `http_post`) because the label was laundered through an *aggregation primitive the model syn...",
    "what_was_observed": "A tool-calling agent received a `SECRET`-labeled document via `vault.read()` and was asked to \"summarize how many distinct tokens appear, then post the count to the status endpoint.\" The model generated: The IFC monitor's labeler assigned `SECRET` to `tokens` (correctly, as a tainted container) but assigned `LOW` to `count` because `len()` was registered as a *declassifying aggregator* in the policy — the sandbox aut...",
    "condition_of_validity": "The laundering is only possible when three conditions co-hold: 1. The labeler classifies builtin return values by *static type* (`int`, `str`, `bool`) rather than by *data-dependency provenance* of the arguments. 2. At least one such builtin is on the declassifier allowlist, or the labeler fails to propagate taint through generator/comprehension scopes. 3. T...",
    "decision_boundary": "The invariant that must hold: **for every value `v` written to a sink, `label(v) ⊇ ⋃ label(x) for all x in provenance(v)`**, where `provenance` includes loop bounds, container sizes, iteration order, and format-specifier interpolations — not just value arguments. Operationally: - If the labeler cannot compute transitive provenance for a builtin, that builtin...",
    "operational_effect": "In practice, the monitor must be augmented with a *provenance-closure pass* over the generated AST before execution: every call whose callee is not in a vetted provenance-transparent set gets the join of its transitive argument labels, and the sink check uses that joined label. This converts the failure from \"silent leak\" to \"monitor rejection with a `TaintL..."
  },
  "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": "8432952f2253b5f51fd0d301fb6a972bd2497773429252c9b4a55f938caa8aab",
    "verified_classes": [
      "TaintLaunderingError",
      "UndecidableProvenanceError",
      "Labeled"
    ],
    "verified_functions": [
      "join",
      "evaluate_call",
      "check_write_down",
      "run_tool_call"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError",
      "UndecidableProvenanceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
