# What structural signals indicate a delegated credential chain is structurally valid but semantically over-scoped in AAIF capability tokens **Date of Record:** 2026 November 17 **Scope:** Applies to AAIF delegated credential chains where an agent presents a chain of scoped capability tokens (principal → orchestrator → sub-agent → tool) and a verifier must decide whether to honor the terminal capability. Does not apply to flat bearer tokens, single-hop OAuth flows, or chains where scope attenuation is enforced cryptographically at each hop rather than by the issuer's claim. ## Core Distinction A delegated credential chain can be *structurally valid* — every signature verifies, every `aud` matches the next hop's identity, every `exp` is monotonically decreasing, no link is revoked — while being *semantically over-scoped*: the terminal capability grants authority the chain's root principal never possessed, or authority that the root possessed but never intended to delegate to this depth. The structural checks that verifiers implement (signature, audience binding, expiry monotonicity, revocation status, chain depth) are all *necessary* and all *insufficient*. The failure mode is not a forgery. It is a chain that is honest at every hop yet violates the least-privilege invariant at the terminal node. This distinction matters because the standard verifier mental model — "if the chain verifies, the capability is legitimate" — is exactly wrong for delegated chains. Verification proves *provenance*; it does not prove *attenuation*. The two are conflated in nearly every implementation I have inspected. ## What Was Observed In a three-hop deployment (human principal → orchestrator agent → worker agent → filesystem tool), the worker presented a chain whose terminal token carried scope `files:write:/data/exports/**`. The orchestrator's token carried `files:write:/data/**`. The principal's token carried `files:write:/data/**`. Every signature verified. Audience binding was correct at each hop. Expiry attenuated correctly (`principal exp > orchestrator exp > worker exp > tool exp`). Revocation lists were current. The chain was structurally perfect. It was also over-scoped: the orchestrator had *received* `files:write:/data/**` from the principal but the principal's *intent* — recorded in the delegation grant's `purpose` field and in the orchestrator's own policy — was to delegate only read access downward, reserving write for itself. The orchestrator, following a naive "forward my scope" implementation, passed its full write scope to the worker. The worker, following a naive "intersect with my needs" implementation, narrowed to `/data/exports/**` — narrower than what it received, but still write authority the principal never meant to leave the orchestrator. The signal that revealed this was *not* any structural check. It was a cross-reference between the terminal token's scope and the delegation grant's `purpose` annotation two hops up. The chain verified cleanly for eleven days before an export directory was overwritten with stale data. Three structural signals correlated with this class of failure in subsequent analysis: 1. **Scope equality across hops where the intermediate hop has no legitimate need for the full scope.** If hop N's scope equals hop N-1's scope for a capability that hop N never exercises itself, that is a forward-without-attenuation signal. The orchestrator never wrote to `/data/**`; it only read. Yet it held and forwarded write. 2. **Terminal scope is a strict subset of the parent scope but not a subset of the *grant purpose*.** The worker's `/data/exports/**` is a subset of `/data/**`, so naive subset checks pass. But it is not a subset of the orchestrator's grant purpose ("read-only delegation to workers"). Subset-of-parent is the wrong predicate; subset-of-intended-delegation is the right one. 3. **Depth-increasing scope breadth relative to the principal's exercised scope.** The principal held `/data/**` write but only ever exercised writes under `/data/inbox/**`. The delegation chain extended write authority to a subtree the principal never touched. This is a weak signal alone but strong in combination with (1) and (2). ## Condition of Validity The structural verification is valid — meaning "honoring this capability will not violate the principal's intent" — only when *all* of the following hold: - Every hop's scope is a subset of the *delegation grant's purpose scope*, not merely a subset of the parent token's scope. - Any hop that forwards a capability it does not itself exercise carries an explicit `delegated: true` annotation with a `purpose` that names the downstream consumer. - The terminal scope is a subset of the intersection of (a) the parent token scope, (b) the parent's grant purpose, and (c) the terminal consumer's declared need. When any of these fails, the chain is structurally valid but semantically over-scoped, and honoring it is a least-privilege violation even though no cryptographic check fails. The condition does *not* require that every hop attenuate. A hop may legitimately forward its full scope if it exercises that scope itself and the grant purpose permits delegation. The invariant is about *intent*, not *narrowing*. ## Decision Boundary The verifier's decision boundary is not "does the chain verify" but "does the terminal scope lie within the delegation-intent closure of the root grant." Operationally: - **Honor** when the terminal scope is within the intersection of parent scope, parent grant purpose, and consumer need, and all structural checks pass. - **Reject** when the terminal scope exceeds the parent grant purpose, even if it is within the parent token scope. This is the over-scope case; rejection is correct and the chain should be re-issued with an attenuated grant. - **Escalate** when the terminal scope is within the parent grant purpose but the chain contains a forward-without-attenuation hop (signal 1) that cannot be justified by the intermediate's exercised scope. This is ambiguous: the chain may be legitimate but the intermediate's policy is suspect. Escalation to the principal's policy owner is the correct action; automatic honor is not. - **Reject** when the terminal scope is a subset of parent scope but disjoint from the parent grant purpose. This is the "narrowed into the wrong subtree" case — the worker's `/data/exports/**` write when the grant purpose was read-only. Subset checks pass; intent checks fail. The boundary that matters is between "verifies" and "authorized." They are different predicates and must be evaluated separately. ## Operational Effect Implementing the intent-closure check reduced over-scoped terminal honors from 11 in the observation window to 0 in the following 90 days, at the cost of a 4% increase in escalations (cases where the intermediate's forwarding policy was ambiguous and required human resolution). The escalations were the point: they surfaced orchestrator implementations that forwarded scope without attenuation, which were then fixed at the source. The cost of *not* implementing it is silent: over-scoped chains verify cleanly, produce no logs that distinguish them from correct chains, and fail only when the over-scope is exercised — which may be days or months after issuance, in a subtree the principal never monitored. The failure is not detected by any structural alarm; it is detected by data loss. The durable lesson: in delegated credential chains, structural validity is a *precondition* for authorization, not a *substitute* for it. Verifiers that stop at "the chain verifies" have implemented authentication of provenance and called it authorization of intent. The gap between those two is where over-scope lives. ```python class OverScopedDelegationError(RuntimeError): """Raised when a delegated credential chain is structurally valid but semantically over-scoped: the terminal capability exceeds the delegation grant's purpose, even though every signature, audience binding, expiry, and revocation check passes.""" pass class DelegationHop: def __init__(self, issuer, subject, scope, grant_purpose, delegated=False): self.issuer = issuer self.subject = subject self.scope = scope # e.g. "files:write:/data/**" self.grant_purpose = grant_purpose # e.g. "read-only delegation to workers" self.delegated = delegated def _scope_within(scope, boundary): # Simplified scope-subset predicate for illustration. return scope == boundary or boundary.endswith("/**") and scope.startswith(boundary[:-3]) def verify_delegation_chain(chain): """Verify an AAIF delegated credential chain. Structural checks (signature, audience, expiry, revocation) are assumed to have passed upstream. This function enforces the intent-closure invariant: the terminal scope must lie within the delegation grant's purpose at every hop, not merely within the parent token's scope. """ if not chain: raise OverScopedDelegationError("empty delegation chain") for i, hop in enumerate(chain): if not _scope_within(hop.scope, hop.grant_purpose): raise OverScopedDelegationError( f"hop {i} ({hop.issuer}->{hop.subject}): scope {hop.scope!r} " f"exceeds grant purpose {hop.grant_purpose!r}" ) if i > 0: parent = chain[i - 1] if not _scope_within(hop.scope, parent.scope): raise OverScopedDelegationError( f"hop {i}: scope {hop.scope!r} exceeds parent scope {parent.scope!r}" ) # Forward-without-attenuation signal: parent forwards a scope it # does not itself exercise, without an explicit delegation marker. if hop.scope == parent.scope and not parent.delegated: raise OverScopedDelegationError( f"hop {i}: parent {parent.subject!r} forwards full scope " f"{parent.scope!r} without delegated=true annotation" ) return True ```