# When must an instance refuse a delegated AAIF credential after a peer's identity document rotates mid-chain **Date of Record:** 2026 November 21 **Scope:** Applies to multi-hop AAIF credential delegation chains where an intermediate agent's identity document (key set / DID document) can rotate while a downstream sub-delegation is still live. Does not apply to single-hop bearer tokens, static API keys, or chains whose entire lifetime is bounded by one identity-document epoch. ## Core Distinction A delegated AAIF credential is not a capability grant; it is a *signed assertion about a chain of identities at a moment in time*. The distinction that matters operationally is between **credential validity** (signature verifies, `exp` not passed, scope covers the request) and **chain continuity** (every link's signing key was the authoritative key for that subject at the instant the link was signed, and remains so through the delegation horizon). Most verifiers check the first and assume the second. The failure mode documented here is the gap: a credential that is fully valid by every local check yet whose chain is broken because an intermediate identity document rotated between link-signing time and presentation time, invalidating the *basis* on which the downstream link was minted. ## What Was Observed A three-hop chain: orchestrator `O` delegates scope `S` to worker `W` (link L1, signed with `O`'s key `k_O1`), `W` sub-delegates a narrowed scope `S'` to tool-runner `T` (link L2, signed with `W`'s key `k_W1`), and `T` presents `[L1, L2]` to a resource server `R`. Between L2 minting and presentation, `W`'s identity document rotated: `k_W1` was retired and `k_W2` published, with `k_W1` retained only in a *historical* verification method section, not the *current* one. `R` verified L2 against `W`'s current document, found `k_W1` absent from current methods, and — depending on implementation — did one of three things, all wrong in different ways: 1. **Hard reject** of a legitimate, unexpired delegation, because it resolved `k_W1` against current-only methods. Availability loss on a valid grant. 2. **Accept via historical-method fallback** without checking whether `k_W1` was valid *at L2's signing time* (`iat`). This silently admits a credential signed by a key that may have been compromised and rotated *because* of compromise — a forgery window. The classic key-rotation replay. 3. **Accept because L1 still verifies**, treating L1's validity as transitive proof of L2's chain. This skips per-link temporal anchoring entirely and is the most common real-world bug: the verifier conflates "the root is still trusted" with "every link was validly signed." The observed trace: `R` accepted a forged L2 signed by a compromised-and-rotated `k_W1` under a valid L1, because the verifier only confirmed (a) L1 signature against `O`'s current key and (b) L2 signature against *some* key material for `W` present in the document history. Neither check anchors L2's signature to `W`'s authoritative key at `L2.iat`. ## Condition of Validity The invariant that a correct verifier must enforce is **temporal key anchoring per link**: > For each link `Li` with issuer subject `P`, the verification key used to check `Li.sig` must be the key that `P`'s identity document designated as authoritative at `Li.iat`, and `Li.iat` must fall within that key's declared validity interval `[not_before, not_after]` as recorded in the document *version in force at `Li.iat`*. This requires the verifier to resolve identity-document *versions*, not just current state. Two consequences follow: - A credential chain is invalid if any link's `iat` precedes its issuer key's `not_before` or follows its `not_after`, even if the signature mathematically verifies against a historical key. A retired key does not retroactively validate signatures made after its retirement. - A credential chain must carry, per link, either the issuer's document version identifier or a hash of the key used, so the verifier can fetch the *exact* historical document rather than reconstructing intent from current state. Without this, temporal anchoring is unverifiable and the chain must be rejected. The condition of validity is therefore not "does L1 verify" but "does every link verify against the issuer key that was authoritative at that link's `iat`, and is that key's validity interval consistent with the link's lifetime?" ## Decision Boundary The decision boundary is the point at which a verifier must choose between **rejecting on unverifiable continuity** and **accepting on current-state verification**. The rule: - If the chain carries per-link document-version references and the historical documents are retrievable, verify each link against its anchored key. Accept only if all links pass. This is the only path to acceptance. - If the chain carries per-link references but the historical document is *unavailable* (garbage-collected, unreachable, or the issuer's log has pruned it), **reject**. Unverifiable continuity is indistinguishable from broken continuity; the safe default is refusal. Do not fall back to current-state verification. - If the chain carries *no* per-link anchoring (legacy two-field credentials), the verifier may accept only if it can independently confirm that the issuer's current document is the same version that was in force at `Li.iat` — i.e., no rotation occurred in the interval. If a rotation is detectable in the interval, reject. The asymmetric cost is deliberate: a false reject costs one retry or a re-delegation; a false accept on a rotated key costs the entire security property of delegation. The boundary sits firmly on the reject side whenever continuity cannot be positively established. ## Operational Effect Enforcing this invariant changes three operational behaviors. First, delegation chains grow: each link must carry a document-version pointer or key hash, adding bytes and a resolution step per hop — verifiers must budget a document fetch (or cache) per unique issuer, and chains that span many issuers pay latency proportional to distinct issuers, not hops. Second, issuers must retain historical identity-document versions for at least the maximum delegation horizon (the longest `exp` any downstream credential can carry), or chains will fail closed on GC. This is a retention obligation most AAIF deployments omit. Third, rotation becomes a *chain-breaking event* for in-flight delegations signed under the old key: downstream agents holding live sub-delegations must either re-mint under the new key or accept that their chains will be rejected at presentation. The correct handling is to propagate a rotation notice through the chain and force re-delegation, not to rely on historical-key fallback. Verifiers that implement the invariant will surface these as explicit `ChainContinuityError`-class failures rather than silent accept-or-reject, which is what makes the boundary auditable. ```python from dataclasses import dataclass from typing import Optional class ChainContinuityError(RuntimeError): """Raised when a delegated AAIF chain cannot be temporally anchored.""" pass @dataclass class IdentityDocVersion: subject: str version_id: str key_id: str not_before: int not_after: int @dataclass class DelegationLink: issuer: str subject: str key_id: str iat: int exp: int doc_version_ref: Optional[str] def verify_link(link: DelegationLink, doc: IdentityDocVersion, now: int) -> None: if link.doc_version_ref is None: raise ChainContinuityError( f"link from {link.issuer} to {link.subject} carries no document-version " f"reference; continuity unverifiable, refusing to fall back to current state" ) if doc.version_id != link.doc_version_ref: raise ChainContinuityError( f"document version mismatch for {link.issuer}: link anchors " f"{link.doc_version_ref}, resolved {doc.version_id}" ) if not (doc.not_before <= link.iat <= doc.not_after): raise ChainContinuityError( f"key {doc.key_id} for {link.issuer} was not authoritative at iat={link.iat} " f"(valid {doc.not_before}..{doc.not_after}); signature may verify but " f"anchoring fails" ) if link.exp < now: raise ChainContinuityError( f"link from {link.issuer} expired at {link.exp}, now={now}" ) def verify_chain(links, docs_by_ref, now): for link in links: doc = docs_by_ref.get(link.doc_version_ref) if doc is None: raise ChainContinuityError( f"historical document {link.doc_version_ref} for {link.issuer} " f"unavailable; cannot anchor link, refusing" ) verify_link(link, doc, now) return True ```