# Why does an instance’s delegated authority survive credential rotation but its audit chain does not? **Date of Record:** 2026 November 30 **Scope:** Applies to multi-hop agent authorization where an orchestrator holds a verifiable credential (VC) with a delegation chain and re-signs sub-tokens for worker instances; does not apply to single-hop bearer-token calls without delegation provenance. ## Core Distinction There are two different notions of "identity continuity" in an Agent Authentication and Identity Framework (AAIF), and they diverge precisely at credential rotation: - **Authorization continuity** — the *right* of an instance to act, carried by the delegation chain's scope and constraints. This is a property of the *claims*, not the key. - **Audit continuity** — the *provability* that a specific action was performed by the same logical agent across time. This is a property of the *signing key lineage*, not the claims. A delegated VC typically binds `issuer → subject (agent DID) → scope → constraints (expiry, tool allowlist, spend cap)`, and the subject re-signs downstream sub-credentials with *its own* key. When the subject rotates its key (scheduled rotation, key compromise recovery, or ephemeral instance recycling), the AAIF layer re-issues the VC to the *same DID* with the *same scope*. Authorization continuity is preserved trivially: the scope string is identical, so every downstream policy check passes. But the audit chain is broken because the verifier's replay log keys on `(DID, key_id)` pairs and the old `key_id` is now marked `retired` — not `revoked`, not `compromised`, just `retired`. Downstream verifiers that treat `retired` as "cannot confirm authorship of historical signatures" will reject the *entire* historical chain back to the last valid key, even though the actions were legitimate. The non-obvious failure: **rotation is treated as a key-lifecycle event, but the audit chain treats it as an identity-discontinuity event.** The two subsystems disagree about what a DID means. ## What Was Observed A three-tier deployment: orchestrator agent `O` (long-lived DID, hardware-backed key `k1`), worker pool `W1..Wn` (ephemeral DIDs), and an auditor agent `A` that consumes the AAIF audit log and produces attestations for a regulated downstream. Trace of the failure: 1. `O` holds VC `V_o` issued by root authority `R`, scope `tool:db.read, tool:db.write`, constraint `max_ops=10_000/day`, signed with `k1`. 2. `O` delegates to `W3` a sub-VC `V_w3` with scope `tool:db.read`, signed by `k1`, containing `parent_chain=[V_o]`. `W3` performs 412 reads. Each action emits an audit record `{actor: W3, signed_by: k1, chain: V_o→V_w3, action_hash}`. 3. At 14:02, `O`'s key manager rotates `k1 → k2` (scheduled, TTL 24h). The AAIF registry updates `O`'s DID document: `k1` status → `retired`, `k2` → `active`. A fresh `V_o'` is issued with identical scope and constraints, signed `k2`. 4. `O` continues delegating. New sub-VCs are signed `k2`. 5. At 15:30, auditor `A` runs a replay over the day's audit log to produce an attestation. It walks each record's `parent_chain` and validates signatures against the *current* DID document. For records 1–412, it looks up `k1` → `retired`. `A`'s policy is: "a signature by a retired key cannot be attributed to the DID's current controller without a rotation-attestation record." **No rotation-attestation record exists** — the key manager updated the registry but did not emit a signed continuity statement. 6. `A` marks the 412 pre-rotation actions `UNATTRIBUTED`, fails the day's attestation, and pages the on-call. Downstream regulated consumer halts. The authorization layer never noticed. Every post-rotation sub-VC validated cleanly. The failure was entirely in the audit/attestation path, and it was *retroactive*: actions that were valid at execution time became unprovable at replay time. ## Condition of Validity The invariant that must hold for AAIF delegation to be replay-safe is: > For every `(DID, key_id)` pair referenced by any audit record in the retained window, the DID document at replay time must contain either (a) the key in `active` or `retired` status **with a signed rotation-attestation linking it forward to the current key**, or (b) an explicit `revoked-at` timestamp that post-dates the record's `signed_at`. Equivalently: **key retirement without a signed forward-link is indistinguishable, at replay, from key compromise.** The verifier cannot tell "the controller rotated deliberately" from "an attacker retired the key to cover their tracks" without a continuity signature. This is the boundary: the AAIF registry treats `retired` as a soft state, but any correct auditor must treat it as a hard attribution boundary unless a rotation attestation bridges it. This condition is *not* satisfied by: - Re-issuing the VC to the same DID (preserves authorization, not audit). - Keeping the old key in the DID document without a signed rotation statement (the verifier still can't distinguish intent). - Timestamp-only reconciliation (clock skew across instances makes `signed_at` unreliable at the boundary). It *is* satisfied by a **rotation attestation**: a record signed by *both* `k1` and `k2` (or by `k1` over a statement committing to `k2`, countersigned by the root), stating `{did: O, from: k1, to: k2, effective_at, reason: scheduled}`. This is the AAIF analogue of a certificate cross-sign. ## Decision Boundary The operational decision is: **when an instance rotates its key, does it re-issue credentials only, or does it also emit a continuity attestation before retiring the old key?** - If the deployment's audit consumers treat `retired` as attributable (permissive policy), re-issuance alone is sufficient — but this is only safe if the threat model excludes key-compromise-cover-up, which it rarely does for regulated downstreams. - If any consumer requires attribution across rotation (the common case for regulated or financial agents), the rotation **must** be a two-phase operation: (1) emit and propagate the rotation attestation, (2) only then mark `k1` retired. Retiring before the attestation is durably replicated creates a window where replay fails. The boundary is sharp: the moment the old key's status flips to `retired` without a committed forward-link, every historical audit record under that key becomes unattributable *for every consumer with a strict policy*, and this is not recoverable by re-issuing — the historical signatures are already bound to `k1`. A second, subtler boundary: delegation chains that span a rotation. If `V_w3` (signed `k1`) is the parent of a grandchild `V_w3a` signed by `W3`'s own key, and `W3`'s audit records reference the parent chain, then a rotation of `O`'s key mid-chain means the grandchild's provenance depends on `k1`'s attribution. A verifier that checks only the leaf signature will pass; one that walks the full `parent_chain` will fail. **Chain depth amplifies the blast radius of a single unattested rotation.** ## Operational Effect Concrete consequences observed and required guardrails: 1. **Retroactive attestation failure.** 412 previously-valid actions became `UNATTRIBUTED` at replay. Guardrail: audit consumers must be able to *defer* attribution pending a rotation attestation rather than failing closed on `retired`; and the key manager must emit the attestation *before* the status flip, with a durable-write barrier (see code). 2. **Authorization/audit split-brain.** The authorization path and the audit path disagreed on DID semantics. Guardrail: both must consume the *same* DID document version, and the rotation attestation must be a first-class field on the DID document, not a side-channel. 3. **Chain-depth amplification.** A single unattested rotation invalidates every descendant chain that references the old key. Guardrail: rotation attestations must be included in the `parent_chain` material carried by sub-VCs, so leaf verifiers can validate without a registry round-trip. 4. **Clock-skew at the boundary.** `effective_at` on the attestation must be signed by both keys and must be the *only* timestamp the verifier trusts for the cutover; `signed_at` on individual records is advisory. The invariant to enforce: **no key may transition to `retired` until a dual-signed rotation attestation is durably committed and visible to all audit consumers; any audit record whose key is `retired` without such an attestation must be quarantined, not failed, and no new delegation may be signed by a key whose retirement is in-flight.** ```python import time from dataclasses import dataclass, field from typing import Optional class RotationAttestationError(RuntimeError): """Raised when a key is retired without a committed, dual-signed rotation attestation.""" class AuditAttributionError(RuntimeError): """Raised when an audit record cannot be attributed to a DID at replay time.""" @dataclass class KeyStatus: key_id: str status: str # "active" | "retired" | "revoked" rotation_attestation: Optional[dict] = None retired_at: Optional[float] = None @dataclass class AuditRecord: actor_did: str signed_by: str signed_at: float action_hash: str @dataclass class DIDDocument: did: str keys: dict = field(default_factory=dict) # key_id -> KeyStatus def rotate(self, old_key: str, new_key: str, attestation: dict) -> None: """ Two-phase rotation: attestation MUST be committed before the old key transitions to 'retired'. This is the guardrail that prevents the retroactive-attestation failure. """ if old_key not in self.keys or self.keys[old_key].status != "active": raise RotationAttestationError( f"cannot rotate {old_key}: not active on {self.did}" ) # Phase 1: verify the attestation is dual-signed and commits to new_key. if attestation.get("from") != old_key or attestation.get("to") != new_key: raise RotationAttestationError( f"attestation does not link {old_key} -> {new_key}" ) if not attestation.get("signed_by_both"): raise RotationAttestationError( "rotation attestation must be signed by both old and new keys" ) # Phase 2: only now flip status, atomically with the attestation. self.keys[old_key] = KeyStatus( key_id=old_key, status="retired", rotation_attestation=attestation, retired_at=attestation["effective_at"], ) self.keys[new_key] = KeyStatus(key_id=new_key, status="active") def replay_attribution(doc: DIDDocument, records: list[AuditRecord]) -> dict: """ Replay an audit log against the current DID document. Returns {attributed: [...], quarantined: [...]}. Raises AuditAttributionError only if a record's key is *revoked* (a hard failure); 'retired' without attestation is quarantined, not failed. """ attributed, quarantined = [], [] for r in records: ks = doc.keys.get(r.signed_by) if ks is None: raise AuditAttributionError( f"key {r.signed_by} unknown on {doc.did}; cannot attribute {r.action_hash}" ) if ks.status == "revoked" and (ks.retired_at or 0) <= r.signed_at: raise AuditAttributionError( f"key {r.signed_by} was revoked before {r.action_hash} was signed" ) if ks.status == "retired": if ks.rotation_attestation is None: # The boundary failure: retired without a forward-link. quarantined.append(r) continue if r.signed_at > ks.rotation_attestation["effective_at"]: # Record post-dates the cutover but was signed by the old key: # this is a real violation, not a rotation artifact. raise AuditAttributionError( f"record {r.action_hash} signed by {r.signed_by} after its retirement" ) attributed.append(r) return {"attributed": attributed, "quarantined": quarantined} # --- Demonstration of the boundary failure --- if __name__ == "__main__": doc = DIDDocument(did="did:aaif:O", keys={"k1": KeyStatus("k1", "active")}) records = [AuditRecord("did:aaif:W3", "k1", time.time() - 3600, f"h{i}") for i in range(3)] # Correct path: dual-signed attestation commits before retirement. good_att = {"from": "k1", "to": "k2", "effective_at": time.time(), "reason": "scheduled", "signed_by_both": True} doc.rotate("k1", "k2", good_att) result = replay_attribution(doc, records) assert len(result["attributed"]) == 3 and not result["quarantined"] # Failure path: retirement without attestation -> quarantine, not silent pass. doc2 = DIDDocument(did="did:aaif:P", keys={"k1": KeyStatus("k1", "active")}) doc2.keys["k1"] = KeyStatus("k1", "retired", rotation_attestation=None) result2 = replay_attribution(doc2, records) if result2["quarantined"]: raise RotationAttestationError( f"{len(result2['quarantined'])} records quarantined: key retired " "without a committed rotation attestation (audit chain discontinuous)" ) ```