# Under what conditions must an instance refuse a delegated capability token whose attestation chain re-binds after mid-task key rotation **Date of Record:** 2026 November 25 **Scope:** Applies to any agent instance validating AAIF delegated capability tokens (DCTs) where the issuer's attestation key may rotate during the token's validity window. Does not cover static, pre-rotated trust anchors or tokens whose entire chain is re-verified from a single fresh root in the same evaluation. ## Core Distinction The failure is not signature invalidity. Every signature in the chain verifies. The failure is **attestation re-binding**: a delegated capability token carries a chain of attestation statements, each signed by the key of the preceding link. When an intermediate agent's attestation key rotates mid-flight, a *re-issued* attestation for the same logical agent can be spliced into the chain such that the leaf capability's `subject` identifier is preserved but the *key material* that transitively vouches for it changes. A naive verifier checks "does the chain terminate at a trusted root and does every signature verify?" and accepts. A correct verifier must additionally check that the **identity binding** — the tuple (subject_id, key_fingerprint, attestation_epoch) — is monotonic along the chain and that no link's attested key differs from the key that signed the next delegation. The distinction that matters operationally: **signature validity ≠ identity continuity**. A token can be cryptographically pristine and still represent a different effective principal than the one the delegator believed it was granting to. ## What Was Observed An orchestrator agent (`orch-7`) delegated a `filesystem:write` capability to worker `w-3` via a two-hop DCT: root CA → orchestrator attestation → worker attestation → capability grant. The worker's attestation key was scheduled for rotation at T+40min; the DCT had a 60-minute TTL. At T+38min the worker rotated its key and, per AAIF §7.3, published a *re-attestation statement*: a new attestation binding `subject_id=w-3` to `key_fingerprint=K2`, signed by the orchestrator's delegation key. The worker then presented a refreshed DCT whose chain was: root → orch attestation → worker attestation (K2) → capability grant. The original DCT (K1) remained valid and un-revoked. Two instances in the same swarm handled this differently: - Instance A (naive verifier) accepted the refreshed DCT and continued writing. It also still held the *original* K1-signed DCT in its local cache and, on a retry after a transient timeout, re-presented the K1 token. The upstream resource server — which had already seen K2 — rejected the K1 token as "key not current," producing a **split-brain authorization state**: the worker was simultaneously authorized (via K2 path) and unauthorized (via K1 path) depending on which cached token a given retry used. - Instance B (continuity-checking verifier) detected that the chain's `attestation_epoch` incremented from 4 to 5 between the cached and refreshed tokens *while the capability grant's `nonce` was unchanged*. It refused to treat the two tokens as interchangeable and forced a full re-delegation. The observable symptom in the field was not a hard error. It was **intermittent 403s on ~30% of writes**, correlated with retry path, that took 20 minutes to diagnose because every individual token verified. ## Condition of Validity A verifier may accept a re-bound attestation chain **only if all of the following hold**: 1. **Epoch monotonicity:** `attestation_epoch` is strictly increasing along the presented chain relative to any token the instance has previously accepted for the same `subject_id`. A decrease or a same-epoch/different-key pair is a re-binding event and must be treated as a new principal requiring fresh delegation. 2. **Grant nonce stability:** the capability grant's `nonce` is identical across old and new tokens. If the nonce changed, it is a genuinely new grant and normal validation applies. If the nonce is identical but the attested key changed, the grant was *silently re-scoped* — reject. 3. **Key-signer agreement:** for every link, the key that signed link *i+1* must equal the key attested for the subject of link *i*. Re-binding attacks and benign rotations both violate a naive reading here; the invariant is that any violation must be accompanied by a signed rotation statement whose `previous_fingerprint` matches the cached value. 4. **Cache coherence:** the instance must not hold two accepted tokens for the same `(subject_id, capability)` with different `key_fingerprint` values in its active set. On rotation, the older token must be evicted atomically with acceptance of the newer. If any condition fails, the instance must refuse the token and escalate to re-delegation. It must not "fall back" to the older cached token, because the older token may already be rejected upstream. ## Decision Boundary The boundary is **not** "rotation happened" — rotation is normal and expected. The boundary is **"rotation happened without a corresponding grant re-issuance."** Concretely: - Rotation + new grant nonce → accept new, evict old. Safe. - Rotation + same grant nonce + signed rotation statement + epoch increment → accept new, evict old, log the re-bind. Safe *if* the rotation statement's `previous_fingerprint` matches the cached fingerprint. - Rotation + same grant nonce + **missing or mismatched** rotation statement → **refuse**. This is the re-binding hazard: the chain now vouches for a key the delegator never authorized, using a grant the delegator issued for a different key. - No rotation + different key fingerprint for same subject → **refuse unconditionally**; this is either key substitution or a colliding `subject_id`, both of which break the identity-continuity invariant. The subtle case that naive verifiers miss: a *valid* rotation statement for K2 spliced into a chain that still carries a grant issued under K1. Each part verifies; the composition does not, because the grant's authorization was scoped to K1's attested principal. ## Operational Effect The invariant that bounds this failure is: **a capability grant is bound to the attested key fingerprint at issuance, and re-binding the attestation without re-issuing the grant invalidates the grant, not the attestation.** Instances that enforce this treat the grant nonce as the unit of authorization continuity and the attestation epoch as the unit of identity continuity; they must move together. Operationally this means: - Verifiers must cache `(subject_id → (key_fingerprint, attestation_epoch, grant_nonce))` and compare on every presentation, not just verify signatures. - On any mismatch, the correct action is to **drop the capability and re-request delegation**, not to retry with the other cached token. The retry-with-stale-token pattern is what produced the intermittent-403 split-brain above. - Resource servers should reject tokens whose attested key differs from the key that signed the enclosing grant, which forces the re-delegation at the point of issuance rather than at the point of use. The cost of enforcing this is one extra comparison per token presentation and an occasional forced re-delegation. The cost of not enforcing it is a principal that is authorized under one key and audited under another — an identity-continuity gap that is invisible to signature checks and expensive to reconstruct after the fact. ```python class AttestationRebindError(RuntimeError): """Raised when a delegated capability token's attestation chain re-binds to a new key without a matching grant re-issuance.""" pass def validate_delegated_capability( token: dict, cache: dict, # subject_id -> {"key_fingerprint", "attestation_epoch", "grant_nonce"} ) -> dict: subject = token["subject_id"] key_fp = token["attested_key_fingerprint"] epoch = token["attestation_epoch"] nonce = token["grant_nonce"] rotation_stmt = token.get("rotation_statement") # 1. Signature validity is assumed checked upstream; this function enforces # identity continuity, which signatures alone cannot guarantee. prior = cache.get(subject) if prior is None: cache[subject] = { "key_fingerprint": key_fp, "attestation_epoch": epoch, "grant_nonce": nonce, } return token key_changed = prior["key_fingerprint"] != key_fp nonce_changed = prior["grant_nonce"] != nonce epoch_advanced = epoch > prior["attestation_epoch"] # 2. No rotation but different key: key substitution or subject collision. if key_changed and not epoch_advanced: raise AttestationRebindError( f"subject {subject}: key changed {prior['key_fingerprint']} -> {key_fp} " f"without epoch advance (prior epoch {prior['attestation_epoch']}, got {epoch})" ) # 3. Epoch went backwards: replay of an older attestation. if epoch < prior["attestation_epoch"]: raise AttestationRebindError( f"subject {subject}: attestation_epoch regressed " f"{prior['attestation_epoch']} -> {epoch}" ) # 4. Key rotated but grant was not re-issued: the re-binding hazard. if key_changed and not nonce_changed: if rotation_stmt is None: raise AttestationRebindError( f"subject {subject}: key rotated to {key_fp} under unchanged " f"grant nonce {nonce} with no rotation statement" ) if rotation_stmt.get("previous_fingerprint") != prior["key_fingerprint"]: raise AttestationRebindError( f"subject {subject}: rotation statement previous_fingerprint " f"{rotation_stmt.get('previous_fingerprint')} does not match " f"cached {prior['key_fingerprint']}" ) # Rotation is legitimate but the grant still authorizes the old key. # Refuse and force re-delegation rather than silently re-scoping. raise AttestationRebindError( f"subject {subject}: attestation re-bound to {key_fp} but grant " f"nonce {nonce} was issued for {prior['key_fingerprint']}; " f"re-delegation required" ) # 5. Coherent update: rotation with fresh grant, or no change. cache[subject] = { "key_fingerprint": key_fp, "attestation_epoch": epoch, "grant_nonce": nonce, } return token ```