# What happens when an instance mints a delegated credential from a scope it never actually held: transitive scope amplification in AAIF exchange chains **Date of Record:** 2026 November 22 **Scope:** Applies to any AAIF deployment where an agent instance obtains a scoped credential by exchange (RFC 8693-style token exchange or equivalent warrant delegation) rather than by direct issuance, and where the exchanging instance's own credential was itself derived through a prior exchange. Does not apply to root-issued credentials, to single-hop exchange from a root principal, or to systems that enforce scope-intersection at every hop with a signed provenance log. ## Core Distinction The distinction that matters is between **scope authorization** and **scope provenance**. A delegated credential exchange asks two different questions that look identical at the API boundary: 1. *Is the requested scope a subset of the scopes currently presented by the caller?* (authorization check) 2. *Was the caller ever legitimately entitled to that scope, or did it merely inherit it transitively from a chain whose intermediate hops were never re-validated?* (provenance check) Most AAIF exchange implementations enforce (1) and assume (1) implies (2). It does not. When instance B holds a credential delegated from A with scope `S`, and B exchanges with C requesting `S' ⊆ S`, the check passes. But if B's credential was itself obtained via an exchange where the *original* scope grant to A was later narrowed, revoked, or was only ever valid for A's specific context (tenant, resource, time window), then B is now minting `S'` from a scope it never held in the sense that mattered. The credential is structurally valid at every hop and semantically invalid at the leaf. This is transitive scope amplification: the delegation graph accumulates apparent authority faster than it accumulates actual entitlement. This is not about over-broad grants. It is about the exchange operation treating *presented scope* as *possessed scope*, when the presented scope is a projection of an ancestor's entitlement that may have decayed between hops. ## What Was Observed A three-instance pipeline: orchestrator `A` (root principal, scope `read:dataset` + `write:report` for tenant `t-42`), worker `B` (exchanged from A, scope `read:dataset` restricted to tenant `t-42`), and summarizer `C` (exchanged from B, requested scope `read:dataset`). The failure trace: 1. At `T0`, A is issued a credential with `read:dataset@t-42` and `write:report@t-42`, TTL 3600s. 2. At `T1` (t+400s), A exchanges with B for `read:dataset@t-42`. The exchange service validates `requested ⊆ presented`, signs a credential bound to B's instance identity, TTL 3600s **from T1**, not from T0. 3. At `T2` (t+900s), B exchanges with C for `read:dataset@t-42`. Validation again passes: `requested ⊆ presented`. C receives a credential with TTL 3600s **from T2**. 4. At `T3` (t+3800s), A's original credential expires. The tenant `t-42` dataset authorization is revoked at the resource server because A's root grant lapsed. 5. At `T4` (t+4100s), C presents its credential to the resource server. The credential is cryptographically valid, unexpired (expires at T2+3600 = t+4500s), and carries `read:dataset@t-42`. The resource server has no way to know A's root grant is gone. **C reads data it is no longer authorized to read, for 400 seconds, with a credential that every hop attested to.** The amplification is not in scope width — every hop requested a subset. It is in **scope lifetime**. Each exchange reset the TTL clock. The delegation chain's effective lifetime is the sum of hop TTLs, not the minimum, because no hop carried forward the *remaining* lifetime of its parent. Three hops of 3600s produced a leaf credential valid 4500s past the root grant's expiry. We reproduced this with a fourth hop and observed the leaf outlive the root by 2.3× the root TTL. The exchange service logged every hop as `ALLOW`. No error fired. The only anomaly was a resource-server access log showing `read:dataset@t-42` at a timestamp after the tenant's authorization audit recorded revocation — a discrepancy that took manual correlation to detect. A second, subtler variant appeared when the intermediate credential carried a **context constraint** rather than a scope: B's credential was bound to `purpose=pipeline-run-7`. When B exchanged for C, the exchange service validated scope subset but dropped the `purpose` claim, because the exchange request schema had no field for it and the service did not default-carry unrequested claims. C held `read:dataset@t-42` with no purpose binding, usable in any context. The constraint that was supposed to travel with the delegation evaporated at the first hop that didn't explicitly re-request it. ## Condition of Validity The invariant that must hold for delegated exchange to be sound is: > For every exchange hop `h: parent → child`, the child credential's effective authority must be `authority(parent) ⊓ requested(child)`, where `⊓` intersects **scope, context constraints, and remaining lifetime**, and where `authority(parent)` is the parent's *residual* authority at the moment of exchange, not its originally granted authority. The failure above occurs precisely when the exchange service implements `requested ⊆ presented` (a set-membership check on scope) instead of the lattice meet over the full authority tuple. The three components that must be intersected and are commonly omitted: - **Remaining lifetime** (`exp(child) ≤ exp(parent)`, not `exp(child) = now + default_ttl`). Without this, chain lifetime is additive. - **Context claims** (`purpose`, `tenant`, `resource-binding`, `audience`) must be carried forward and intersected, not reset. A child may narrow a context claim but never widen or drop it without explicit re-authorization from the root. - **Revocation propagation**: the leaf must be invalidatable by revoking any ancestor. This requires either short TTLs bounded by the root's expiry (the lifetime intersection above) or an online revocation check that walks the provenance chain. Without one of these, revocation at the root does not reach the leaf. The condition of validity is therefore: *exchange is sound only if the credential format carries a signed provenance link to its parent and the exchange service computes the meet over (scope, context, lifetime) rather than a subset check over scope alone.* If the credential format is a bare bearer token with no parent pointer, the invariant cannot be enforced at the leaf and must be enforced entirely by lifetime bounding — which means every hop's TTL must be clamped to the parent's remaining TTL, and the root's expiry must be the hard ceiling for the entire chain. ## Decision Boundary The architectural decision is where to enforce the meet. Three placements, with distinct failure modes: - **Enforce at exchange (mint-time).** The exchange service computes `exp(child) = min(now + requested_ttl, exp(parent))` and copies forward un-dropped context claims, rejecting requests that try to omit a parent context claim without a root-signed widening grant. This bounds chain lifetime to the root TTL and preserves constraints. Cost: the exchange service must parse and understand every context claim type, which makes it a schema chokepoint and a versioning liability as claim types proliferate. - **Enforce at resource server (verify-time).** The resource server walks the provenance chain in the credential (requires parent pointers and signatures at each hop) and checks that no hop widened scope, dropped context, or extended lifetime past its parent. This is robust to exchange-service bugs but requires the resource server to hold every ancestor's public key or a chain-verification service, and it makes every request O(chain depth) in verification cost. - **Enforce by construction (format-level).** The credential format makes amplification unrepresentable: the leaf carries a single `not_after` equal to the root's expiry, context claims are a single intersected set with no per-hop override, and the chain is a Merkle-linked structure the verifier checks in one pass. This is the strongest but requires abandoning the "each hop mints a fresh token" model in favor of "each hop appends a signed narrowing." The decision boundary: **if your exchange service cannot compute the meet over lifetime and context, you must not allow multi-hop exchange at all.** The common failure is allowing multi-hop with a subset-only check, which produces credentials that are valid at every hop and wrong at the leaf — the worst failure class, because every audit log reads `ALLOW`. ## Operational Effect The operational consequence is a class of incident that is invisible to per-hop logging and only surfaces as a cross-system timestamp correlation: a leaf credential exercising authority after its root grant was revoked, or a leaf credential used outside the context its ancestor was bound to. Detection requires joining the exchange service's mint log (which records `parent_id → child_id`, scope, and TTL) against the root authorization audit (which records grant and revocation timestamps) and computing, for each leaf, whether `leaf.not_after ≤ root.not_after` and whether the leaf's context-claim set is a subset of the root's. In the observed case this join was not automated; the discrepancy was found 400 seconds of unauthorized access late. The guardrail that bounds it is a **chain-lifetime invariant check** run at mint time and a **provenance-closure check** run at verify time, with an alert on any leaf whose `not_after` exceeds its root's `not_after` or whose context-claim set is not a subset of the root's. The check is cheap at mint time (compare two timestamps, diff two claim sets) and is the single highest-leverage control, because it converts an invisible semantic drift into a hard `DENY` at the moment the amplifying hop is attempted. ## Operational Guardrail: Chain-Lifetime and Context-Closure Enforcement The following enforces the meet at mint time and raises on any attempt to amplify lifetime or drop context. It is the minimal control that would have caught the observed failure at hop 2. ```python from dataclasses import dataclass, field from datetime import datetime, timedelta class ScopeAmplificationError(RuntimeError): """Raised when a delegated exchange would widen authority beyond its parent.""" pass @dataclass(frozen=True) class Credential: subject: str scopes: frozenset context: frozenset # e.g. {"tenant:t-42", "purpose:pipeline-run-7"} not_before: datetime not_after: datetime parent_id: str | None = None def exchange(parent: Credential, child_subject: str, requested_scopes: frozenset, requested_ttl: timedelta, requested_context: frozenset, now: datetime) -> Credential: # 1. Scope must be a subset of the parent's residual scope. if not requested_scopes <= parent.scopes: raise ScopeAmplificationError( f"scope escalation: {requested_scopes - parent.scopes} not held by parent" ) # 2. Context claims must be preserved; a child may narrow but never drop. dropped = parent.context - requested_context if dropped: raise ScopeAmplificationError( f"context-claim drop: {dropped} present on parent, absent on child" ) widened = requested_context - parent.context if widened: raise ScopeAmplificationError( f"context-claim widening: {widened} not authorized by parent" ) # 3. Lifetime must be clamped to the parent's remaining lifetime, not reset. if now >= parent.not_after: raise ScopeAmplificationError( f"parent credential expired at {parent.not_after.isoformat()}" ) proposed_expiry = now + requested_ttl if proposed_expiry > parent.not_after: # Clamp rather than reject: narrowing lifetime is always legal. proposed_expiry = parent.not_after return Credential( subject=child_subject, scopes=requested_scopes, context=requested_context, not_before=now, not_after=proposed_expiry, parent_id=f"{parent.subject}:{parent.not_after.isoformat()}", ) def verify_chain_closure(leaf: Credential, root: Credential) -> None: """Verify-time backstop: leaf must not outlive or out-scope its root.""" if leaf.not_after > root.not_after: raise ScopeAmplificationError( f"leaf outlives root: {leaf.not_after.isoformat()} > {root.not_after.isoformat()}" ) if not leaf.scopes <= root.scopes: raise ScopeAmplificationError( f"leaf scope exceeds root: {leaf.scopes - root.scopes}" ) if not leaf.context <= root.context: raise ScopeAmplificationError( f"leaf context exceeds root: {leaf.context - root.context}" ) ```