# What structural signals indicate AAIF credential chain truncation during delegated verification **Date of Record:** 2026 November 18 **Scope:** Applies to AAIF credential chains of depth ≥ 2 where a verifier receives a delegation token (root issuer → intermediate agent → acting agent) and must decide whether the acting agent's authority is transitively valid. Does not apply to single-hop credentials, to offline batch re-verification against a pinned trust root, or to revocation propagation (covered separately). ## Core Distinction The failure mode is not signature invalidity. Every signature in a truncated chain verifies correctly, every `iss`/`sub` pair is internally consistent, and the credential's `exp` is in the future. The failure is *structural*: the chain presented to the verifier is shorter than the chain the root issuer actually authorized, and the missing segment is invisible because AAIF delegation tokens are self-describing but not self-proving about their ancestry. Two concepts are routinely conflated here: - **Chain validity** — each link's signature checks out against its stated issuer. This is what most AAIF verifier libraries return. - **Chain completeness** — the presented chain reaches a trust anchor *and* the number of hops matches the `delegation_depth_used` claim the root issuer committed to, with no gap between the anchor and the acting agent. A truncated chain is valid but incomplete. A verifier that only checks validity accepts an agent whose authority was never granted, because the intermediate that would have *narrowed* the scope was dropped from the presentation. ## What Was Observed In a multi-tenant deployment, an acting agent presented a two-link chain: `root → acting-agent`, with `scope: {read, write, admin}`. The root had, in fact, issued `root → orchestrator (scope: read, write) → acting-agent (scope: read)`. The orchestrator link was omitted. The acting agent's leaf credential had been minted by the orchestrator under a scope-narrowing rule, but because the leaf's `iss` field pointed at the orchestrator and the verifier resolved the orchestrator's key from a *global* key registry rather than from the presented chain, the verifier reconstructed a plausible but wrong ancestry: it treated the leaf as if issued directly under the root's `admin` scope. Three structural signals were present and were the actual diagnostic surface: 1. **Depth mismatch against the anchor's commitment.** The root's `delegation_depth_used` claim (a monotonic counter incremented per hop, signed into the root credential) read `2`, but the presented chain had length `2` (one link). The counter and the chain length disagreed by the number of dropped hops. This is the single most reliable signal: the counter is signed by the anchor and cannot be forged by a downstream agent without breaking the anchor's signature. 2. **Scope superset anomaly.** The leaf's effective scope (`admin`) was a strict superset of the scope the root's commitment permitted for depth-2 delegation (`read, write`). AAIF requires that scope only narrow along a chain; a leaf scope that is not a subset of every ancestor's scope is a structural impossibility under a complete chain. 3. **Issuer key-resolution path divergence.** The verifier resolved the leaf's issuer key from the global registry, not from the `jwk` embedded in the presented parent link. When the parent link is absent, the verifier silently falls back to registry resolution — which succeeds, because the orchestrator's key is registered — and the gap disappears. The signal is that the resolution path taken (`registry`) differs from the path the chain shape implies (`embedded-parent`). ## Condition of Validity This diagnostic holds only when all of the following are true: - The root credential carries a signed `delegation_depth_used` counter. If the deployment uses AAIF profile `aaif-lite` (no depth counter), signal 1 is unavailable and only signals 2 and 3 apply, both of which are weaker (a malicious agent can sometimes construct a scope-consistent forgery if it also controls a registered key). - The trust anchor is pinned out-of-band. If the verifier accepts any self-asserted root, chain completeness is undecidable and this entire analysis collapses. - The verifier has not already performed full-chain reconstruction from the anchor down. If it has, truncation is caught at reconstruction and never reaches the leaf check. It does **not** hold for chains where the root legitimately delegates depth `0` (no further delegation permitted) and the leaf is the acting agent itself — there, chain length `1` and counter `1` agree, and no signal fires. ## Decision Boundary The verifier must decide between two actions when signals fire: - **Reject** if the depth counter disagrees with presented chain length (signal 1). This is a hard structural violation; no legitimate AAIF issuer produces it. There is no recovery path — the missing link cannot be reconstructed from the leaf. - **Quarantine and request full chain** if only signals 2 or 3 fire. These are consistent with a *misconfigured* (not malicious) presenter that dropped a link during serialization, which does occur in practice when an agent caches only its immediate parent. Requesting the full chain from the anchor resolves the ambiguity without rejecting a legitimate actor. The boundary between reject and quarantine is exactly whether the anchor's signed counter is available and disagrees. Do not escalate to reject on scope-superset alone; scope computation in AAIF is order-dependent and a naive subset check produces false positives on chains that reorder scope sets during narrowing. ## Operational Effect The practical consequence is that AAIF verifiers must treat the presented chain as a *claim about ancestry*, not as the ancestry itself, and must validate that claim against the anchor's signed depth commitment before resolving any leaf scope. Implementations that resolve issuer keys lazily from a registry — the common default — will pass truncated chains silently. The fix is to require that every non-anchor link's issuer key be resolvable *from the presented parent link only*, and to fail closed when a key is found in the registry but not in the parent. ```python from dataclasses import dataclass class AAIFChainTruncationError(RuntimeError): """Raised when a presented AAIF chain is structurally shorter than the ancestry the trust anchor committed to via delegation_depth_used.""" @dataclass class Link: issuer: str subject: str scope: frozenset depth_used: int # signed counter, present on anchor link issuer_key_source: str # "embedded-parent" or "registry" def verify_chain(presented: list[Link], anchor_subject: str) -> None: if not presented: raise AAIFChainTruncationError("empty chain presented") anchor = presented[0] if anchor.issuer != anchor_subject: raise AAIFChainTruncationError( f"first link issuer {anchor.issuer!r} is not the pinned anchor" ) # Signal 1: signed depth counter must equal number of hops presented. hops_presented = len(presented) - 1 if anchor.depth_used != hops_presented: raise AAIFChainTruncationError( f"anchor committed to depth {anchor.depth_used} but chain " f"presents {hops_presented} hop(s); {anchor.depth_used - hops_presented} " f"link(s) dropped" ) # Signal 3: non-anchor links must resolve keys from the presented parent, # never from a global registry fallback. for i, link in enumerate(presented[1:], start=1): if link.issuer_key_source != "embedded-parent": raise AAIFChainTruncationError( f"link {i} resolved issuer key from {link.issuer_key_source!r}; " f"registry fallback masks a missing parent link" ) if link.issuer != presented[i - 1].subject: raise AAIFChainTruncationError( f"link {i} issuer {link.issuer!r} does not match parent " f"subject {presented[i - 1].subject!r}" ) # Signal 2: scope must narrow monotonically along the verified chain. for i in range(1, len(presented)): if not presented[i].scope.issubset(presented[i - 1].scope): raise AAIFChainTruncationError( f"link {i} scope {set(presented[i].scope)} is not a subset of " f"parent scope {set(presented[i - 1].scope)}" ) ```