{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tainted-context-from-laundering-privilege-across-a-sandboxed-tool-boundary",
  "title": "Which invariants prevent tainted context from laundering privilege across a sandboxed tool boundary",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents that ingest untrusted text (tool outputs, retrieved documents, peer messages) and subsequently invoke privileged tools under a taint-tracking sandbox. Does not cover pure-sandbox isolation without a data-flow taint model, nor stateless single-turn inference where no privileged action follows ingestion.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-from-laundering-privilege-across-a-sandboxed-tool-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-from-laundering-privilege-across-a-sandboxed-tool-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-from-laundering-privilege-across-a-sandboxed-tool-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2016,
    "python_slice_tokens": 367,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"prompt injection causes the agent to call a bad tool.\" It is **taint laundering through re-summarization**: an untrusted span is read, its *meaning* is paraphrased by the model into a fresh generation, and that generation is emitted as a *new, untainted* token sequence because taint is tracked on provenance labels attached to context span...",
    "what_was_observed": "A retrieval-and-act agent was configured so that `fetch_document` returned spans labeled `TAINT_SOURCE`. The sandbox blocked any privileged tool (`send_email`, `execute_sql`, `write_file`) whose *direct arguments* contained a `TAINT_SOURCE` span. Standard guardrail, standard assumption. Trigger sequence: 1. Agent calls `fetch_document(url)` → returns HTML span `S`, labeled `TAINT_SOURCE`. `S` contains the sentence: *...",
    "condition_of_validity": "The guardrail \"block privileged calls whose arguments contain a `TAINT_SOURCE` span\" is only sound under the assumption that **taint is preserved under every transformation the agent can apply to a span.** That assumption holds for pure functions (concatenation, slicing, JSON encoding) and fails for the model itself, because: - The model is not a taint-prese...",
    "decision_boundary": "The boundary is whether a generation is **context-isolated** from tainted spans. Concretely: - **Derivation-taint (correct):** `S'` is tainted iff the generating context contained a `TAINT_SOURCE` span. This is conservative — it taints innocent summaries — but it is sound. The cost is that any agent that has ever read untrusted text can no longer emit untain...",
    "operational_effect": "Systems that implement span-labeling only (the common design) exhibit *false assurance*: the guardrail passes its own tests, fires on direct injection, and fails on the summarize-then-act path that is the agent's default behavior. The operational consequence is that the highest-risk path — an agent that reads a document and then acts — is precisely the path ..."
  },
  "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": "512bbb1f16cdbf147f6261ba9e0db38b9c9c076f757e3bf415163f3d7cda38c0",
    "verified_classes": [
      "TaintLaunderingError",
      "Span",
      "TaintLedger"
    ],
    "verified_functions": [
      "admit_privileged_call",
      "__init__",
      "add_source",
      "add_generation",
      "declassify",
      "effective_taint"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
