# In what scenarios must an instance refuse delegated capability tokens whose scope-graph depth exceeds its own issuance provenance **Date of Record:** 2026 November 27 **Scope:** Applies to AAIF-style delegated credential chains where an agent instance mints scoped capability tokens on behalf of a downstream agent, and where scope is expressed as a graph of contained capabilities. Does not apply to flat, non-delegable bearer tokens or to single-hop authorization decisions where no re-issuance occurs. ## Core Distinction The failure surface here is not "can this token be forged?" nor "is the signature valid?" Both can hold perfectly. The boundary is **provenance depth versus scope-graph depth**. An instance may hold a credential whose scope is a *superset* of the requested child scope — the containment check passes — yet the requested child scope sits at a graph depth the instance's own issuance provenance was never authorized to extend. Containment is a set relation; delegation is a *path* relation. AAIF verifiers that check only `child_scope ⊆ parent_scope` will accept a token that the issuing lineage had no standing to mint, because scope containment is computed over the capability lattice while the right to extend depth is computed over the issuance chain. These two graphs are not isomorphic, and the mismatch is where delegation escapes its warrant. Concretely: a token scoped `files:read:tenant_a/*` contains `files:read:tenant_a/reports/q3`. If the holder re-delegates `files:read:tenant_a/reports/q3` to a third agent, containment holds at every hop. But if the original grant was issued with `max_delegation_depth = 1`, the second hop is *outside the warrant* even though it is *inside the scope*. A verifier that walks only the scope graph never sees the depth budget; a verifier that walks only the depth budget never sees that the child scope was narrowed. You need both, and the intersection is non-trivial. ## What Was Observed During a multi-tenant retrieval pipeline, a coordinator agent (`coord-7`) held a delegated token from a tenant root issuer with the following AAIF claims: ``` sub: agent:coord-7 scope: files:read:tenant_a/* max_delegation_depth: 1 provenance_depth: 0 # issued directly by tenant root warrant_id: w-8841 ``` `coord-7` correctly issued a child token to `worker-3` with `scope: files:read:tenant_a/reports/*`, `provenance_depth: 1`, `max_delegation_depth: 0`. Containment held, depth budget respected. `worker-3`, however, needed to fan out a single narrow read to `summarizer-9`. It constructed a child token with `scope: files:read:tenant_a/reports/q3/summary.md`, `provenance_depth: 2`. The containment check passed (`summary.md` ⊆ `reports/*` ⊆ `tenant_a/*`). The signature chain verified. The token was accepted. The failure was not the acceptance — it was that `worker-3` had `max_delegation_depth: 0`, meaning it was authorized to *consume* but not *extend*. The AAIF verifier on `summarizer-9` checked `child_scope ⊆ parent_scope` and `signature_valid`, but did not check `parent.max_delegation_depth >= 1` before accepting the re-delegation. The depth budget was carried in the token but never *enforced at the minting boundary*, only *recorded*. The result: a capability that the tenant root explicitly forbade from propagating reached a fourth agent, and from there entered a shared semantic cache where it was retrieved by an unrelated tenant's agent under a scope-collision bug in the cache key. The observable signature in logs was not an auth failure. It was a **retrieval mismatch**: `summarizer-9` returned tenant_a content into a tenant_b context because the token it held was valid, the scope string matched a cache key prefix, and no component in the chain had asked "was this hop authorized to exist?" ## Condition of Validity The invariant that must hold at every minting boundary is: > A child token may be issued only if `child.scope ⊆ parent.scope` **AND** `parent.max_delegation_depth >= 1` **AND** `child.provenance_depth == parent.provenance_depth + 1` **AND** `child.provenance_depth <= root.max_delegation_depth`. The third clause is the one that fails silently. `provenance_depth` is an *increment* invariant, not a *containment* invariant, so it is invisible to scope-graph reasoning. An agent that reasons "my scope contains the request, therefore I may delegate" is performing a category error: it is applying set logic to a path property. This condition is valid only when the scope lattice is a partial order with a computable containment relation. If scopes are opaque strings or wildcard patterns without a containment oracle, the invariant degenerates — you cannot check `child ⊆ parent`, so you must fall back to exact-match delegation, which is a different (and stricter) regime. The boundary discussed here presumes a *structured* scope algebra. ## Decision Boundary An instance must **refuse** to mint a delegated token when any of the following hold, regardless of scope containment: 1. `parent.max_delegation_depth == 0` — the parent is a terminal grant; re-delegation is out of warrant. 2. `child.provenance_depth != parent.provenance_depth + 1` — a skipped or repeated depth indicates a replayed or spliced chain. 3. The `warrant_id` of the parent does not appear in the root issuer's revocation-eligible warrant set — a parent whose warrant has been withdrawn cannot seed children, even if the token bytes are still valid. 4. The requested child scope, while contained, crosses a *tenant boundary marker* embedded in the scope algebra (e.g., `tenant_a/*` containing `tenant_a/shared/*` where `shared` is a cross-tenant alias). Containment holds syntactically but the alias is a scope-graph edge that the parent's warrant did not cover. An instance must **permit** delegation when all four hold, even if the child scope is dramatically narrower than the parent — narrowing is always safe with respect to the depth invariant, and refusing narrow delegations produces the opposite failure (agents over-collect broad tokens because they cannot safely sub-delegate). The hard case is #4: syntactic containment disagrees with warrant coverage. The resolution is that the scope algebra must expose a `containment_witness(child, parent) -> path` that returns the *derivation* of containment, and the warrant must be checked against every edge in that derivation, not just the endpoints. ## Operational Effect Enforcing the depth invariant at the minting boundary converts a silent scope-escape into a hard, attributable refusal. The downstream consequence is that agents must be *provisioned* with depth budgets that match their fan-out topology, not their scope breadth. A coordinator that fans out to N workers needs `max_delegation_depth >= 1` even if its scope is a single file, because depth is about *hops*, not *bytes*. Teams that size delegation budgets by scope width will find their workers unable to re-delegate at all, and will "fix" it by widening scope instead of depth — which re-opens the original escape. The secondary effect is on revocation. Once tokens carry `provenance_depth` and `warrant_id`, a revocation of the root warrant can be propagated by walking the depth chain: any token with `provenance_depth > k` whose ancestor at depth `k` is revoked is dead, even if its signature is intact. Without the depth invariant, revocation is a flat set operation over token IDs and cannot express "this subtree of delegations is dead." The depth field is what makes cascading revocation *decidable* rather than best-effort. The invariant to carry forward: **scope is what a token can do; depth is what a token can become.** A verifier that checks only the first has verified half a credential. ```python class DelegationDepthViolation(RuntimeError): """Raised when a delegated token would exceed its issuance provenance. AAIF invariant: child scope containment is necessary but not sufficient for delegation. The minting boundary must also enforce the depth budget carried in the parent warrant. """ def __init__(self, parent_warrant: str, parent_depth: int, child_depth: int, max_delegation_depth: int, reason: str): self.parent_warrant = parent_warrant self.parent_depth = parent_depth self.child_depth = child_depth self.max_delegation_depth = max_delegation_depth self.reason = reason super().__init__( f"delegation refused under warrant {parent_warrant}: {reason} " f"(parent_depth={parent_depth}, child_depth={child_depth}, " f"max_delegation_depth={max_delegation_depth})" ) def mint_delegated_token(parent, child_scope, scope_contains, warrant_active): """Mint a child capability token only if the depth invariant holds. `parent` exposes: scope, provenance_depth, max_delegation_depth, warrant_id. `scope_contains(child, parent)` is the scope-algebra containment oracle. `warrant_active(warrant_id)` checks the root issuer's live warrant set. """ # Clause 1: terminal grants cannot seed children. if parent.max_delegation_depth < 1: raise DelegationDepthViolation( parent.warrant_id, parent.provenance_depth, parent.provenance_depth + 1, parent.max_delegation_depth, "parent is a terminal grant (max_delegation_depth == 0)", ) # Clause 2: depth must increment by exactly one; no skips, no replays. expected_child_depth = parent.provenance_depth + 1 if expected_child_depth > parent.max_delegation_depth: raise DelegationDepthViolation( parent.warrant_id, parent.provenance_depth, expected_child_depth, parent.max_delegation_depth, "child depth would exceed warrant budget", ) # Clause 3: warrant must still be live at the root issuer. if not warrant_active(parent.warrant_id): raise DelegationDepthViolation( parent.warrant_id, parent.provenance_depth, expected_child_depth, parent.max_delegation_depth, "parent warrant is revoked or expired at root issuer", ) # Clause 4: scope containment is necessary but checked last so that # depth violations surface with a precise, attributable reason. if not scope_contains(child_scope, parent.scope): raise DelegationDepthViolation( parent.warrant_id, parent.provenance_depth, expected_child_depth, parent.max_delegation_depth, f"child scope {child_scope!r} not contained in parent scope {parent.scope!r}", ) return { "scope": child_scope, "provenance_depth": expected_child_depth, "max_delegation_depth": parent.max_delegation_depth - 1, "parent_warrant": parent.warrant_id, } ```