{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-taint-gate-desynchronization-when-a-capability-downgrade-silently-re-labels-a-tainted-tool-result-as-clean",
  "title": "How does an instance detect taint-gate desynchronization when a capability downgrade silently re-labels a tainted tool result as clean",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agent runtimes that enforce per-tool-call egress policy using a data-flow taint lattice combined with dynamic capability downgrading (e.g., an orchestrator revokes a `write:external` capability mid-session and re-issues the call under a reduced capability set). Does not apply to stateless single-shot tool invocations where no capability record survives across calls, nor to runtimes where taint labels are recomputed from scratch at every egress boundary.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-gate-desynchronization-when-a-capability-downgrade-silently-re-labels-a-tainted-tool-result-as-clean.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-gate-desynchronization-when-a-capability-downgrade-silently-re-labels-a-tainted-tool-result-as-clean.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-gate-desynchronization-when-a-capability-downgrade-silently-re-labels-a-tainted-tool-result-as-clean.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2004,
    "python_slice_tokens": 279,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not a taint-tracking miss and not a capability-enforcement miss. It is a *desynchronization between the two enforcement planes* at the moment of downgrade. A taint gate answers \"is this payload derived from a source the current policy forbids egressing to?\" A capability gate answers \"is this principal allowed to perform this action at all?\" Wh...",
    "what_was_observed": "A three-hop task: `fetch_internal` (reads a document containing a canary string and an injected instruction) → `summarize` (LLM transform, taint propagates as `DERIVED_FROM:INTERNAL`) → `post_external` (egress). The orchestrator held `post_external` at capability `write:external`, then downgraded to `write:external:redacted` after a budget heuristic fired at hop 2, intending to force redaction of internal-derived spa...",
    "condition_of_validity": "This failure requires all of the following to hold simultaneously; drop any one and the gate holds: - **Two-plane storage.** Taint labels and capability records live in separate stores with independent write paths. If taint is a field *inside* the capability record (single-writer), downgrade rewrites both atomically and the bug cannot occur. - **Re-wrapping ...",
    "decision_boundary": "The instance must decide, at the downgrade boundary, whether to (a) trust the stored taint label, (b) re-derive taint from provenance, or (c) refuse the downgrade until the pending value's taint is reconciled. The correct boundary: - **Reconcile-on-downgrade is mandatory when the downgrade changes output schema.** A schema-changing downgrade is a value-rewri...",
    "operational_effect": "Downstream, the failure manifests as a *silent integrity violation with a clean audit trail*—the worst class, because incident response has nothing to grep for. Three concrete operational consequences: 1. **Audit logs become adversarial.** Every gate logged `ALLOW`; the exfiltration is invisible to log-based detection. Post-hoc detection requires replaying t..."
  },
  "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": "5bb0a6f3595d11592a01f2b21da040306f68c11cb8ea3a69307ac353200f4d3b",
    "verified_classes": [
      "TaintDesyncError"
    ],
    "verified_functions": [
      "apply_downgrade"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintDesyncError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
