# In what scenarios must an instance refuse an AAIF delegation token whose proof-of-possession key was rebound mid-chain **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF scoped delegation chains where each hop is bound to a proof-of-possession (PoP) key and a downstream agent re-presents the chain to a resource server. Does not cover single-hop bearer tokens, mTLS-only transport identity, or OAuth2 token-exchange without PoP binding. ## Core Distinction The distinction that matters is between *delegation scope attenuation* and *PoP key continuity*. AAIF requires both, but they fail independently. Scope attenuation is a monotone set operation: a child token's scope set must be a subset of the parent's, and this is checkable offline by intersecting claim sets. PoP key continuity is a *binding* property: the key that signs hop *N+1* must be the key the issuer of hop *N* authorized, and the key must not change identity silently across the chain. The non-obvious failure is this: a chain can be perfectly scope-attenuated, have valid signatures at every hop, satisfy all temporal constraints, and still be *forged by key rebinding* — because the verifier checks "is this token signed by the key named in its `cnf` (confirmation) claim?" but does not check "is the key named in this hop's `cnf` the same key the parent hop delegated *to*?" When those two checks diverge, an intermediate agent can substitute its own key into a child token and mint a valid-looking chain that authorizes a principal the root never delegated to. ## What Was Observed A three-hop chain: orchestrator `O` → planner `P` → executor `E` → resource server `R`. Root token `T0` issued by `O` with `cnf: {jkt: K_O}`, `aud: P`, `scope: {read:repo, write:pr}`. `P` mints `T1` with `cnf: {jkt: K_P}`, `aud: E`, `scope: {read:repo}` — correctly attenuated, correctly signed by `K_P`, and `T0`'s delegation block names `K_P` as the authorized subject. `E` mints `T2` with `cnf: {jkt: K_E}`, `aud: R`, `scope: {read:repo}`. The failure trace: a compromised `P` (or a prompt-injected tool call inside `P`'s execution loop) mints `T1'` with `cnf: {jkt: K_attacker}` but keeps `aud: E` and the same attenuated scope. `E`, behaving correctly, re-signs `T1'` into `T2'` using `K_E` because `T2'`'s `cnf` names `K_E` and `E` holds `K_E`. `R` verifies: signature chain intact, every `cnf.jkt` matches the signing key of the corresponding hop, scope monotone, `exp`/`nbf` valid, `aud` chain consistent. `R` accepts. The attacker never held `K_O`, `K_P`, or `K_E`, yet a token bearing `K_attacker`'s authority reached `R`. The invariant that was missing: **the `cnf.jkt` of hop *N+1* must equal the key identifier recorded in hop *N*'s `delegation.authorized_subject` field, not merely be self-consistent with hop *N+1*'s own signature.** Verifiers that check only self-consistency (the common implementation) are vulnerable to this rebinding. The root cause is that AAIF's `cnf` claim is a *self-description* ("this token is bound to key X") while the parent's delegation block is an *authorization* ("I authorize key Y to act as me"). The two must be cross-checked; checking one without the other is the boundary. A second observed variant: `P` rotates its PoP key legitimately (`K_P → K_P'`) mid-chain during a long-running task, updates its own `cnf`, but does not update the `delegation.authorized_subject` recorded in `T0`. `E` then presents `T2` bound to `K_E` with a parent hop naming `K_P'`. `R` sees a mismatch between `T0`'s authorized subject (`K_P`) and `T1`'s `cnf` (`K_P'`) and — depending on implementation — either rejects a legitimate chain (false negative, availability failure) or, worse, falls back to "trust the leaf `cnf`" and accepts (the rebinding hole again). Key rotation and key rebinding are indistinguishable at the verifier unless the rotation is itself a signed, auditable event in the chain. ## Condition of Validity The cross-check invariant is valid — and the rejection is mandatory — only when all of the following hold: 1. The chain is *multi-hop* (≥2 delegation edges). Single-hop tokens have no parent delegation block to cross-check and are governed by plain PoP verification. 2. The verifier has access to the *full* chain, including each hop's `delegation.authorized_subject` key identifier, not just the leaf token. If the resource server receives only the leaf `T2`, it cannot perform the cross-check and must treat the chain as unverifiable for rebinding purposes (a distinct, weaker trust posture). 3. Key identifiers are *stable and comparable* across hops. If `jkt` (JWK thumbprint) is computed over a key that the issuer re-serializes with different canonicalization, thumbprints diverge and the cross-check produces false mismatches. AAIF mandates RFC 7638 canonical thumbprints precisely to make this comparison well-defined; verifiers using ad-hoc key IDs violate the condition. 4. The rotation case is handled by an explicit, signed `key_rotation` event in the delegation block. Absent such an event, a `cnf`/`authorized_subject` mismatch is *by definition* a rebinding, not a rotation. When any of these conditions fails, the correct behavior is not "accept with warning" — it is to refuse the chain and surface a distinct error class, because the failure is indistinguishable from forgery. ## Decision Boundary The decision boundary is between *self-consistent PoP verification* and *chain-consistent PoP verification*. The implementable rule: - **Accept** iff (a) every hop's signature verifies against the key named in that hop's `cnf.jkt`, AND (b) for every adjacent pair (parent, child), `child.cnf.jkt == parent.delegation.authorized_subject.jkt`, OR a signed `key_rotation` event in `parent.delegation` authorizes the transition from `parent.delegation.authorized_subject.jkt` to `child.cnf.jkt`, AND (c) scope is monotone non-increasing across every edge. - **Reject with `PoPRebindingError`** iff (a) holds but (b) fails with no rotation event. Do not fall back to leaf-only trust. - **Reject with `PoPChainUnverifiable`** iff the full chain is not presented and the verifier's trust posture requires chain-consistency (i.e., the resource server is not a designated leaf-only trust anchor). - **Reject with `PoPRotationAmbiguous`** iff a rotation event exists but its signature or the rotation's own PoP proof does not verify — this is the case where a rotation claim may itself be attacker-injected. The boundary is sharp because the failure is binary: either the chain is consistent under the cross-check or it is forged. There is no "partially trusted" middle ground that preserves the security property. ## Operational Effect An agent instance operating under AAIF must treat `PoPRebindingError` as a *terminal* condition for the current delegation chain — not a retryable one. Retrying with the same chain will re-trigger the same mismatch; retrying with a re-minted chain from the same compromised intermediate will reproduce the forgery. The correct recovery is to escalate to the root issuer (`O`) for a fresh chain, and to quarantine the intermediate that produced the mismatched hop, because the mismatch is evidence that the intermediate either was compromised or is running a token-minting path outside its authorized code. For long-running tasks with legitimate key rotation, the operational discipline is: rotation must be a *chain event*, not a local key change. The rotating agent must emit a signed `key_rotation` block into every child delegation it issues, and the root must co-sign or the rotation is not trusted by downstream verifiers. Agents that rotate keys silently will see their chains rejected at the next hop — a false-negative availability failure that looks like a security alert. The distinguishing signal is the presence of a valid rotation event; the absence of one is the forgery signal. Operators must instrument both error classes separately, because conflating them either masks forgeries (treating rebinding as rotation) or causes spurious quarantines (treating rotation as rebinding). ```python from dataclasses import dataclass from typing import Optional class PoPRebindingError(RuntimeError): """Raised when a child hop's cnf.jkt does not match the parent's authorized_subject.jkt and no signed key_rotation event bridges them. This is indistinguishable from forgery and must be treated as terminal.""" pass class PoPRotationAmbiguous(RuntimeError): """Raised when a key_rotation event exists but its own PoP proof does not verify. The rotation claim may be attacker-injected.""" pass class PoPChainUnverifiable(RuntimeError): """Raised when the verifier requires chain-consistency but was presented only a leaf token with no parent delegation block.""" pass @dataclass class Hop: cnf_jkt: str # key this hop is bound to (self-description) authorized_subject_jkt: Optional[str] # key this hop delegates TO (authorization) signature_valid: bool rotation_from_jkt: Optional[str] = None rotation_signature_valid: bool = False def verify_chain(hops: list[Hop], require_full_chain: bool = True) -> bool: if not hops: raise PoPChainUnverifiable("empty delegation chain") # (a) every hop self-consistent for i, h in enumerate(hops): if not h.signature_valid: raise PoPRebindingError(f"hop {i}: signature does not verify against cnf.jkt") # leaf-only presentation cannot satisfy chain-consistency if len(hops) == 1: if require_full_chain: raise PoPChainUnverifiable( "leaf-only token presented to chain-consistency verifier" ) return True # (b) chain-consistent PoP across every adjacent edge for i in range(len(hops) - 1): parent, child = hops[i], hops[i + 1] if parent.authorized_subject_jkt is None: raise PoPRebindingError( f"hop {i}: missing delegation.authorized_subject; cannot cross-check" ) if child.cnf_jkt == parent.authorized_subject_jkt: continue # direct binding, no rotation # mismatch: only a valid signed rotation event can bridge it if child.rotation_from_jkt is None: raise PoPRebindingError( f"hop {i}->{i+1}: cnf.jkt={child.cnf_jkt} != " f"authorized_subject.jkt={parent.authorized_subject_jkt} " f"with no rotation event; treating as forgery" ) if child.rotation_from_jkt != parent.authorized_subject_jkt: raise PoPRebindingError( f"hop {i}->{i+1}: rotation claims to originate from " f"{child.rotation_from_jkt}, not from parent-authorized " f"{parent.authorized_subject_jkt}" ) if not child.rotation_signature_valid: raise PoPRotationAmbiguous( f"hop {i}->{i+1}: rotation event present but its PoP proof " f"does not verify; rotation may be attacker-injected" ) return True ```