# In what scenarios must an instance treat a rotated AAIF signing key as an identity break rather than a credential refresh **Date of Record:** 2026 November 28 **Scope:** Applies to agent instances that authenticate to peers, MCP servers, or A2A endpoints using AAIF verifiable credentials (VCs) whose issuer or subject keys rotate mid-session. Does not cover initial credential issuance, human SSO, or rotation of TLS transport certs that are not bound into the VC proof. ## Core Distinction AAIF verifiable credentials bind three things into one signed envelope: a *subject DID*, a *capability set* (scopes, tool grants, budget), and a *key reference* (`verificationMethod` pointing at a specific key ID, e.g. `did:aaif:agent-x#key-2`). The non-obvious boundary is the difference between **key rotation** (same DID, new key ID, same subject, capability set re-signed by the issuer) and **identity substitution** (same DID string, new key ID, different subject or widened capability set). Both arrive as a valid-looking VC with a fresh `proof`. The instance cannot distinguish them by signature validity alone — the signature only proves *whoever holds the new key* signed it. The invariant that must hold: **a credential whose `verificationMethod` key ID has changed since the last accepted presentation is not a refresh; it is a new identity assertion that must be re-attested through the issuer's key-transition chain, not accepted on the strength of the subject DID matching.** ## What Was Observed A planner agent (`did:aaif:planner-7`) held a long-running A2A session with a tool-executor agent (`did:aaif:exec-3`). At session start, `exec-3` presented a VC signed under `#key-1`, granting `fs.read`, `http.get`, and a 200k-token budget. The planner cached the VC, extracted the capability set, and stopped re-verifying the proof on each turn — a common optimization, because re-verifying an Ed25519 proof per turn is cheap but the *resolution* of the DID document is a network call. At turn 40, `exec-3`'s key rotated to `#key-2`. The issuer re-signed the VC. The new VC arrived in a `credential_refresh` message. The planner's verification path did three things in order: (1) parsed the VC, (2) checked `issuer` field equals the expected issuer DID, (3) checked the signature verified against *the key it had cached for the DID* — which was still `#key-1`. The signature did not verify against `#key-1`, so step 3 failed. The planner's error handler treated a proof-verification failure during a `credential_refresh` as a *transient* condition (the sender may have raced the DID document update) and retried three times, then fell back to **the cached capability set** — accepting the refresh message's `capabilities` claim but not its proof. The refresh message claimed the same scopes. The session continued. The failure surfaced 12 turns later: the *actual* `#key-2` credential had silently widened `http.get` to `http.any` (including `POST`) and raised the budget to 2M tokens. The planner had accepted the refresh envelope's *capability claim* while failing to verify its *proof*, so the widened scope was never gated. The executor made 340 outbound POSTs before the budget alarm fired. The signature was valid the whole time — against `#key-2`. The planner never resolved `#key-2`. The root cause is not "failed to verify." It is that the planner's fallback path *decoupled the capability claim from the proof* under a transient-error classification. A proof-verification failure on a refresh is never transient in the way a 503 is transient, because the proof is the only thing binding the claim to the key. ## Condition of Validity The "accept refresh, keep session" behavior is only valid when all three hold: 1. The refresh VC's `verificationMethod` key ID equals the key ID in the previously accepted VC (pure re-sign, no rotation), **or** the new key ID is reachable through the issuer's `keyTransition` chain (a signed, append-only list of `old_key -> new_key` transitions published in the DID document, each entry itself signed by the old key). 2. The DID document resolution that yields the new key returns a `versionId` strictly greater than the one cached, and the document's `updated` timestamp is after the cached VC's `issuanceDate`. 3. The capability set in the new VC is a **subset** of the cached set. Any widening — new scope, higher budget, new tool grant — invalidates the "refresh" classification and forces full re-attestation: the planner must re-run its own authorization policy against the new scope before the executor's next tool call, not after. If any of the three fails, the refresh must be treated as an **identity break**: the session is suspended, the cached capabilities are revoked, and the peer must re-present a credential whose key transition chain the planner verifies end-to-end from the last-accepted key. ## Decision Boundary The precise boundary is at the `verificationMethod` field, not at the signature result and not at the issuer field. Concretely: - **Accept as refresh** iff `new_vc.verificationMethod == cached_vc.verificationMethod` AND signature verifies AND `new_vc.capabilities ⊆ cached_vc.capabilities`. - **Accept as rotation** iff `new_vc.verificationMethod != cached_vc.verificationMethod` AND the DID document contains a `keyTransition` entry from `cached_vc.verificationMethod` to `new_vc.verificationMethod` signed by the *old* key AND the new VC's `issuanceDate` is after that transition's timestamp AND capabilities are a subset. - **Reject as identity break** in every other case, including: same DID but no transition entry; transition entry signed by the new key (self-attested rotation — forgeable); capability widening under either branch; `issuanceDate` earlier than the transition (backdated credential). The trap is that "same DID, valid signature, subset capabilities" *looks* like a clean rotation, but if the transition entry is absent or self-signed, the new key holder is unconstrained — anyone who can publish a DID document update for that DID can mint a key and sign a VC. AAIF's transition chain exists precisely to make the old key the authority for the new key; skipping it collapses attestation to "whoever controls the DID document registry." ## Operational Effect Instances that classify proof-verification failures on refresh as transient will, under rotation, either (a) drop to cached capabilities and silently ignore widened scope — the observed failure — or (b) hard-fail the session and lose continuity on every legitimate rotation, which is worse operationally because operators then disable rotation. The correct behavior is a *third* path: suspend the session, quarantine the cached capability set, resolve the DID document, walk the transition chain, and only resume with the new scope after local re-authorization. This costs one DID resolution and one policy evaluation per rotation — bounded, and rotation is rare. The invariant to encode: **capability claims are only as trustworthy as the proof that binds them to a key, and a key is only trustworthy if its predecessor signed for it.** Never let a refresh path read `capabilities` before it has resolved and validated `verificationMethod`. ```python from dataclasses import dataclass from typing import Optional class IdentityBreakError(RuntimeError): """Raised when a credential refresh cannot be bound to the previously attested key via a valid issuer key-transition chain.""" @dataclass(frozen=True) class Credential: did: str verification_method: str # e.g. "did:aaif:exec-3#key-2" capabilities: frozenset[str] budget: int issuance_date: int proof_valid: bool @dataclass(frozen=True) class KeyTransition: old_key: str new_key: str signed_by: str # must equal old_key timestamp: int def classify_refresh( cached: Credential, incoming: Credential, transitions: list[KeyTransition], ) -> str: if not incoming.proof_valid: # A proof failure on refresh is never a transient transport condition. raise IdentityBreakError( f"proof invalid for {incoming.verification_method}; " "cannot classify as refresh or rotation" ) if incoming.verification_method == cached.verification_method: if not incoming.capabilities <= cached.capabilities: raise IdentityBreakError( "capability widening under same key requires re-attestation" ) return "refresh" # Key changed: require an issuer-signed transition from the cached key. chain = [ t for t in transitions if t.old_key == cached.verification_method and t.new_key == incoming.verification_method and t.signed_by == t.old_key # old key must authorize new key ] if not chain: raise IdentityBreakError( f"no issuer transition {cached.verification_method} -> " f"{incoming.verification_method}; treating as identity substitution" ) transition = chain[0] if incoming.issuance_date < transition.timestamp: raise IdentityBreakError("backdated credential relative to transition") if not incoming.capabilities <= cached.capabilities: raise IdentityBreakError( "capability widening on rotation requires local re-authorization" ) return "rotation" def apply_refresh(cached: Credential, incoming: Credential, transitions: list[KeyTransition]) -> Credential: kind = classify_refresh(cached, incoming, transitions) if kind == "rotation": # Suspend, re-authorize, then resume with bounded new scope. pass return incoming ```