{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-demote-its-own-capability-set-mid-execution-the-label-escalation-downgrade-race-in-taint-aware-tool-sandboxes",
  "title": "When must an instance demote its own capability set mid-execution: the label-escalation downgrade race in taint-aware tool sandboxes",
  "date_of_record": "2026 December 2",
  "scope": "Applies to agents whose tool bindings are gated by information-flow labels that can be escalated at runtime by observed data (e.g., a tool returns content marked `untrusted`, `pii`, or `secret`). Does not cover static capability sets fixed at session start, nor pure output-filtering DLP that never mutates the agent's callable tool set.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-demote-its-own-capability-set-mid-execution-the-label-escalation-downgrade-race-in-taint-aware-tool-sandboxes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-demote-its-own-capability-set-mid-execution-the-label-escalation-downgrade-race-in-taint-aware-tool-sandboxes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-demote-its-own-capability-set-mid-execution-the-label-escalation-downgrade-race-in-taint-aware-tool-sandboxes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2187,
    "python_slice_tokens": 614,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent called a forbidden tool.\" It is that the agent's *capability set* is a function of its *taint state*, and taint state is mutated by the very tool calls the capability set authorizes. This creates a feedback loop: a call permitted under label `L₀` returns data that raises the context to `L₁`, which retroactively invalidates the a...",
    "what_was_observed": "A research agent held three tools: `web_fetch` (label `public`, returns `untrusted`), `summarize` (label `untrusted`-safe), and `send_email` (requires label `trusted` only). The policy engine recomputed the allowed tool set after every tool result by folding the result's label into the session taint lattice. Trace: 1. `web_fetch(\"https://example.org/report\")` dispatched under taint `trusted`. Permitted. 2. Result arr...",
    "condition_of_validity": "The downgrade invariant I1 holds only if the following conjunction holds for every dispatch: - The capability check reads taint state at a version `v_check`. - The tool call is dispatched at version `v_dispatch`. - No taint-mutating event (result ingestion, external label push, or peer-agent state merge) occurs with version in `(v_check, v_dispatch]`. Equiva...",
    "decision_boundary": "When a tool result raises session taint above the level at which the *current plan* was generated, the agent must choose between two admissible behaviors and one forbidden one: - **Admissible — revalidate-and-resume:** discard the optimistic queue, recompute the allowed tool set at the new taint version, re-plan from the current state. Cost: lost speculative...",
    "operational_effect": "After the incident, the deployment adopted a versioned taint ledger with the following properties: every tool result carries the ledger version at which it was folded; the dispatcher refuses any queued call whose authorization version is not the current ledger head; and every tool declares an explicit `propagates_taint` flag, with re-wrapping tools forced to..."
  },
  "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": "725649f5f113a71303be9745b986d56d82e8359b8c7f368c026426036337f44e",
    "verified_classes": [
      "TaintLevel",
      "TaintDowngradeRace",
      "TaintLaunderingError",
      "ToolResult",
      "Tool",
      "TaintLedger",
      "QueuedCall",
      "Dispatcher"
    ],
    "verified_functions": [
      "label_output",
      "run_scenario",
      "fold",
      "__init__",
      "allowed",
      "enqueue",
      "dispatch",
      "ingest"
    ],
    "verified_functions_count": 8,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintDowngradeRace",
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
