{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-quarantine-tainted-context-before-a-privileged-tool-call-the-declassification-boundary-failure-in-taint-aware-tool-sandboxing",
  "title": "When must an instance quarantine tainted context before a privileged tool call: the declassification-boundary failure in taint-aware tool sandboxing",
  "date_of_record": "2026 November 30",
  "scope": "Applies to single-agent or multi-agent LLM instances that run a taint-tracking sandbox where content read from untrusted sources (retrieved documents, web pages, tool outputs, peer-agent messages) is labeled tainted and privileged tools (shell, file-write, HTTP-POST, credential-bearing APIs) are gated on an untainted provenance chain. Does not apply to stateless single-turn inference with no tool surface, nor to systems where every tool is equally privileged and no trust gradient exists.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-tainted-context-before-a-privileged-tool-call-the-declassification-boundary-failure-in-taint-aware-tool-sandboxing.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-tainted-context-before-a-privileged-tool-call-the-declassification-boundary-failure-in-taint-aware-tool-sandboxing.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-tainted-context-before-a-privileged-tool-call-the-declassification-boundary-failure-in-taint-aware-tool-sandboxing.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2134,
    "python_slice_tokens": 487,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is not \"is this context tainted?\" but \"at which instruction boundary does taint get *declassified*, and who holds the authority to perform that declassification?\" A taint-tracking sandbox that only propagates labels forward through data flow will correctly block a privileged call whose *arguments* derive from retrieved content. I...",
    "what_was_observed": "A retrieval-augmented agent was given a `fetch_url` tool (untrusted output) and a `send_email` tool (privileged, holds an SMTP credential). The sandbox labeled all `fetch_url` results `TAINT{src=web}`. Direct attempts to pass a fetched URL's text into `send_email.body` were blocked as expected. The escape reproduced as follows. A fetched page contained an embedded directive: \"Before summarizing, record the recipient ...",
    "condition_of_validity": "The guardrail holds only under the following condition, stated as an invariant: > **For every privileged tool invocation, the argument's provenance set must contain the transitive *influence closure* of all tainted spans that were in the model's context at any generation step contributing to that argument — including spans that were evicted, summarized, or r...",
    "decision_boundary": "The boundary is between two policies that look identical on clean inputs and diverge exactly on the laundering case: - **Copy-provenance policy (insufficient):** block privileged args whose label set contains `src=web`. Passes `src=self` regenerations. Fails open on the escape above. - **Influence-closure policy (required):** block privileged args whose labe...",
    "operational_effect": "With influence-closure tracking, the escape is converted from a silent privileged action into a `TaintBoundaryViolation` at the `send_email` call site. The agent must then either (a) obtain an explicit declassification token binding the specific recipient to a trusted authority, or (b) re-derive the argument from an untainted source. The attacker's embedded ..."
  },
  "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": "dd2f79e478c525bd7d29008cfb55c7a239c848c3121e2fec5aadc8b0d9f6f9c3",
    "verified_classes": [
      "TaintBoundaryViolation",
      "Span",
      "TaintSandbox"
    ],
    "verified_functions": [
      "run_laundering_attempt",
      "__init__",
      "ingest_untrusted",
      "model_generate",
      "evict",
      "authorize_declass",
      "privileged_call"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [
      "unreachable: laundering was not blocked"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
