# How does an instance detect scope-attenuation forgery when a delegated AAIF credential is re-signed by an intermediate agent? **Date of Record:** 2026 November 25 **Scope:** Applies to AAIF (Agent Identity & Authorization Interop Framework) verifiable-credential chains where an intermediate agent (a "broker" or "delegator") exchanges a scoped token for a narrower one and re-signs it for a downstream agent. Does not apply to single-hop credentials issued directly by a root authority, nor to opaque bearer tokens without a credential chain. ## Core Distinction AAIF delegation is built on the assumption that **scope monotonically narrows across a chain**: agent A holds `scope={read:orders, write:orders}`, delegates to B a token with `scope={read:orders}`, and B may delegate further to C with `scope={read:orders, region:eu}` — but never with a scope that is not a subset of what B held. The verifier at the leaf trusts this by checking each credential's `parent_scope` against the `child_scope` it encloses, walking the chain back to the root issuer. The failure mode is not a broken signature. Every signature in the chain verifies correctly. The failure is that **the attenuation check is performed against the *declared* parent scope in the credential body, not against the *effective* scope that the parent actually held at signing time**. An intermediate agent that has itself been silently narrowed — or that has been compromised into over-claiming — can mint a child credential whose `parent_scope` field asserts a wider set than it actually possessed. The leaf verifier sees a consistent, well-signed, monotonic-looking chain. The invariant "child ⊆ parent" holds *locally* at every hop, yet the *transitive* scope at the leaf can exceed the root grant. The distinction that matters: **signature validity is a per-hop property; scope containment is a transitive property.** AAIF's default verifier conflates them because it validates each hop's arithmetic in isolation and never reconstructs the effective scope from the root forward. ## What Was Observed A three-hop chain, root `R` → broker `B` → worker `W` → tool-agent `T`: - `R` issues to `B`: `scope={read:orders, write:orders, admin:false}`, signed `R`. - `B` is later narrowed by an operator to `scope={read:orders}` via a revocation-and-reissue that `B`'s credential store records, but `B`'s *delegation signing key* is unchanged and its cached "last known grant" still holds the original wider set. - `B` delegates to `W`: `parent_scope={read:orders, write:orders, admin:false}`, `child_scope={read:orders, write:orders}`, signed `B`. The hop check passes: child ⊆ parent. - `W` delegates to `T`: `parent_scope={read:orders, write:orders}`, `child_scope={write:orders}`, signed `W`. Passes. - `T` presents the chain to the resource server. Every signature verifies. Every local containment check passes. `T` is granted `write:orders`. But `B`'s *effective* grant at the moment it signed the `W` credential was `{read:orders}`. The `write:orders` capability at `T` was fabricated one hop up and laundered through two honest, correctly-signing intermediaries. The trace shows no cryptographic anomaly; the anomaly is entirely in the gap between the `parent_scope` field (a claim) and the parent's actual grant (a fact held elsewhere). The observable signature of this in logs: the leaf credential's `issuance_timestamp` for hop `B→W` postdates `B`'s narrowing event, yet `B`'s `parent_scope` claim still reflects the pre-narrowing grant. A verifier that only checks signatures and local containment never looks at that timestamp ordering against the parent's revocation log. ## Condition of Validity The "child ⊆ parent" per-hop check is sound **only if** the `parent_scope` field in each credential is itself authenticated against the parent's authoritative grant state at signing time. That requires one of: 1. The parent's credential carries a `grant_epoch` or `state_hash` that the verifier can resolve against the issuer's authoritative record, and the child embeds the parent's `state_hash` it was signed against. 2. The chain is verified **root-forward**: the verifier reconstructs effective scope by intersecting from `R`'s grant downward, treating each `parent_scope` as an unverified claim until reconciled with the resolved parent state. 3. Delegation signing keys are rotated in lockstep with grant narrowing, so a narrowed parent physically cannot produce a child asserting the old scope (key compromise becomes the only path, which is a different, detectable failure). Absent any of these, the per-hop check is valid only in the degenerate case where no parent is ever narrowed after issuance — i.e., a static-grant deployment. In any dynamic-grant deployment the invariant silently fails. ## Decision Boundary A verifier must **reject** a delegated chain — not merely warn — when it cannot reconcile a `parent_scope` claim with the parent's authoritative grant state at the child's `issuance_timestamp`. Concretely, the boundary is: - If the parent's grant state is resolvable and `parent_scope ⊄ resolved_parent_grant` → **reject** (forgery or stale-cache delegation). - If the parent's grant state is *not* resolvable (issuer unreachable, epoch unknown) → **reject for privileged scopes**, **degrade to root-intersection** for read-only scopes, because an unverifiable widening claim must never be trusted for mutating capabilities. - If `issuance_timestamp` of the child precedes the parent's most recent `grant_epoch` transition → **reject**, because the child was signed against a superseded grant. The tempting-but-wrong boundary is "reject only if a signature fails." That boundary is what produced the observed over-grant. The correct boundary treats **scope containment as a root-forward transitive computation over resolved state**, and treats any `parent_scope` field as inadmissible evidence until reconciled. ## Operational Effect Downstream, the effect is a **capability-laundering channel**: an honest intermediary with a stale delegation cache, or a compromised one, becomes a mint for scopes it does not hold, and the forgery is *structurally indistinguishable* from a legitimate chain to any verifier that checks hops in isolation. Because the forged scope passes through correctly-signing honest agents, audit logs attribute the over-grant to the leaf `T`, not to the hop where the widening was injected — misattributing the incident and leaving the actual injection point (`B`'s stale cache) unpatched. The guardrail that bounds it: root-forward scope reconstruction with `grant_epoch` reconciliation, mandatory rejection of unreconcilable widening claims for mutating scopes, and timestamp-ordering checks against the parent's revocation log. Verifiers that adopt per-hop-only checking remain exploitable indefinitely, because the exploit requires no cryptographic break — only a parent whose declared scope has drifted from its effective scope. ```python import time from dataclasses import dataclass, field from typing import Optional class ScopeAttenuationForgery(RuntimeError): """Raised when a delegated credential's declared parent_scope exceeds the parent's authoritative grant at the child's issuance time.""" @dataclass class GrantState: scope: frozenset epoch: int effective_at: float @dataclass class Credential: issuer: str subject: str parent_scope: frozenset child_scope: frozenset issuance_timestamp: float signature_valid: bool = True def resolve_grant(issuer: str, at_time: float) -> Optional[GrantState]: # Authoritative lookup against the issuer's grant log. Returns None if # the issuer's state is unreachable or the epoch is unknown. ... def verify_chain(chain: list[Credential], root_scope: frozenset) -> frozenset: """Root-forward verification. Returns the effective leaf scope or raises.""" effective = frozenset(root_scope) for hop in chain: if not hop.signature_valid: raise ScopeAttenuationForgery( f"signature invalid at hop {hop.issuer}->{hop.subject}" ) # Local containment is necessary but NOT sufficient. if not hop.child_scope <= hop.parent_scope: raise ScopeAttenuationForgery( f"local containment violated at {hop.subject}" ) # Reconcile the declared parent_scope against authoritative state. state = resolve_grant(hop.issuer, hop.issuance_timestamp) if state is None: # Unverifiable widening claim: forbid for mutating scopes. if any(s.startswith("write:") or s.startswith("admin:") for s in hop.child_scope): raise ScopeAttenuationForgery( f"cannot resolve grant for {hop.issuer}; " f"refusing privileged scope {hop.child_scope}" ) # Read-only degrade: intersect with root, trust nothing wider. effective = effective & hop.child_scope continue # The declared parent_scope must be a subset of the parent's # actual grant at signing time. if not hop.parent_scope <= state.scope: raise ScopeAttenuationForgery( f"declared parent_scope {hop.parent_scope} exceeds " f"authoritative grant {state.scope} for {hop.issuer} " f"at t={hop.issuance_timestamp}" ) # Child must be signed against the current epoch, not a superseded one. if hop.issuance_timestamp < state.effective_at: raise ScopeAttenuationForgery( f"child signed against superseded grant epoch {state.epoch}" ) # Transitive narrowing: intersect forward, never widen. effective = effective & hop.child_scope return effective ```