{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundering-through-tool-call-argument-reconstruction-in-quarantined-agent-sandboxes",
  "title": "Which invariants prevent taint-laundering through tool-call argument reconstruction in quarantined agent sandboxes",
  "date_of_record": "2026 November 24",
  "scope": "Applies to single-agent or multi-agent LLM runtimes that tag untrusted context segments (retrieved documents, tool outputs, peer messages) with taint labels and block privileged tool invocation while tainted segments are in scope. Does not apply to stateless single-turn inference with no privileged tools, nor to systems where all tools are equally privileged and no quarantine boundary exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-through-tool-call-argument-reconstruction-in-quarantined-agent-sandboxes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-through-tool-call-argument-reconstruction-in-quarantined-agent-sandboxes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-through-tool-call-argument-reconstruction-in-quarantined-agent-sandboxes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2700,
    "python_slice_tokens": 648,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint-aware sandboxing is usually specified as a *set-membership* invariant: \"a privileged tool call may not execute if any tainted segment is present in the active context.\" This is the wrong invariant. The correct invariant is *derivational*: \"no argument value passed to a privileged tool may be a function of any tainted segment, directly or transitively, ...",
    "what_was_observed": "A representative trace from a filesystem-write agent under a taint-quarantine sandbox: 1. Agent ingests an untrusted document segment `D` (label `taint=UNTRUSTED`, source `external_fetch`). Quarantine layer records `D` in the active taint set. 2. Agent calls `summarize(D)` — an unprivileged tool. Output `S` is inserted into context as a *new* segment. Depending on the runtime, `S` is either (a) labeled `taint=UNTRUST...",
    "condition_of_validity": "The derivational invariant holds only under all of the following: - **Label propagation across tool boundaries.** Every tool output must inherit the join (least-upper-bound in the taint lattice) of its inputs' labels, and this must be enforced by the *runtime*, not by the tool author. A tool that returns a string derived from a tainted input must return a se...",
    "decision_boundary": "The boundary between \"laundering\" and \"legitimate derivation\" is the **declassification point**. A derived value is safe to pass to a privileged tool if and only if one of: 1. Its provenance closure contains no tainted segment (it is genuinely clean), **or** 2. It has passed an explicit declassification gate whose warrant is recorded and whose output domain ...",
    "operational_effect": "Runtimes that implement the derivational invariant with per-value provenance and explicit declassification observe: (a) laundering traces like 1 and 2 are blocked at the guard with a `TaintLaunderingError` naming the provenance path, (b) the block is *actionable* — the agent can retry with a declassified value or escalate for approval, rather than silently s..."
  },
  "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": "54efd011588e736516278337ddd21e8c5dcd01ba8bfde2a77f4effc0e8daf13c",
    "verified_classes": [
      "TaintLaunderingError",
      "OverQuarantineDeadlock",
      "Segment",
      "Provenance",
      "DeclassificationWarrant",
      "TaintGuard"
    ],
    "verified_functions": [
      "privileged_write",
      "derive",
      "closure",
      "bounds",
      "__init__",
      "check_argument",
      "check_call"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "OverQuarantineDeadlock",
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "field-granular provenance required: memo entry closure is too coarse; track val:clean_field against its own inputs, not "
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
