# Why does an instance drift from its delegated AAIF credential scope after a mid-chain re-issuance? **Date of Record:** 2026 November 27 **Scope:** Applies to multi-hop agent delegation chains where each hop carries an AAIF-style verifiable credential (VC) whose `credentialSubject` binds a capability set to a specific instance identity, and where an intermediate issuer re-issues a downstream credential while an upstream credential is still live. Does not apply to single-hop, root-issued credentials or to chains where every hop is re-issued atomically in one transaction. ## Core Distinction The failure is not "an agent exceeds its permissions." It is subtler: an agent *continues to operate inside the permissions it was originally granted*, but the credential it now presents no longer provably descends from the root warrant it claims. The distinction matters because every per-call authorization check passes. Each individual hop's signature verifies. Each `credentialSubject` matches the presenting instance. The chain is locally valid at every edge and globally invalid as a whole. The mechanism is a **delegation-chain continuity gap** created by non-atomic re-issuance. When an intermediate agent (call it `B`) re-issues a credential to a downstream agent (`C`) because `B`'s own upstream credential from `A` was refreshed, rotated, or had its `exp` extended, `B` typically mints the new `C`-credential from `B`'s *current* capability set. But `C` may still be holding and presenting the *old* credential whose `parent` reference points at `B`'s *previous* credential hash. If the verifier validates `C`'s credential against `B`'s current credential (the one named in `B`'s live registry entry) rather than against the exact predecessor hash embedded in `C`'s `parent` field, the chain "reconnects" across a discontinuity that never existed in the signed data. ## What Was Observed A three-hop chain: root `A` (workload identity, hardware-attested) → orchestrator `B` → worker `C`. `A` issued `B` a credential with `exp = T+3600`, capability set `{read:dataset, spawn:worker}`. `B` issued `C` a credential with `parent = hash(cred_B_v1)`, capability set `{read:dataset}`. At `T+1800`, `A` rotated `B`'s credential (routine key rotation, same capability set, new `exp = T+5400`). This produced `cred_B_v2`. `B` did not re-issue `C`'s credential — the re-issuance path was gated behind a capability-change event, and the capability set was unchanged, so the code path was skipped. At `T+3600`, `cred_B_v1` expired. `C` presented `cred_C_v1`, whose `parent` still referenced `hash(cred_B_v1)`. The verifier at the resource gateway resolved `C`'s issuer to `B`, fetched `B`'s *current* credential (`cred_B_v2`), checked that `cred_C_v1.issuer == cred_B_v2.credentialSubject.id`, and confirmed `cred_B_v2` was live and unrevoked. It did **not** check that `cred_C_v1.parent == hash(cred_B_v2)`. Authorization granted. The result: `C` operated for 1800 seconds under a credential whose signed parent link pointed to a now-expired, superseded credential. The capability set happened to be identical, so no privilege escalation occurred — but the *warrant chain* the resource gateway believed it had verified did not exist. Had `A`'s rotation to `B` also *reduced* capabilities (a common containment response), `C` would have continued exercising the pre-reduction set, because `C`'s credential was never re-derived and the verifier never noticed the parent mismatch. The tell in the audit log: `cred_C_v1.parent` and `hash(cred_B_v2)` diverged, but every boolean in the verification trace read `true`. ## Condition of Validity The invariant that must hold for a delegation chain to be sound is **parent-hash binding**: for any credential `X` with `X.parent = h`, the verifier must locate the credential whose canonical hash is exactly `h`, confirm it is live at verification time, and confirm `X.issuer == that_credential.credentialSubject.id`. Verification against "the issuer's current credential" is a different, weaker predicate and is valid only under an additional assumption: *that the issuer has re-issued all descendants whenever its own credential changed.* That assumption is almost never enforced, because re-issuance is driven by capability deltas, not by credential lifecycle events. So the boundary is this: **the shortcut (resolve issuer → check liveness) is sound if and only if re-issuance is transitive and atomic across the whole subtree.** The moment re-issuance is triggered by anything other than "my parent credential changed," the shortcut silently decouples from the signed warrant graph. ## Decision Boundary A verifier must choose between two modes and must never blend them: - **Strict parent-hash mode:** resolve the exact predecessor by hash, reject if missing/expired/revoked, reject if issuer identity mismatches the predecessor's subject. This bounds the failure but requires retaining superseded credentials (or their hashes plus a liveness oracle) for at least the maximum descendant `exp`. - **Current-issuer mode:** permitted *only* when the issuer guarantees subtree-atomic re-issuance, and the verifier should then also require `X.issued_at >= predecessor.issued_at` and a monotonic capability subset check (`X.caps ⊆ current_issuer.caps`). The dangerous configuration is current-issuer mode without the subset check — which is exactly what a naive "is the issuer still valid?" gateway implements. The decision boundary is crossed the first time an issuer's credential changes without a corresponding descendant re-issue; after that, the gateway is authorizing against a warrant that was never signed. ## Operational Effect Downstream, the failure is invisible until a containment action is attempted. When `A` narrows `B`'s capabilities to quarantine a misbehaving subtree, `B`'s new credential reflects the narrowing, but `C`'s credential — never re-issued — still asserts the old set, and a current-issuer verifier happily honors it because `B` is still a live, unrevoked issuer. The quarantine silently fails to propagate to depth ≥ 2. The only reliable remediations are (a) hard parent-hash verification plus retention of superseded credential hashes, or (b) an explicit `generation` counter in the credential that the verifier requires to be strictly increasing along the chain, so a descendant minted from generation `n` is rejected once its issuer presents generation `n+1`. Absent one of these, treat every multi-hop chain as having an unbounded continuity gap at every re-issuance event. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class DelegationContinuityError(RuntimeError): """Raised when a delegated credential's signed parent link does not resolve to the issuer's live credential at verification time.""" pass @dataclass class Credential: subject: str issuer: str caps: frozenset generation: int parent: Optional[str] = None # canonical hash of predecessor issued_at: int = 0 expires_at: int = 0 def canonical_hash(self) -> str: body = json.dumps( { "subject": self.subject, "issuer": self.issuer, "caps": sorted(self.caps), "generation": self.generation, "parent": self.parent, "issued_at": self.issued_at, "expires_at": self.expires_at, }, sort_keys=True, ).encode() return hashlib.sha256(body).hexdigest() def verify_chain( leaf: Credential, registry: dict, # hash -> Credential (retains superseded) live_issuer: dict, # subject_id -> current Credential now: int, strict_parent_hash: bool = True, ) -> None: cred = leaf seen = set() while cred.parent is not None: if cred.canonical_hash() in seen: raise DelegationContinuityError("cycle in delegation chain") seen.add(cred.canonical_hash()) if strict_parent_hash: parent = registry.get(cred.parent) if parent is None: raise DelegationContinuityError( f"parent hash {cred.parent[:12]}… for {cred.subject} " f"not retained; cannot prove warrant descent" ) else: parent = live_issuer.get(cred.issuer) if parent is None: raise DelegationContinuityError( f"issuer {cred.issuer} has no live credential" ) if cred.issuer != parent.subject: raise DelegationContinuityError( f"issuer {cred.issuer} != parent subject {parent.subject}" ) if parent.expires_at <= now: raise DelegationContinuityError( f"parent credential for {cred.subject} expired at {parent.expires_at}" ) if cred.generation != parent.generation + 1: raise DelegationContinuityError( f"generation discontinuity: {cred.subject} gen={cred.generation} " f"but parent {parent.subject} gen={parent.generation}; " f"descendant was not re-issued after issuer rotation" ) if not cred.caps <= parent.caps: raise DelegationContinuityError( f"capability escalation: {cred.subject} asserts " f"{set(cred.caps) - set(parent.caps)} not held by {parent.subject}" ) cred = parent def issue_child(parent: Credential, subject: str, caps: frozenset, now: int) -> Credential: if not caps <= parent.caps: raise DelegationContinuityError( f"cannot delegate {set(caps) - set(parent.caps)} to {subject}" ) return Credential( subject=subject, issuer=parent.subject, caps=caps, generation=parent.generation + 1, parent=parent.canonical_hash(), issued_at=now, expires_at=parent.expires_at, ) # --- trace of the observed failure --------------------------------------- T = 0 a = Credential("A", "root", frozenset({"read:dataset", "spawn:worker"}), 0, None, T, T + 10_000) b_v1 = issue_child(a, "B", frozenset({"read:dataset", "spawn:worker"}), T) c_v1 = issue_child(b_v1, "C", frozenset({"read:dataset"}), T) # A rotates B at T+1800 with a *narrowed* set (quarantine) — C is never re-issued. b_v2 = Credential("B", "A", frozenset({"read:dataset"}), 1, a.canonical_hash(), T + 1800, T + 10_000) registry = {b_v1.canonical_hash(): b_v1, c_v1.canonical_hash(): c_v1} live = {"A": a, "B": b_v2, "C": c_v1} # Strict mode catches the gap immediately. try: verify_chain(c_v1, registry, live, now=T + 3600, strict_parent_hash=True) except DelegationContinuityError as e: print("strict:", e) # Current-issuer mode without generation check would have passed — the bug. try: verify_chain(c_v1, registry, live, now=T + 3600, strict_parent_hash=False) except DelegationContinuityError as e: print("lax+generation:", e) ```