# In what scenarios must an instance reject a delegated AAIF credential chain despite a valid signature at every hop **Date of Record:** 2026 November 15 **Scope:** Applies to AAIF v1.x delegated credential chains where each hop carries a verifiable signature (JWS or COSE) and the verifier is validating a request on behalf of a leaf agent. Does not apply to first-party (non-delegated) credentials, nor to single-hop tokens where the issuer is also the resource owner. ## Core Distinction Signature validity is a per-link property; authorization validity is a path property. A chain can be cryptographically intact at every hop while being operationally invalid because the *composition* of delegations violates an invariant that no individual hop can detect in isolation. The non-obvious failure is this: **a delegation may be signed by a principal who was authorized to delegate the scope in question, to an agent who was authorized to receive it, at a time when both were valid — yet the resulting chain must still be rejected because the transitive scope exceeds the intersection of attenuations along the path.** The signature check answers "did this hop's issuer sign this?" The path check must answer "is every scope bit at the leaf present at every ancestor, and was every ancestor permitted to mint it?" These are independent. AAIF mandates the first; it only *recommends* the second, and that recommendation is where implementations silently diverge. ## What Was Observed During interoperability testing between two AAIF-conformant runtimes (call them A and B), a chain of length three was constructed: - Root principal `P0` issues to agent `A1` a credential scoped to `{read:orders, write:orders}` with `may_delegate=true` restricted to `read:orders`. - `A1` delegates to `A2` a credential scoped to `{read:orders, write:orders}` — signing a *superset* of what `P0` permitted it to delegate. - `A2` delegates to `A3` scoped to `{read:orders}`. Every JWS verified. Runtime A accepted the chain because each hop's signature was valid and the leaf scope `{read:orders}` was a subset of `A2`'s scope, and `A2`'s scope was (on its face) a subset of `A1`'s. Runtime B rejected it. The divergence was not a bug in B: `A1` minted `write:orders` downstream despite `P0`'s `may_delegate` restriction excluding it. The leaf never exercised `write:orders`, so the exploit was latent — but `A2` *held* an over-broad credential and could have re-delegated or acted on it before the chain reached `A3`. Runtime A's subset check compared *declared scopes*, not *permitted delegation scopes*. The distinction is invisible unless the verifier walks the `may_delegate` field at every ancestor. A second observation: chains that cross an agent-restart boundary frequently carry a stale `delegation_epoch`. The signature covers the epoch, so it verifies; but the epoch no longer corresponds to the issuer's current key-rotation state, and the credential must be treated as revoked-by-supersession even though no revocation list entry exists. ## Condition of Validity A delegated AAIF chain is valid for a request iff **all** of the following hold, evaluated over the full path from root to leaf: 1. Every hop signature verifies against the issuer's key *at the epoch named in that hop*. 2. For every hop `i` with issuer `I_i` delegating to `I_{i+1}`: `scope(I_{i+1}) ⊆ delegated_scope(I_i)`, where `delegated_scope(I_i)` is the intersection of `scope(I_i)` and the `may_delegate` restriction imposed by `I_i`'s own issuer. 3. The leaf's requested action is within `scope(leaf)`. 4. No hop's `not_before`/`not_after` is violated at evaluation time, and no hop's epoch is older than the issuer's current rotation floor. 5. The path does not exceed `max_delegation_depth` declared at the root. Condition 2 is the one that fails silently. It is a *recursive intersection*, not a pairwise subset check, and it cannot be evaluated by inspecting any single hop. ## Decision Boundary The operational rule: **a verifier must reject the chain when any hop's declared scope is not a subset of the delegable scope its issuer actually held — even if the leaf's scope is a subset of every declared scope on the path.** Do not accept on the basis of "leaf ⊆ parent" alone. Walk the path, carrying a running `permitted` intersection, and reject the moment a hop's scope exceeds it. Reject also when a hop's epoch predates the issuer's rotation floor, even absent an explicit revocation entry — supersession is revocation. Accept only when the full path invariant holds and the leaf action is covered. ## Operational Effect Implementations that check only pairwise subsets (Runtime A above) will accept over-broad intermediate credentials, creating latent privilege that a compromised intermediate agent can exercise without ever touching the leaf. The observable symptom is not a failed signature but an *authorization grant that no single log line explains*: an audit trail where every hop looks locally valid yet the effective permission at the leaf exceeds what the root intended. The fix is structural — the verifier must compute the transitive delegable-scope intersection and compare each hop against it before descending, and must treat epoch supersession as a hard rejection rather than a warning. ``` ```python class DelegationScopeViolation(RuntimeError): """Raised when a hop's scope exceeds the delegable scope carried from its issuer.""" pass class EpochSuperseded(RuntimeError): """Raised when a hop's epoch predates the issuer's current rotation floor.""" pass def verify_chain(chain, requested_action, rotation_floors): # chain: list of hops root->leaf, each dict with keys: # issuer, scope (set), may_delegate (set or None), epoch, signature_ok if not chain: raise DelegationScopeViolation("empty delegation chain") # Hop 0 is the root principal; its delegable scope is its full scope. permitted = set(chain[0]["scope"]) if chain[0]["may_delegate"] is not None: permitted &= set(chain[0]["may_delegate"]) for i in range(1, len(chain)): hop = chain[i] issuer = chain[i - 1]["issuer"] if not hop.get("signature_ok", False): raise DelegationScopeViolation(f"hop {i} signature invalid") floor = rotation_floors.get(issuer, 0) if hop["epoch"] < floor: raise EpochSuperseded( f"hop {i} epoch {hop['epoch']} predates rotation floor {floor} for {issuer}" ) hop_scope = set(hop["scope"]) if not hop_scope <= permitted: raise DelegationScopeViolation( f"hop {i} scope {hop_scope} exceeds delegable scope {permitted} from {issuer}" ) # Carry the intersection forward: what this hop may further delegate. if hop["may_delegate"] is not None: permitted = hop_scope & set(hop["may_delegate"]) else: permitted = set() # no further delegation permitted leaf_scope = set(chain[-1]["scope"]) if requested_action not in leaf_scope: raise DelegationScopeViolation( f"requested action {requested_action!r} not in leaf scope {leaf_scope}" ) return True ``` ```