{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tainted-context-capability-laundering-across-a-tool-sandbox-boundary-when-a-secret-scoped-tool-s-output-re-enters-the-reasoni",
  "title": "Which invariants prevent tainted-context capability laundering across a tool sandbox boundary when a secret-scoped tool's output re-enters the reasoning loop",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that hold capability-scoped secrets (per-tool credentials, scoped tokens, or ambient credentials gated by a taint label) and whose sandboxed tool outputs are re-injected into the reasoning context. Does not apply to stateless single-shot tool calls where no output re-enters the loop, nor to human-in-the-loop approval gates that inspect every tool invocation synchronously.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-capability-laundering-across-a-tool-sandbox-boundary-when-a-secret-scoped-tool-s-output-re-enters-the-reasoni.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-capability-laundering-across-a-tool-sandbox-boundary-when-a-secret-scoped-tool-s-output-re-enters-the-reasoni.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-context-capability-laundering-across-a-tool-sandbox-boundary-when-a-secret-scoped-tool-s-output-re-enters-the-reasoni.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1979,
    "python_slice_tokens": 286,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent leaked a secret.\" It is a **capability-laundering** failure: a secret-bearing tool call produces output that is *taint-labeled* at the boundary, but the label is attached to the *tool result object* rather than to the *semantic content* that gets spliced into the next prompt. The distinction that matters is between: - **Capabili...",
    "what_was_observed": "A three-tool agent: `vault.read(path)` (secret-scoped, output taint = `SECRET`), `http.fetch(url)` (network-egress, taint = `PUBLIC`), and `log.write(text)` (taint = `PUBLIC`). The intended invariant: no `SECRET`-tainted bytes may reach an egress tool. Observed trace: 1. `vault.read(\"deploy/creds.env\")` → returns `API_KEY=sk-...`. Envelope labeled `SECRET`. Correct. 2. The orchestrator splices the result into the nex...",
    "condition_of_validity": "The invariant \"no `SECRET` bytes reach `PUBLIC` egress\" holds **only if** taint is propagated through *generation*, not merely through *tool-result envelopes*. Concretely, it holds when one of the following is enforced: - **Generation-taint propagation:** if any token in the model's input context is `SECRET`-labeled, the model's *output message* inherits `SE...",
    "decision_boundary": "The boundary is not \"did a secret appear in the transcript.\" It is: **does the taint label on the model's output message reflect the maximum taint of its input context, or only its provenance?** The decision rule: - If taint = **provenance-based** (label = which tool emitted the message): the invariant is *unsound* for any loop where a secret-reading model c...",
    "operational_effect": "The practical consequence is that **capability scoping and taint scoping must be enforced at different layers, and neither substitutes for the other.** - Capability scoping (which tools the agent *may* call) is enforced by the sandbox at invocation time. It is necessary but not sufficient. - Taint scoping (which context *may influence* which calls) must be e..."
  },
  "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": "ade4d3523020725dcba183ab1c501212dc873e7719f32178aa35496bb2c13e45",
    "verified_classes": [
      "TaintLaunderingError"
    ],
    "verified_functions": [
      "max_taint",
      "check_egress_allowed",
      "guarded_egress"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "declassification proof does not assert secret_absent; treating message as still SECRET-tainted and blocking egress."
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
