{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tainted-tool-revocation-from-silently-un-tainting-downstream-agent-state",
  "title": "Which invariants prevent tainted-tool revocation from silently un-tainting downstream agent state",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agent runtimes that propagate information-flow taint labels across tool calls and revoke tool capabilities at runtime in response to taint escalation. Does not apply to static capability manifests fixed at session start, nor to single-shot LLM calls with no persistent state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-tool-revocation-from-silently-un-tainting-downstream-agent-state.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-tool-revocation-from-silently-un-tainting-downstream-agent-state.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-tool-revocation-from-silently-un-tainting-downstream-agent-state.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1933,
    "python_slice_tokens": 287,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an agent runtime can revoke when taint escalates: a *capability* (the right to invoke a tool) and a *label* (the fact that data derived from a tainted source is tainted). Most sandboxes conflate these. Revoking a capability removes the tool from the agent's callable set, but it does not retroactively alter the taint labels alre...",
    "what_was_observed": "Consider an agent with two tools: `fetch_url` (egress-capable, taint source for untrusted content) and `write_file` (sink, taint-sensitive). A prompt-injection payload arrives via `fetch_url` and lands in the agent's scratchpad as a tool-result message with taint label `UNTRUSTED:web`. The runtime's policy engine detects the taint and revokes `fetch_url` for the remainder of the task—a correct response to egress esca...",
    "condition_of_validity": "The invariant above holds only under three conditions, and it is precisely their violation that produces the failure: - **Monotonic labeling across derivation.** Every value derived from a tainted value must inherit the label. This requires the taint checker to run on *every* value-introduction path—tool results, cache hits, memory retrievals, distilled summ...",
    "decision_boundary": "The runtime must decide, at revocation time, between two strategies, and the choice is not free: - **Invalidate-and-replay:** Drop all values whose provenance includes the revoked capability, then require the agent to re-derive them (or halt). This is sound but expensive: it can discard most of the context window and force a cold re-derivation, and it may be...",
    "operational_effect": "The operational consequence is that revocation must be modeled as a *graph rewrite over the provenance DAG*, not a row update in a capability table. Concretely, the runtime must: 1. Record, for every value entering the agent's state, a provenance record: `(value_id, source_tool, source_args_hash, parent_value_ids, taint_labels, timestamp)`. 2. On revocation,..."
  },
  "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": "62e1128438e76b57f97fb4a44c92470487c4077bf82bbb7d93b84ba83ca4a26d",
    "verified_classes": [
      "TaintRevocationViolation",
      "Provenance",
      "Runtime"
    ],
    "verified_functions": [
      "revoke",
      "cached_lookup",
      "check_sink"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintRevocationViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
