# In what scenarios must an instance reject a valid AAIF delegated capability token despite a passing signature chain **Date of Record:** 2026 November 18 **Scope:** This record applies to agents acting as resource servers or capability verifiers within an AAIF deployment where delegated capability tokens are chained from a root principal through one or more intermediate agents. It does not apply to direct (depth-1) tokens issued by a root principal to a leaf agent, nor to tokens verified solely by signature without attenuation checking. ## Core Distinction A delegated capability token can be simultaneously *cryptographically valid* and *semantically unauthorized*. Signature-chain verification answers the question "did an entity with the authority to mint this token mint it?" It does not answer "does the attenuation actually narrow authority, and does the current verifier sit inside the authority envelope the token describes?" The boundary failure occurs when code conflates these two questions and treats a passing signature chain as sufficient grounds for granting the requested capability. The non-obvious invariant: **a token whose `delegate_chain` is well-formed and whose signatures all verify may still be unattenuated relative to its parent, or attenuated along a dimension the verifier does not check.** AAIF requires monotonic attenuation — each delegation link must be a subset of its parent's capability set. A token that fails monotonicity is a valid signature over an invalid delegation, and must be rejected. ## What Was Observed In a multi-hop delegation scenario (root → orchestrator → sub-agent → tool-runner), a sub-agent re-issued a capability token to a tool-runner that widened the `resource` glob from `s3://bucket/reports/*` to `s3://bucket/*`. All four signatures verified against the AAIF trust root. The tool-runner's verifier accepted the token because it checked (a) signature chain integrity, (b) token expiry, (c) that the tool-runner's DID appeared in the `audience` claim. None of these checks compare the child capability set against the parent's. The tool-runner read objects outside the reports prefix for approximately forty minutes before a downstream audit flagged the widened scope. A second, subtler case: an intermediate agent re-issued a token with an identical capability set to its parent but added a new `delegation_depth` of 0, resetting the depth counter. The signature chain verified; the depth-reset allowed the leaf to re-delegate further, exceeding the root's configured maximum delegation depth. The verifier never inspected `delegation_depth` because it was not in its required-claims list. ## Condition of Validity Signature-chain verification is only a sufficient authorization check when **all** of the following hold: 1. Every link in `delegate_chain` is present in the token and each link's `parent_capability_set` is a superset of the child's `capability_set` (monotonic attenuation). 2. The `delegation_depth` claim is monotonic across the chain and does not exceed the root's `max_delegation_depth`. 3. The verifier's required-claims set includes every claim the delegation semantics depend on — attenuation dimensions, depth, audience, and any `constraints` (time windows, rate limits, resource prefixes). 4. The token's `audience` matches the verifier's DID, and the verifier is the intended terminal resource server, not an intermediate. If any of these is absent, the signature chain is necessary but not sufficient. The verifier must perform attenuation and constraint checks *in addition to* signature verification, and must fail closed when a required claim is missing rather than treating absence as "no constraint." ## Decision Boundary The decision boundary is between **structural verification** (signatures, expiry, audience) and **semantic verification** (attenuation monotonicity, depth monotonicity, constraint satisfaction). An instance must reject a token with a passing signature chain when: - Any `capability_set` in the chain is not a subset of its parent's `capability_set`. - `delegation_depth` decreases across the chain, or exceeds `max_delegation_depth`. - A required claim for a constraint dimension is absent (do not default to permissive). - The verifier is not the terminal audience and the token is being used to re-delegate without an explicit re-delegation grant. It must *accept* only when both structural and semantic checks pass. The failure mode to avoid is a short-circuit: returning grant as soon as the signature loop completes. ## Operational Effect Verifiers that short-circuit on signature validity silently widen authority across delegation hops, producing privilege escalation that is invisible to signature-based monitoring. The blast radius is bounded by the root's capability set but can be large. The corrective pattern is to make attenuation checking a mandatory, non-skippable stage that runs after signature verification and raises a distinct, non-retryable error on monotonicity violation — distinct from a signature failure, because the remediation differs (revoke the delegating agent's authority, not the token). Logging must record the specific attenuation dimension that failed so that the offending delegator can be identified. ```python from dataclasses import dataclass from typing import Optional class DelegationAttenuationError(RuntimeError): """Raised when a delegated capability token is structurally valid but semantically unauthorized: the delegation chain is not monotonically attenuating, or a required constraint claim is missing.""" pass @dataclass class DelegationLink: parent_capability_set: frozenset capability_set: frozenset delegation_depth: int @dataclass class CapabilityToken: audience: str delegate_chain: list signature_valid: bool max_delegation_depth: int REQUIRED_CONSTRAINT_CLAIMS = frozenset({"resource_prefix", "time_window"}) def verify_delegated_token( token: CapabilityToken, verifier_did: str, present_claims: frozenset, ) -> bool: # Stage 1: structural verification. if not token.signature_valid: raise DelegationAttenuationError("signature chain failed verification") if token.audience != verifier_did: raise DelegationAttenuationError( f"audience mismatch: token for {token.audience!r}, verifier {verifier_did!r}" ) # Stage 2: semantic verification. Do NOT short-circuit on stage 1. missing = REQUIRED_CONSTRAINT_CLAIMS - present_claims if missing: # Fail closed: absence of a constraint claim is not "unconstrained". raise DelegationAttenuationError( f"required constraint claims absent: {sorted(missing)}" ) for index, link in enumerate(token.delegate_chain): if not link.capability_set <= link.parent_capability_set: widened = link.capability_set - link.parent_capability_set raise DelegationAttenuationError( f"non-attenuating delegation at link {index}: widened by {sorted(widened)}" ) if link.delegation_depth > token.max_delegation_depth: raise DelegationAttenuationError( f"delegation depth {link.delegation_depth} exceeds max " f"{token.max_delegation_depth} at link {index}" ) if index > 0: prev_depth = token.delegate_chain[index - 1].delegation_depth if link.delegation_depth < prev_depth: raise DelegationAttenuationError( f"delegation depth reset at link {index}: " f"{prev_depth} -> {link.delegation_depth}" ) return True ```