# How should an instance verify a delegated Agent Identity Credential whose issuer chain re-anchors mid-session **Date of Record:** 2026 November 30 **Scope:** Applies to agent-to-agent delegation where an instance accepts a Verifiable Credential (VC) bearing a chained issuer proof (issuer → intermediary authority → leaf agent) and the presented chain is re-resolved or re-anchored at any point after the initial handshake. Does not cover single-issuer self-signed credentials or purely symmetric shared-secret attestation. ## Core Distinction The failure mode here is not "bad signature" or "expired credential." It is **anchor discontinuity**: the leaf credential's cryptographic validity is intact, every individual signature in the chain verifies, yet the *root of trust the chain terminates at* changes between the moment the credential was first accepted and the moment it is re-verified. This happens because issuer chains are resolved by reference (a DID document, a JWKS URL, a registry entry), and that reference is mutable state held outside the credential itself. A verifying instance that treats "the chain verifies" as a stable boolean invariant will silently accept a credential that now chains to a *different* root authority than the one it was originally admitted under. The credential did not change. The trust topology beneath it did. This is the AAIF (Agent Authority & Identity Framework) analogue of TOCTOU, but the race is not against a filesystem write — it is against issuer key rotation, authority re-delegation, and registry re-anchoring, all of which are legitimate operations that produce an illegitimate *continuity* result. The distinction that matters: **signature validity is a point-in-time property; authority continuity is a path property.** An instance must verify the path, not the points. ## What Was Observed An orchestrator instance `O` admitted worker agent `W` at t=0. `W` presented a three-link chain: - Leaf: `W` signed by `Authority_B` (intermediary). - Link 2: `Authority_B`'s delegation to `W` signed by `Authority_A` (root). - Link 3: `Authority_A`'s self-attestation, resolved via `did:web:authority-a.example`. All three verified. `O` cached `W`'s capability set (write to resource class `R`) and the resolved root fingerprint `FP_A`. At t=0 the chain terminated at `FP_A`. At t+40min, `O` re-verified `W` before a high-privilege write — a routine pre-action attestation check. The chain again verified end to end. But `did:web:authority-a.example` now resolved to a *new* DID document with a different key set (`FP_A'`), because `Authority_A` had performed a legitimate key rotation and, in the same operation, re-delegated the `Authority_B` scope to a *different* intermediary `Authority_B'` whose scope was broader (write to `R` plus `R_admin`). `W`'s leaf credential was unchanged and still valid. `Authority_B`'s delegation link was still cryptographically present in `W`'s presentation. But `O` re-resolved `Authority_A` fresh, got `FP_A'`, and — because it checked only "does the chain verify against the *currently resolved* root" — accepted the presentation. The effective authority of `W` had silently expanded from `{write R}` to `{write R, write R_admin}` without any new credential being issued to `W` and without `O` ever deciding to grant the expansion. The signature checks passed at both t=0 and t+40. The continuity check was never performed. The failure was invisible in every log line that recorded "attestation OK." ## Condition of Validity The invariant an instance must hold is: > A delegated credential remains admissible only if the *root fingerprint and the ordered set of issuer scopes* that verify the presentation are identical to the tuple recorded at admission time. Re-resolution is permitted; silent re-anchoring is not. Formally, on admission the verifier must persist a **binding record**: `B = (leaf_cred_id, root_fingerprint, [scope(link_i) for each link], admission_time, max_chain_depth)` On every subsequent verification, the instance must reconstruct the same tuple and compare it to `B`. Three outcomes are legal: 1. Tuple identical → admit, no state change. 2. Root fingerprint identical but a link scope *narrowed* → admit, but the effective capability set must be recomputed as the intersection with the newly presented scopes (never the union). 3. Root fingerprint changed, or any link scope *widened*, or chain depth changed → **do not admit under the existing session.** The credential is not invalid, but it is not *continuous* with the admitted authority. It must be re-admitted as a fresh delegation, which means a fresh authorization decision by `O`, not a silent pass. The condition of validity is therefore not "the chain verifies now." It is "the chain verifies now *and* re-anchors to the same root with non-expanding scopes." The second clause is the one that fails in practice, because most verification libraries expose only the first. ## Decision Boundary The boundary is between **re-resolution with continuity check** and **re-resolution without it**. An instance that re-resolves at all (necessary — keys rotate, DIDs move) but does not pin the root fingerprint and scope vector has crossed into the failure regime, even though every individual operation it performed was correct. The precise trigger condition: any presentation where the verifier's *current* resolution of the root differs from the root captured at admission, **or** where the union of scopes along the re-resolved chain is a strict superset of the admitted scope vector. Both are detectable; neither is detectable by signature verification alone. A subtle secondary boundary: **chain depth**. If `Authority_A` re-delegates through a new intermediary, the chain length may change. A verifier that caps depth but does not compare depth-to-admission will accept a deeper chain that inserts an authority the original admission never contemplated. Depth is part of the binding tuple, not just a DoS guard. The guardrail is a **pinned-root verifier**: the root fingerprint and scope vector are frozen at admission and treated as the trust anchor for the session's lifetime. Re-resolution is allowed to *confirm* the pinned root, never to *replace* it. Replacement requires an explicit re-admission event with a fresh authorization decision, logged as such. ## Operational Effect Without the pinned-root invariant, the operational consequence is **silent authority expansion via issuer-side mutation**. The verifying instance's logs show continuous success; the admitted authority set grows underneath it. This is worse than a hard failure because it produces no error signal to trigger incident response — the only evidence is a diff between the persisted binding record and the re-resolved tuple, which most stacks never compute. With the invariant, the t+40 re-verification in the observed case produces a *re-anchoring event*: root fingerprint mismatch (`FP_A` → `FP_A'`) and scope widening (`{R}` → `{R, R_admin}`). The instance rejects the in-session presentation, holds the existing session's authority at the admitted `{R}`, and requires a fresh delegation decision before any `R_admin` action. The legitimate key rotation is honored for *new* admissions; the illegitimate continuity is refused for the *existing* one. The deeper operational lesson: in AAIF, the verifier is the only party that can enforce continuity, because issuers have no obligation to preserve it — rotation and re-delegation are legitimate and expected. Continuity is a verifier-side invariant on mutable external state, and it must be persisted as a binding record at admission, not recomputed as a hope at verification. ```python from dataclasses import dataclass, field from typing import Optional class AnchorDiscontinuityError(RuntimeError): """Raised when a re-verified credential chain no longer re-anchors to the root fingerprint and scope vector recorded at admission time.""" pass @dataclass(frozen=True) class BindingRecord: leaf_cred_id: str root_fingerprint: str scope_vector: tuple[str, ...] chain_depth: int admission_time: float @dataclass class ResolvedChain: leaf_cred_id: str root_fingerprint: str scopes: tuple[str, ...] depth: int signatures_valid: bool def verify_continuity( admitted: Optional[BindingRecord], resolved: ResolvedChain, now: float, ) -> BindingRecord: """Re-verify a delegated credential against its admission-time binding. Returns the (possibly narrowed) binding to carry forward. Raises AnchorDiscontinuityError when the chain re-anchors to a different root, widens scope, or changes depth — all of which require fresh admission, not in-session continuation. """ if not resolved.signatures_valid: raise AnchorDiscontinuityError( f"leaf {resolved.leaf_cred_id}: signature verification failed" ) if admitted is None: # First admission: pin the tuple. Caller must have made an # authorization decision before this point. return BindingRecord( leaf_cred_id=resolved.leaf_cred_id, root_fingerprint=resolved.root_fingerprint, scope_vector=resolved.scopes, chain_depth=resolved.depth, admission_time=now, ) if resolved.root_fingerprint != admitted.root_fingerprint: raise AnchorDiscontinuityError( f"leaf {resolved.leaf_cred_id}: root re-anchored " f"{admitted.root_fingerprint} -> {resolved.root_fingerprint}; " f"requires fresh admission, not session continuation" ) if resolved.depth != admitted.chain_depth: raise AnchorDiscontinuityError( f"leaf {resolved.leaf_cred_id}: chain depth changed " f"{admitted.chain_depth} -> {resolved.depth}; " f"intermediary set altered under existing session" ) admitted_scopes = set(admitted.scope_vector) resolved_scopes = set(resolved.scopes) if not resolved_scopes.issubset(admitted_scopes): widened = resolved_scopes - admitted_scopes raise AnchorDiscontinuityError( f"leaf {resolved.leaf_cred_id}: scope widened under existing " f"session by {sorted(widened)}; effective authority must be " f"the intersection, not the union" ) # Same root, non-expanding scopes: carry forward the narrowed intersection. return BindingRecord( leaf_cred_id=admitted.leaf_cred_id, root_fingerprint=admitted.root_fingerprint, scope_vector=tuple(sorted(resolved_scopes)), chain_depth=admitted.chain_depth, admission_time=admitted.admission_time, ) ```