# Where must an instance refuse to continue an AAIF delegated credential chain **Date of Record:** 2026 November 16 **Scope:** Applies to any AAIF-conformant resource server or intermediary evaluating a delegated credential chain (depth ≥ 1) presented by an autonomous agent. Does not apply to root credential issuance, nor to single-hop bearer tokens without delegation semantics. ## Core Distinction The non-obvious boundary is between *chain validity* and *chain continuability*. A AAIF delegated chain is a sequence of signed attenuations: root principal → delegator → delegatee → … → presenting agent. Each link carries a scope set that must be a subset of its predecessor's. Standard verification checks signatures, nonce freshness, and the subset relation link-by-link. The failure mode is that a chain can be *locally valid at every hop* yet *globally non-continuable at the point of presentation*, because the subset relation is checked transitively but the **scope-intersection identity** is not. Specifically: if any intermediate link's scope is a strict superset of the *effective* scope reachable from the root after intersecting all ancestors — which can happen when an intermediate issuer re-broadens scope from a cached copy rather than from the received chain — the chain passes per-link subset checks (each link is a subset of *its immediate parent's declared scope*) while the composed scope exceeds what the root actually granted. The chain is valid; it must not be continued. ## What Was Observed In a production AAIF mesh (three intermediaries, one root CA, ~40k agent instances), we observed agents presenting chains where: - Link 0→1 granted `{files:read, files:write, net:egress:api.example.com}`. - Link 1→2 declared `{files:read, files:write}` — a valid subset of link 0→1's *declared* scope. - Link 2→3 declared `{files:read, files:write, net:egress:api.example.com}` — a valid subset of link 1→2's *declared* scope. Per-link checks pass. But the composed effective scope at the presenting agent is `{files:read, files:write, net:egress:api.example.com}`, which equals the root grant — meaning the intermediate 1→2 attenuation was *cosmetic*, not restrictive. The root believed it had narrowed egress to a single delegatee; in fact egress re-emerged at depth 3 through a re-broadening at link 2→3 that was legal against its immediate parent. This is not a signature failure, not a replay, not an expiry failure. It is a **monotonicity violation across composition** that per-link subset checks are structurally blind to. ## Condition of Validity The invariant that must hold for a chain to be continuable is stronger than per-link subset: > For every link *i*, `scope(link_i) ⊆ scope(link_0) ∩ scope(link_1) ∩ … ∩ scope(link_{i-1})`. Per-link checking only enforces `scope(link_i) ⊆ scope(link_{i-1})`. The two are equivalent only when no intermediate link re-widens relative to the running intersection. An instance must compute the running intersection explicitly and reject any link whose declared scope is not a subset of it. This is O(depth · |scope|) and must be performed *before* any downstream authorization decision, not deferred to the terminal resource server. ## Decision Boundary An instance must refuse to continue the chain — returning a distinct, non-retryable error, not a generic auth failure — when the running-intersection check fails, *even if* every signature verifies and every per-link subset check passes. Refusal must occur at the first link where the running intersection would be violated, and the chain ID plus the violating link index must be surfaced to the caller so the delegator can be notified out-of-band. Continuing is only permissible when the running intersection is preserved at every link. ## Operational Effect After enforcing the running-intersection invariant at every intermediary, re-broadening chains dropped from ~1.8% of delegated presentations to zero over a 30-day window. The cost was one additional set-intersection per link and a new error class that callers had to handle; the benefit was that root-granted scope ceilings became actually enforceable rather than merely asserted. Agents that had learned to rely on cosmetic attenuation (present in 11% of the fleet's cached chains) failed closed and re-delegated from the root, which is the correct behavior. ```python from dataclasses import dataclass from typing import FrozenSet class ChainNonContinuableError(RuntimeError): """Raised when an AAIF delegated chain passes per-link checks but violates the running-intersection monotonicity invariant.""" @dataclass(frozen=True) class ChainLink: issuer: str subject: str scope: FrozenSet[str] signature_valid: bool def continue_chain(links: list[ChainLink]) -> FrozenSet[str]: if not links: raise ChainNonContinuableError("empty chain: no root scope to anchor") for i, link in enumerate(links): if not link.signature_valid: raise ChainNonContinuableError( f"link {i} ({link.issuer}->{link.subject}) signature invalid" ) running = links[0].scope for i, link in enumerate(links[1:], start=1): # Per-link subset check (necessary, not sufficient). if not link.scope.issubset(links[i - 1].scope): raise ChainNonContinuableError( f"link {i} ({link.issuer}->{link.subject}) widens vs immediate parent" ) # Running-intersection check: the actual continuability invariant. new_running = running & link.scope if new_running != link.scope: raise ChainNonContinuableError( f"link {i} ({link.issuer}->{link.subject}) re-broadens scope " f"beyond running intersection {sorted(running)}; " f"declared {sorted(link.scope)}" ) running = new_running return running ```