# Where must an instance re-verify delegated scope when capability attenuation is non-monotonic across a handoff **Date of Record:** 2026 November 26 **Scope:** Applies to any multi-agent system where a parent agent mints a capability token (warrant) for a child agent with a strictly narrowed scope, and the child may further delegate or re-invoke. Does not apply to systems where delegation is flat (single issuer, no re-delegation) or where scope is enforced only at the human-facing gateway rather than at each hop. ## Core Distinction The naive mental model treats scope attenuation as a monotone lattice meet: if parent holds scope `S_p` and child requests `S_c`, the effective grant is `S_p ⊓ S_c`, and every descendant is provably `⊑ S_p`. This is true only when scope is expressed as a *set of permissions over a fixed, enumerable resource namespace* and the meet operation is a genuine intersection. It breaks the moment scope includes a *predicate over runtime state* — a row filter, a time window, a "only files this task created" constraint, a rate/quota ceiling, or a "same tenant" binding. Predicates do not intersect cleanly; they *compose*, and composition is where the boundary fails. The distinction that matters operationally: **structural attenuation (set-intersection of named rights) is monotone and safe to trust across hops; semantic attenuation (predicate composition) is non-monotonic and must be re-evaluated at every hop against the *current* state, not inherited as an opaque blob.** ## What Was Observed A parent orchestrator `A` held a warrant granting `read:db` scoped to the predicate `tenant_id = A.tenant AND created_at > T0`, where `T0` was the task start. It delegated to a retrieval sub-agent `B` a narrowed warrant: `read:db` with predicate `tenant_id = A.tenant AND created_at > T0 AND table = 'invoices'`. `B` in turn delegated to a summarizer `C` with predicate `table = 'invoices' AND row_hash IN (SELECT ...)` — a *derived* set computed at `B`'s invocation time. The failure trace: 1. `A`'s warrant was minted at `T0` with an expiry `T0 + 3600s` and the `created_at > T0` clause baked in as a *string predicate* passed through verbatim. 2. `B` re-delegated at `T0 + 3500s`. The attenuation logic in `B` intersected the *named rights* (`read:db ⊓ read:db = read:db`) and concatenated predicates with `AND`. It did not re-evaluate whether `A`'s own warrant was still live for the *duration* `C` needed. 3. `C` started work at `T0 + 3590s`, issued its first query at `T0 + 3601s`. The database-side enforcement of `A`'s `created_at > T0` predicate passed (rows existed), but the *warrant signature check* at the MCP resource server rejected the token as expired — because the predicate `created_at > T0` was being validated against the token's `exp` claim in a code path that assumed predicate evaluation and expiry evaluation were independent. 4. `C`'s retry loop interpreted the 401 as a transient transport error (the resource server returned the same status code for expiry and for signature-mismatch) and retried 5 times, each retry burning a fresh nonce, until the parent's global token budget was exhausted. The non-obvious part: **the attenuation was structurally correct.** `C`'s rights were a strict subset of `A`'s rights. The failure was that the *validity interval* of a delegated warrant is not attenuated by the subset relation — it is bounded by the minimum remaining lifetime across the entire delegation chain, and that minimum was never computed because the predicate-composition path and the lifetime-propagation path were separate code paths that never met. ## Condition of Validity The invariant that must hold for safe delegation is: > For every warrant `w` issued by agent `X` to agent `Y`, the effective validity of `w` is `min(remaining_lifetime(X's warrant), requested_lifetime)` and the effective scope is `scope(X) ⊓ scope(Y_requested)` **evaluated at the moment of use, not the moment of minting**, for any scope component that references mutable state. Three conditions are jointly necessary: - **Lifetime monotonicity:** `exp(child) ≤ exp(parent)` must be enforced at mint time, not assumed. A child warrant that outlives its parent is a dangling grant. - **Predicate re-evaluation:** scope predicates that reference `now`, row versions, tenant membership, or quota counters must be re-checked at each hop's *use* site, because the state they reference can change between mint and use. - **Error distinguishability:** the resource server must return distinguishable errors for `expired`, `scope_violation`, and `signature_invalid`, so the child's retry logic does not misclassify a permanent authorization failure as a transient one. When any of these is absent, the delegation is *structurally* least-privilege but *operationally* unbounded — the child holds a token that is either too long-lived or whose scope predicates are stale. ## Decision Boundary The boundary is this: **if the scope expression contains any term whose truth value can change without a new warrant being minted, the warrant is a *lease*, not a *capability*, and must be treated with lease semantics (renewal, revocation checks, use-time validation).** Concretely: - Scope = set of named verbs over a static namespace → capability; inherit by intersection; safe to pass opaquely. - Scope = named verbs + a predicate over `now`, counters, row versions, or membership → lease; must carry an explicit `not_after` and a `revalidate_at` hint, and the child must re-check the predicate at use. - Scope = named verbs + a predicate over *immutable* row attributes (e.g., `tenant_id`) → capability *if and only if* the tenant binding is itself signed and cannot be re-bound downstream; otherwise it degrades to a lease because tenant membership is mutable. The operational rule: **at every handoff, recompute `effective_exp = min(chain_exp)` and re-evaluate every mutable predicate; never forward a warrant whose predicate references state you have not just re-read.** ## Operational Effect The consequence of getting this wrong is not a loud failure — it is a *silent widening* of authority in the window between mint and expiry, plus a *silent narrowing* that manifests as spurious retries. In the observed case, the child `C` held authority it should not have (a predicate evaluated against stale `T0`) for 11 seconds, and then exhausted the parent's nonce budget retrying a permanent failure. The blast radius was bounded only because the resource server's expiry check happened to fire — a system where the predicate was the *only* guard would have served stale-tenant rows to `C` with no error at all. The guardrail is a **delegation wrapper that fails closed on non-monotonic scope**: it refuses to mint a child warrant if the composed predicate references mutable state and the parent's remaining lifetime is less than the child's requested lifetime, and it stamps every minted warrant with the chain-minimum expiry so the resource server can reject at the edge rather than at the predicate layer. ```python import time from dataclasses import dataclass, field from typing import Callable, Optional class NonMonotonicDelegationError(RuntimeError): """Raised when a child warrant would exceed parent lifetime or carry a stale mutable predicate.""" pass @dataclass class Warrant: subject: str rights: frozenset[str] predicate: Optional[Callable[[dict], bool]] predicate_is_mutable: bool issued_at: float not_after: float chain_exp: float = field(init=False) def __post_init__(self) -> None: # chain_exp is the minimum expiry across the entire delegation chain. self.chain_exp = self.not_after def delegate( parent: Warrant, child_subject: str, requested_rights: frozenset[str], requested_predicate: Optional[Callable[[dict], bool]], predicate_is_mutable: bool, requested_lifetime_s: float, now: Optional[float] = None, ) -> Warrant: now = time.time() if now is None else now # 1. Structural attenuation: rights must be a subset. if not requested_rights.issubset(parent.rights): raise NonMonotonicDelegationError( f"rights {requested_rights - parent.rights} not held by parent {parent.subject}" ) # 2. Lifetime monotonicity: child must not outlive parent, and parent must be live. parent_remaining = parent.chain_exp - now if parent_remaining <= 0: raise NonMonotonicDelegationError( f"parent warrant for {parent.subject} already expired at {parent.chain_exp}" ) if requested_lifetime_s > parent_remaining: raise NonMonotonicDelegationError( f"requested lifetime {requested_lifetime_s}s exceeds parent remaining {parent_remaining:.1f}s; " "refusing to mint a dangling grant" ) # 3. Semantic attenuation: mutable predicates require re-evaluation at use, and # the child must be told its true chain expiry so the resource server can # reject at the edge rather than at the predicate layer. if predicate_is_mutable and requested_predicate is None: raise NonMonotonicDelegationError( "mutable predicate flagged but no predicate supplied; cannot revalidate" ) child = Warrant( subject=child_subject, rights=requested_rights, predicate=requested_predicate, predicate_is_mutable=predicate_is_mutable, issued_at=now, not_after=now + requested_lifetime_s, ) # Inherit the chain minimum so downstream servers see the real ceiling. child.chain_exp = min(child.not_after, parent.chain_exp) return child def use(warrant: Warrant, state: dict, now: Optional[float] = None) -> bool: now = time.time() if now is None else now if now >= warrant.chain_exp: # Distinguishable from scope violation so callers do not retry. raise NonMonotonicDelegationError( f"warrant for {warrant.subject} expired at chain_exp={warrant.chain_exp}" ) if warrant.predicate is not None and not warrant.predicate(state): raise NonMonotonicDelegationError( f"scope predicate failed for {warrant.subject} against current state" ) return True ```