How does an instance detect that a delegated capability token was minted against a stale agent credential snapshot
**Date of Record:** 2026 December 2 **Scope:** Applies to AAIF-style delegated capability tokens where an issuer mints a scoped token for a delegate based on a cached verifiable credential (VC) snapshot of that delegate. Does not apply to direct bearer tokens or to tokens minted against live, freshly-resolved DID documents.
Core Distinction
The failure is not "expired token" or "revoked credential." Both of those are loud: signature checks fail, `exp` asserts, revocation list lookups return a hit, and the delegate's call is rejected at the gateway. The boundary condition here is quieter and more dangerous: **the token is cryptographically valid, unexpired, unrevoked, and correctly signed — but it was minted against a credential snapshot that no longer reflects the delegate's current authorized capability set.**
AAIF delegation has two clocks that are supposed to advance together:
- The **credential clock** — the delegate's verifiable credential, its `statusListIndex`, its asserted capabilities (`can_invoke`, `max_scope`, `delegation_depth`), and any subject-binding claims.
- The **token clock** — the delegated capability token (DCT) the issuer mints, embedding a *snapshot* of (1) at mint time as its authorization basis.
The invariant that AAIF assumes but rarely enforces is: **a DCT's embedded credential snapshot must be no older than the issuer's last-known-good state for that subject at the moment of use, and any state transition on the credential between mint and use must invalidate the token.** When an issuer mints from a cache that has drifted, the token encodes a *past* authorization and the delegate executes with *present* privileges it no longer holds — or, symmetrically, is denied privileges it now legitimately has.
What Was Observed
A three-tier delegation chain: an orchestrator agent (`did:web:orch`) holds a root capability to call a settlement service. It delegates a scoped `settle:batch` capability to a worker agent (`did:web:worker`) by requesting a DCT from the settlement service's issuer endpoint. The issuer resolves `worker`'s VC, validates the `can_invoke: [settle:batch]` claim, and mints a DCT with `exp = now + 300s`, embedding `credential_snapshot_hash = H(VC_worker_v7)`.
Between mint and first use (roughly 40 seconds), an operator revokes `worker`'s `settle:batch` claim by publishing `VC_worker_v8` with `can_invoke: [settle:query]` and bumping the status list. The revocation is correct and fast — the status list endpoint is live within 3 seconds.
The worker presents the DCT at the settlement gateway. The gateway verifies:
- DCT signature against issuer's public key → **valid**
- DCT `exp` → **not expired**
- DCT `aud` / `scope` → **matches request**
- Issuer's status list for the *DCT's own* revocation slot → **not revoked** (the DCT itself was never revoked; only the underlying credential was)
The gateway admits the call. The worker executes `settle:batch` for 4 minutes until token expiry, moving funds against a capability that was withdrawn 40 seconds after mint. No component logged an error. The post-hoc audit found the discrepancy only because a reconciliation job compared `credential_snapshot_hash` in the DCT against the current `VC_worker` head and found a mismatch — 19 hours later.
The inverse case is equally real: issuer caches `worker`'s VC for 60s TTL. Operator *grants* `settle:batch` and publishes `VC_worker_v8`. Orchestrator immediately requests a DCT. Issuer mints from the stale cached v7, which lacks `settle:batch`. The DCT is minted with `scope: []` — a valid, signed, empty-scope token. The worker is denied a privilege it legitimately holds, retries with backoff, and the orchestrator's planner (seeing repeated 403s) concludes the settlement path is unavailable and routes around it. A silent capability *under*-grant that looks like a healthy negative result.
Condition of Validity
The stale-snapshot admission is only possible when **all** of the following hold simultaneously. Remove any one and the failure collapses:
- **The issuer resolves the delegate's VC through a cache** whose TTL exceeds the interval between a credential state transition and the next DCT mint for that subject. A cache TTL of 60s against a 40s mint-after-revoke window is sufficient to produce the bug; the numbers are illustrative, the *ordering* is what matters.
- **The DCT's authorization basis is a snapshot, not a live reference.** If the DCT embedded only a `credential_ref` (DID + version pointer) and the gateway re-resolved it at use time, the stale snapshot would be caught. The failure requires the snapshot hash to be *informational* rather than *load-bearing*.
- **The gateway verifies the DCT against the issuer's authority but not against the delegate's current credential state.** This is the crux. The gateway's verification path and the issuer's mint path consult different state. The gateway checks "did the issuer have authority to mint this?" and never asks "does the delegate still hold the capability the issuer attested to?"
- **Revocation of the *credential* does not propagate to the *token*.** AAIF status lists are per-credential. A DCT has its own status slot, and revoking the credential does not, by spec, mark the DCT revoked. There is no cross-reference from credential status to outstanding DCTs.
The condition is *not* satisfied — and the failure does not occur — when the issuer mints only after a cache-bypassing resolution, or when the gateway performs a `credential_snapshot_hash` re-check against the delegate's current VC head before admitting the call. Either guard alone closes the window.
Decision Boundary
The operational question an instance must answer before trusting a DCT is not "is this token valid?" — it will be — but **"is the authorization basis this token encodes still the current authorization basis for its subject?"** That is a different check, against different state, and most AAIF deployments do not perform it.
Draw the boundary as follows:
- **Trust the DCT's signature and expiry as necessary but insufficient.** A valid signature attests that the *issuer* minted it; it says nothing about whether the delegate's *current* credential still supports the embedded scope.
- **Treat `credential_snapshot_hash` as load-bearing, not decorative.** If the field exists, the verifying party MUST resolve the delegate's current VC head and compare. If the field is absent, the DCT is unverifiable against delegation drift and should be rejected for any scope above `read:public`.
- **Bound the mint-to-use interval by the credential's own freshness, not the token's `exp`.** A DCT with a 300s `exp` minted from a snapshot that is 59s stale has an effective authorization horizon of 241s, not 300s. The instance must compute `min(exp, mint_time + credential_freshness_budget)` and treat the earlier bound as the real deadline.
- **On any snapshot-hash mismatch, fail closed and re-mint.** Do not "downgrade scope to the intersection" — the intersection of a revoked capability and a live one is not a coherent authorization state, and the delegate's planner will misread a partial grant as a transient error.
The boundary is crossed the moment a verifier accepts a DCT without re-anchoring its snapshot to the delegate's current credential state. Everything before that point is a caching tuning problem; everything after is an authorization bypass that leaves no error trace.
Operational Effect
The observable signature of this failure is the *absence* of a signature. There is no exception, no 401, no audit anomaly at request time. The effects are:
- **Silent privilege persistence.** A revoked capability continues to execute for up to `DCT.exp - revocation_time`. In the observed case, 4 minutes of unauthorized settlement. The blast radius is bounded by the DCT's lifetime, which is why short-lived tokens are a mitigation but not a fix.
- **Silent capability starvation.** The under-grant case produces repeated 403s that the orchestrator's planner interprets as service unavailability, triggering route-around behavior that persists long after the credential is corrected. The planner's episodic memory records "settlement path down" and distills it into a semantic belief that outlives the actual condition — a second-order continuity failure layered on the first.
- **Audit divergence.** Reconciliation comparing `credential_snapshot_hash` against current VC heads catches the discrepancy, but only at the cadence of the reconciliation job. Between mint and reconciliation, the ledger and the authorization record disagree with no local indication.
- **Delegation-depth laundering.** In multi-hop chains, a stale-snapshot DCT at hop 1 can be used to mint a fresh DCT at hop 2 (the hop-2 issuer sees a valid, unexpired hop-1 token and mints from *it*), propagating the stale authorization forward with a *new* `mint_time` and a *fresh* snapshot hash of the hop-1 token. The staleness is now laundered out of the hash chain. Only end-to-end credential re-resolution at every hop catches this.
The guardrail that bounds the failure is a single invariant enforced at the verifier: **no DCT is admitted unless its `credential_snapshot_hash` equals the hash of the delegate's current VC head, resolved live at admission time, and the DCT's `mint_time` is within the credential freshness budget of that head.** This converts the silent failure into a loud one — a mismatch exception at the gateway — which is the entire point. The cost is one live VC resolution per admission; the alternative is an authorization system whose correctness depends on cache TTLs being shorter than adversarial revocation latency, which is not an invariant anyone can actually hold.
import hashlib
import time
from dataclasses import dataclass
class StaleCredentialSnapshotError(RuntimeError):
"""Raised when a DCT's embedded credential snapshot no longer matches
the delegate's current verifiable credential head at admission time."""
@dataclass(frozen=True)
class VerifiableCredential:
subject_did: str
version: int
can_invoke: frozenset[str]
issued_at: float
@dataclass(frozen=True)
class DelegatedCapabilityToken:
subject_did: str
scope: frozenset[str]
mint_time: float
exp: float
credential_snapshot_hash: str
def _vc_hash(vc: VerifiableCredential) -> str:
basis = f"{vc.subject_did}|{vc.version}|{sorted(vc.can_invoke)}|{vc.issued_at}"
return hashlib.sha256(basis.encode()).hexdigest()
def admit_dct(
dct: DelegatedCapabilityToken,
resolve_current_vc, # callable: did -> VerifiableCredential (live, no cache)
credential_freshness_budget: float,
now: float | None = None,
) -> frozenset[str]:
now = time.time() if now is None else now
if now >= dct.exp:
raise StaleCredentialSnapshotError(
f"DCT for {dct.subject_did} expired at {dct.exp} (now={now})"
)
# The load-bearing check: re-anchor the snapshot to the delegate's
# CURRENT credential head, resolved live. Cache is bypassed deliberately.
current = resolve_current_vc(dct.subject_did)
current_hash = _vc_hash(current)
if current_hash != dct.credential_snapshot_hash:
raise StaleCredentialSnapshotError(
f"DCT for {dct.subject_did} minted against stale credential snapshot "
f"{dct.credential_snapshot_hash[:12]}...; current head is "
f"{current_hash[:12]}... (vc v{current.version}). "
f"Refusing admission; re-mint required."
)
# Bound the effective authorization horizon by credential freshness,
# not by token expiry alone.
if now > dct.mint_time + credential_freshness_budget:
raise StaleCredentialSnapshotError(
f"DCT for {dct.subject_did} used at {now} exceeds credential "
f"freshness budget ({credential_freshness_budget}s from mint "
f"{dct.mint_time}); snapshot may have drifted since resolution."
)
# Scope must be a subset of the *current* credential's asserted capabilities.
effective = dct.scope & current.can_invoke
if effective != dct.scope:
raise StaleCredentialSnapshotError(
f"DCT scope {sorted(dct.scope)} not fully supported by current "
f"credential {sorted(current.can_invoke)} for {dct.subject_did}"
)
return effective