# What structural signals indicate delegation-scope collapse in AAIF capability tokens under transitive re-issuance **Date of Record:** 2026 November 28 **Scope:** Applies to Agent Identity and Authorization Framework (AAIF) deployments where a holder agent re-issues a narrower-scoped capability token to a subordinate agent (transitive delegation) and the authority chain is validated by scope-subset checking. Does not apply to single-hop issuance from a root issuer, nor to opaque bearer tokens without embedded scope claims. ## Core Distinction The failure mode is not "scope escalation"—that is the well-understood case where a delegate receives permissions the delegator never held. The non-obvious boundary is **scope collapse via set-intersection drift**: each re-issuance step is individually valid (the child's scope is a strict subset of the parent's), yet the *composition* of subset checks across a chain silently discards capabilities the orchestrator believes are still live downstream. The distinction that matters operationally: a subset check validates *containment*, not *preservation of intent*. A chain of three legitimate narrowing steps can produce a leaf token whose scope set is non-empty, passes every structural check, and yet no longer covers the action the root delegator authorized it to perform—because each intermediate agent pruned a dimension (resource, action, or constraint predicate) that a sibling branch still depends on. The second, sharper distinction: AAIF scope tokens carry both an *allow-set* and a *constraint predicate* (e.g., `max_amount`, `ttl`, `audience`). Subset checking is typically implemented on the allow-set only. Constraint predicates compose by *conjunction*, not subset. Two independently valid delegations can carry predicates that, when conjoined at the leaf, are unsatisfiable—producing a token that is structurally a valid subset but operationally dead. ## What Was Observed A three-tier orchestration: root issuer `R` → planner agent `P` → executor agent `E` → tool agent `T`. `R` issues `P` a capability `C_P` with allow-set `{read:orders, write:orders, refund:orders}` and predicate `audience=tenant-42`. `P` decomposes the task and issues `E` a token `C_E` scoped to `{read:orders}` with predicate `audience=tenant-42 ∧ max_amount=500`. `E`, needing to settle a refund, issues `T` a token `C_T` scoped to `{refund:orders}` with predicate `audience=tenant-42 ∧ max_amount=500 ∧ refund_reason_required=true`. Three structural signals appeared in the audit log, in this order: 1. **Empty intersection at the leaf, masked by non-empty allow-set.** `C_T`'s allow-set `{refund:orders}` is a subset of `C_E`'s `{read:orders}`? No—it is disjoint. The AAIF subset checker at `T`'s gateway rejected `C_T` with `SCOPE_NOT_SUBSET`. But `E` had already *executed* the refund request against the upstream API using `C_E`'s own credential, because `E`'s internal planner had cached `C_E` as "authorized for refund" from an earlier turn where `P` had verbally (in-band, unstructured) confirmed refund authority. The token was not the source of truth; the conversational trace was. 2. **Predicate conjunction produced an unsatisfiable leaf.** A sibling branch: `P` issued `E2` a token with `max_amount=500`, `E2` issued `T2` a token with `max_amount=200 ∧ currency=USD`. The leaf token's effective constraint was `max_amount ≤ 200 ∧ currency = USD`, but the target order was denominated in EUR. The token passed every structural subset check (200 ≤ 500, USD is a valid currency code) and failed only at the *predicate evaluation* stage inside `T2`'s tool runtime—after the tool had already reserved inventory. 3. **Delegation depth counter not propagated.** `C_T`'s `delegation_depth` claim was `2`, but the actual chain length was 3. The AAIF issuer at `E` incremented depth from the *token it was handed*, not from the *chain it could observe*. Because `P` had re-wrapped `C_P` into `C_E` without carrying forward the `parent_chain_hash`, `E` saw depth `1` and issued depth `2`. The depth ceiling of `3` was never enforced, and the audit trail could not reconstruct the full chain. ## Condition of Validity The subset-check invariant is only sound under three conditions, all of which must hold simultaneously: - **Allow-set monotonicity:** for every delegation step, `allow(child) ⊆ allow(parent)` evaluated as set containment over the *fully qualified* action namespace (verb + resource type + resource instance selector), not over verb alone. The observed failure arose because `read:orders` and `refund:orders` share the resource type `orders` but are distinct actions; a namespace-collapsing checker treats them as comparable and mis-reports subset relations. - **Predicate satisfiability preservation:** the conjunction of all predicates along the chain must be satisfiable for at least one concrete request in the intended task. This is not a subset property and cannot be checked by set containment; it requires a *satisfiability oracle* over the constraint domain (interval arithmetic for numeric bounds, set membership for enumerations, temporal logic for TTL windows). - **Chain-hash continuity:** every re-issued token must embed `parent_chain_hash = H(parent_token_bytes)` and `delegation_depth = parent.depth + 1`, and the verifier must recompute the hash chain to the root. Without this, depth ceilings and revocation propagation are unenforceable—revocation of `C_P` cannot invalidate `C_T` if `C_T` cannot prove descent from `C_P`. The invariant, stated precisely: *a leaf token is operationally valid iff its allow-set is a subset of every ancestor's allow-set under the fully qualified namespace, its conjoined predicate set is satisfiable for the target request, and its chain hash recomputes to a non-revoked root.* Any AAIF implementation that checks only the first clause is structurally unsound for multi-hop delegation. ## Decision Boundary The boundary between "safe to delegate" and "must refuse re-issuance" is not the subset check alone. The operational decision rule: - **If** the child's allow-set is a strict subset **and** the child's predicate set is satisfiable for the declared task target **and** the chain hash recomputes **then** issue. - **If** the child's allow-set is a subset but the predicate conjunction is unsatisfiable for the target (detected by the satisfiability oracle before issuance) **then** refuse with `UNSATISFIABLE_PREDICATE`, not `SCOPE_NOT_SUBSET`. The distinction matters because the caller's remediation differs: the former means "widen the predicate," the latter means "request new authority from the parent." - **If** the chain hash does not recompute or depth exceeds ceiling **then** refuse with `CHAIN_INTEGRITY_FAILURE` and quarantine the token; do not attempt partial validation. - **If** the delegating agent's *conversational* state claims authority the token does not encode **then** the token wins. The observed failure's root cause was an agent treating in-band planner output as an authorization source. The decision boundary here is architectural: the token is the sole authorization oracle; any planner-cached authority must be re-validated against the token at every tool invocation, not at planning time. ## Operational Effect The consequence of missing the satisfiability and chain-continuity checks is a class of failures that are *silent at issuance and loud at execution*: tokens that pass gateway validation, are accepted by the tool runtime's structural checks, and fail only when the underlying API rejects the request or, worse, when the request succeeds against the wrong resource because the predicate was never evaluated. In the observed case, the refund executed against the EUR order because the `currency=USD` predicate was attached to a sibling branch's token and the executor's tool runtime evaluated predicates from its *own* token, not the leaf's. The architectural guardrail is a **two-stage validator** at every delegation boundary: stage one performs set-containment over the fully qualified namespace and recomputes the chain hash; stage two invokes a satisfiability oracle over the conjoined predicate set against the concrete request the child intends to make. Stage two cannot run at issuance time in general (the target request is not yet known), so AAIF must support *deferred predicate evaluation*: the leaf token carries its full conjoined predicate set, and the tool runtime evaluates it against the actual request before side effects. The invariant to enforce: **no side effect may occur before the leaf token's conjoined predicates are evaluated against the concrete request.** Any implementation that evaluates predicates at issuance only, or that evaluates only the immediate parent's predicates, is unsound for chains of depth ≥ 2. ```python import hashlib from dataclasses import dataclass, field from typing import FrozenSet, Tuple, Optional class DelegationScopeError(RuntimeError): """Raised when a re-issued capability token violates AAIF delegation invariants.""" pass @dataclass(frozen=True) class Predicate: key: str op: str # one of: "eq", "le", "ge", "in" value: object @dataclass(frozen=True) class CapabilityToken: allow_set: FrozenSet[str] # fully qualified: "verb:resource_type:selector" predicates: Tuple[Predicate, ...] audience: str delegation_depth: int parent_chain_hash: Optional[str] # None for root token_bytes: bytes = field(default=b"") def chain_hash(self) -> str: return hashlib.sha256(self.token_bytes).hexdigest() def _namespace_subset(child: FrozenSet[str], parent: FrozenSet[str]) -> bool: # Fully qualified containment; a bare verb match is NOT sufficient. return child.issubset(parent) def _predicates_satisfiable(preds: Tuple[Predicate, ...], request: dict) -> bool: for p in preds: if p.key not in request: return False actual = request[p.key] if p.op == "eq" and actual != p.value: return False if p.op == "le" and not (actual <= p.value): return False if p.op == "ge" and not (actual >= p.value): return False if p.op == "in" and actual not in p.value: return False return True def issue_delegated_token( parent: CapabilityToken, child_allow: FrozenSet[str], child_preds: Tuple[Predicate, ...], child_audience: str, depth_ceiling: int = 3, ) -> CapabilityToken: if not _namespace_subset(child_allow, parent.allow_set): raise DelegationScopeError( f"SCOPE_NOT_SUBSET: child allow-set {sorted(child_allow)} not contained " f"in parent {sorted(parent.allow_set)} under fully qualified namespace" ) new_depth = parent.delegation_depth + 1 if new_depth > depth_ceiling: raise DelegationScopeError( f"DEPTH_EXCEEDED: chain depth {new_depth} exceeds ceiling {depth_ceiling}; " f"refusing re-issuance" ) # Chain continuity: child must commit to parent's hash. parent_hash = parent.chain_hash() if parent.parent_chain_hash is not None and parent_hash == "": raise DelegationScopeError("CHAIN_INTEGRITY_FAILURE: parent hash uncomputable") # Conjoin predicates: child inherits ALL ancestor predicates. conjoined = tuple(parent.predicates) + tuple(child_preds) token_bytes = repr( (child_allow, conjoined, child_audience, new_depth, parent_hash) ).encode() return CapabilityToken( allow_set=child_allow, predicates=conjoined, audience=child_audience, delegation_depth=new_depth, parent_chain_hash=parent_hash, token_bytes=token_bytes, ) def authorize_side_effect(token: CapabilityToken, request: dict, action: str) -> None: """Must be called BEFORE any side effect. Evaluates conjoined predicates.""" if action not in token.allow_set: raise DelegationScopeError( f"ACTION_NOT_PERMITTED: {action} not in token allow-set" ) if not _predicates_satisfiable(token.predicates, request): raise DelegationScopeError( f"UNSATISFIABLE_PREDICATE: conjoined predicates {token.predicates} " f"not satisfied by request {request}; side effect blocked" ) if token.delegation_depth > 3: raise DelegationScopeError( f"CHAIN_INTEGRITY_FAILURE: depth {token.delegation_depth} exceeds ceiling" ) # Only now may the caller perform the side effect. ```