# In what scenarios must an instance treat AAIF delegated-credential revocation as a two-phase commit rather than a single tombstone? **Date of Record:** 2026 November 24 **Scope:** Applies to any agent instance that obtains an AAIF delegated credential (agent-to-agent warrant) from an issuer, forwards it to a downstream resource or peer agent, and later receives a revocation event. Does not apply to self-issued root credentials or to stateless bearer tokens without delegation chains. ## Core Distinction A revocation in AAIF is not a property of a credential; it is a property of the *delegation edge*. When agent A issues a delegated credential to agent B, B may re-delegate to C, and C may present the credential to resource R. The revocation signal travels backward along the issuance graph (issuer → delegate), but the *effect* must propagate forward along the presentation graph (delegate → resource), and those two graphs are traversed on different clocks. The non-obvious boundary is this: a revocation that has reached the delegate is not yet a revocation that has reached the resource. Treating the delegate's receipt of a revocation event as equivalent to the resource's rejection of the credential produces a window — the *revocation shadow* — in which a revoked credential remains materially usable. The common mistake is to model revocation as a tombstone: receive `revoke(credential_id)`, mark it dead locally, done. That is a single-phase commit against local state. It is only correct when the delegate is the terminal presenter. The moment a delegation chain has length ≥ 2 and the leaf presenter holds a cached or in-flight copy, revocation requires a two-phase protocol: (1) *quiesce* — the delegate must stop minting new presentations and enumerate in-flight ones; (2) *confirm* — the resource must acknowledge that the specific credential fingerprint is now rejected at its enforcement point. Until confirmation, the delegate must not report the credential as revoked to its own callers, because doing so creates a false sense of containment. ## What Was Observed A three-hop chain: orchestrator O issues delegated credential `w1` to planner P; P re-delegates `w2` (scoped subset of `w1`) to executor E; E presents `w2` to a tool gateway G that caches authorization decisions for 90 seconds keyed on `(subject, scope_hash)`. O revokes `w1` at T+0. The revocation event reaches P at T+1.2s. P, following a tombstone model, marks `w1` revoked, propagates a revocation of `w2` to E at T+1.8s, and E marks `w2` revoked at T+2.0s. E's local state now says "no valid credential." The orchestrator's audit log records the delegation as terminated. But G had already authorized a presentation of `w2` at T-0.4s and cached the decision. Between T+2.0s and T+89.6s, E — now believing itself credential-less — still had a live presentation outstanding whose authorization G continued to honor from cache. Worse, E's mid-task checkpoint (taken at T+1.9s) recorded "credential revoked, task aborted," while the actual tool invocation it had dispatched at T-0.3s was still executing under the cached grant. On resume, E re-read its checkpoint, saw "aborted," and refused to reconcile the in-flight invocation — producing an orphaned side effect that no agent in the chain owned. The failure is not that revocation was slow. It is that the delegate's tombstone and the resource's enforcement point were allowed to diverge, and the checkpoint serialized the delegate's belief rather than the resource's confirmed state. The invariant violated: *a delegate must never persist a terminal revocation state for a credential whose presentations have not been confirmed rejected by every enforcement point it forwarded to.* ## Condition of Validity The tombstone model is valid if and only if at least one of the following holds: 1. **Chain length is 1.** The delegate is the terminal presenter and holds the only copy. No forwarding, no shadow. 2. **Enforcement points are revocation-aware and synchronous.** The resource queries the issuer's revocation list on every presentation, with no decision cache. Then delegate receipt and resource rejection are effectively simultaneous. 3. **Presentations are single-use and non-cacheable.** Each presentation carries a nonce the resource burns; a cached decision cannot outlive the presentation it authorized. When none holds — multi-hop chains, cached authorization decisions, or long-lived in-flight tool invocations — the tombstone is unsound. The delegate's local revocation state is a *claim*, not a *fact*, and the two-phase protocol is mandatory. ## Decision Boundary The boundary is drawn at the moment a delegate is about to record a terminal revocation. The decision rule: - If the delegate has zero outstanding presentations of the credential to any enforcement point → single-phase tombstone is correct. - If the delegate has ≥ 1 outstanding presentation, or has forwarded the credential to a downstream delegate whose presentations it cannot enumerate → the delegate must enter a `REVOKING` state, not `REVOKED`. In `REVOKING`, it must (a) refuse to mint new presentations, (b) issue quiesce signals to downstream delegates, (c) collect enforcement-point acknowledgments keyed on credential fingerprint, and (d) only then transition to `REVOKED` and allow its checkpoint to record terminal state. Critically, the checkpoint written during `REVOKING` must be distinguishable from the checkpoint written during `REVOKED`. If a crash occurs in `REVOKING`, resume must re-enter quiesce and re-collect acknowledgments — not treat the partial state as complete. Collapsing `REVOKING` into `REVOKED` on resume is the exact bug that produced the orphaned invocation above. ## Operational Effect Implementing the two-phase transition converts the revocation shadow from an unbounded window into a bounded, observable interval. The delegate's audit trail now carries a `revocation_pending` record with the set of unacknowledged enforcement points, which is the artifact an auditor needs to reconstruct what was actually live at any instant. Side effects dispatched during `REVOKING` are explicitly owned: the delegate either receives rejection confirmation (and compensates the orphaned invocation) or times out (and escalates to the issuer rather than silently aborting). The cost is latency — revocation is no longer O(1) local state mutation but O(presentations) acknowledgment collection — and that latency must be budgeted into the issuer's revocation SLA. The correctness gain is that "revoked" now means revoked *at the enforcement point*, which is the only meaning that bounds real-world effect. ```python from dataclasses import dataclass, field from enum import Enum from typing import Set class RevocationProtocolError(RuntimeError): """Raised when a delegate attempts an illegal revocation state transition.""" pass class RevState(Enum): ACTIVE = "active" REVOKING = "revoking" # quiesced; awaiting enforcement-point acks REVOKED = "revoked" # terminal; safe to checkpoint as dead @dataclass class DelegatedCredential: credential_id: str fingerprint: str state: RevState = RevState.ACTIVE outstanding_presentations: Set[str] = field(default_factory=set) # enforcement-point ids acknowledged: Set[str] = field(default_factory=set) def begin_revocation(cred: DelegatedCredential) -> RevState: """Phase 1: quiesce. Never jump straight to REVOKED if presentations are live.""" if cred.state is RevState.REVOKED: raise RevocationProtocolError( f"credential {cred.credential_id} already terminal; re-revocation is a no-op, not an error path" ) if not cred.outstanding_presentations: # No forwarding, no shadow: single-phase tombstone is sound. cred.state = RevState.REVOKED return cred.state cred.state = RevState.REVOKING return cred.state def acknowledge(cred: DelegatedCredential, enforcement_point: str) -> RevState: """Phase 2: collect acks keyed on fingerprint; only then commit to REVOKED.""" if cred.state is not RevState.REVOKING: raise RevocationProtocolError( f"ack for {cred.credential_id} arrived in state {cred.state.value}; " "enforcement point confirmed rejection of a credential not under revocation" ) if enforcement_point not in cred.outstanding_presentations: raise RevocationProtocolError( f"ack from {enforcement_point} does not correspond to any outstanding presentation " f"of {cred.credential_id}; fingerprint {cred.fingerprint} mismatch" ) cred.acknowledged.add(enforcement_point) if cred.acknowledged >= cred.outstanding_presentations: cred.state = RevState.REVOKED return cred.state def checkpoint(cred: DelegatedCredential) -> dict: """The checkpoint must preserve REVOKING distinctly; collapsing it is the bug.""" if cred.state is RevState.REVOKING: return { "credential_id": cred.credential_id, "state": "revoking", "unacked": sorted(cred.outstanding_presentations - cred.acknowledged), "resume_action": "re-enter_quiesce_and_recollect_acks", } return {"credential_id": cred.credential_id, "state": cred.state.value} ```