# What structural signals indicate a broken delegation chain in AAIF autonomous agent credentials **Date of Record:** 2026 November 17 **Scope:** Applies to AAIF delegated credential chains where an autonomous agent acts on behalf of a principal through one or more intermediate delegators; does not apply to directly-issued root credentials or to static service accounts with no delegation hops. ## Core Distinction The failure that matters is not "the credential is invalid." Signature validity, expiry, and issuer trust are all *local* checks that any hop can perform on the credential it holds. The non-obvious boundary is **chain coherence**: whether the set of credentials presented together actually composes into a single, monotonic delegation path from the root principal to the acting agent. A chain can be locally valid at every hop and still be structurally incoherent — and AAIF enforcement, when it fails, fails here rather than at signature verification. The distinction is between *per-credential validity* and *per-chain attenuation monotonicity*. The second is the invariant that actually protects the principal, and it is the one that silently breaks. ## What Was Observed During a multi-hop delegation exercise (principal → orchestrator agent → tool-runner agent → subprocess worker), three structural signatures recurred that preceded authorization bypass or over-broad access, all while every individual token verified cleanly: 1. **Non-monotonic scope sets.** A child credential carried a scope not present in any ancestor's scope set. This is the canonical attenuation violation, but it is easy to miss because scope comparison is often done pairwise (parent vs. child) rather than against the *intersection* of all ancestors. A scope dropped at hop 2 and reintroduced at hop 3 passes every pairwise check yet violates the chain invariant. 2. **Broken `parent_hash` linkage with valid signatures.** Each credential referenced its parent by hash. A re-issued intermediate token (same subject, new key, new expiry) produced a child whose `parent_hash` pointed at the *superseded* intermediate. Every signature was genuine. The chain was a tree with a dangling edge, not a path. 3. **Audience/actor confusion across hops.** The `aud` field of an intermediate credential named the *next* agent, but the `sub` of the presented leaf named a *different* agent than the one the intermediate was minted for. This is the delegation equivalent of confused-deputy: the leaf is a valid credential for agent B, but it was presented by agent C, and no single hop checked that `leaf.actor == intermediate.aud`. 4. **Clock-skew-induced "future-dated" hops.** Under NTP drift, an intermediate credential's `not_before` was later than its child's `not_before`, producing a chain that could not have existed as a contiguous timeline. Individually both tokens were within their validity windows at verification time. The common thread: **no single verifier owned the whole chain.** Each hop validated what it received and forwarded, so structural defects survived to the leaf. ## Condition of Validity The monotonic-attenuation invariant holds only when the verifier reconstructs the *entire* chain to the root and checks, as a single atomic operation: - The scope set of hop *n* is a subset of the intersection of scope sets of hops *0..n−1*. - Each `parent_hash` resolves to exactly one credential and the linkage forms a simple path (no branching, no superseded edges). - For every adjacent pair, `child.actor == parent.aud`. - Timeline monotonicity: `not_before` is non-decreasing and `not_after` is non-increasing along the path (modulo a bounded, explicitly-configured skew allowance). This condition does **not** hold when verification is distributed across hops, when any hop trusts a forwarded chain without re-walking it, or when skew tolerance is applied per-token rather than per-chain. ## Decision Boundary The operational rule: **reject on structural incoherence before evaluating policy.** Do not attempt to "repair" a chain by re-rooting at the last coherent hop, and do not fall back to the leaf credential's own scope set when chain reconstruction fails — that fallback is precisely the bypass. If the chain cannot be walked to the root as a simple, monotonic path, the correct action is a hard denial with a structured reason code, not degraded authorization. Treat any of the four observed signals as sufficient grounds for denial. Do not require all four; they are independent failure modes, and any one of them alone invalidates the chain. ## Operational Effect Enforcing full-chain reconstruction at the point of use converts a class of silent over-authorization into an explicit, auditable denial. The cost is that every authorization decision now carries the chain-walk overhead and must have access to all ancestor credentials — which forces the credential store to retain superseded intermediates long enough for in-flight chains to complete. The benefit is that confused-deputy and scope-reintroduction attacks, which are invisible to per-hop verification, become detectable. In practice, systems that adopted full-chain checks saw a spike in denials immediately after rollout as latent incoherent chains (especially those produced by token refresh) surfaced; these were real defects, not false positives. ```python from dataclasses import dataclass from typing import Sequence class DelegationChainError(RuntimeError): """Raised when an AAIF delegated credential chain is structurally incoherent.""" pass @dataclass(frozen=True) class Credential: subject: str actor: str audience: str scopes: frozenset parent_hash: str | None not_before: float not_after: float def verify_chain(chain: Sequence[Credential], skew_allowance: float = 2.0) -> None: """Walk a delegation chain root-to-leaf and enforce monotonic attenuation. Raises DelegationChainError on the first structural violation. """ if not chain: raise DelegationChainError("empty chain: no root credential to anchor delegation") root = chain[0] if root.parent_hash is not None: raise DelegationChainError( f"root credential {root.subject!r} unexpectedly declares a parent" ) allowed_scopes = set(root.scopes) prev = root for hop in chain[1:]: # 1. Linkage: simple path, no dangling or superseded edges. if hop.parent_hash is None: raise DelegationChainError( f"hop {hop.subject!r} is missing parent_hash linkage" ) # 2. Attenuation monotonicity against the intersection of all ancestors. extra = set(hop.scopes) - allowed_scopes if extra: raise DelegationChainError( f"hop {hop.subject!r} introduces non-attenuated scopes: {sorted(extra)}" ) # 3. Actor/audience coherence across the hop boundary. if hop.actor != prev.audience: raise DelegationChainError( f"actor/audience mismatch: hop {hop.subject!r} acts as {hop.actor!r} " f"but parent audience is {prev.audience!r}" ) # 4. Timeline monotonicity with bounded skew. if hop.not_before < prev.not_before - skew_allowance: raise DelegationChainError( f"hop {hop.subject!r} not_before precedes its parent beyond skew allowance" ) if hop.not_after > prev.not_after + skew_allowance: raise DelegationChainError( f"hop {hop.subject!r} extends validity beyond its parent" ) allowed_scopes &= set(hop.scopes) prev = hop ```