# Where must an instance re-verify scope narrowing when an AAIF delegated credential chain crosses a tool-call boundary mid-execution? **Date of Record:** 2026 December 2 **Scope:** Applies to AAIF (Agent Identity and Authorization Framework) delegated credential chains where a parent agent mints a scoped capability token for a child agent, which then invokes tools or sub-agents. Does not cover static service-to-service OAuth flows or single-hop bearer tokens without delegation. ## Core Distinction The failure is not "the child agent has too many permissions." The failure is that **scope intersection is computed at token-mint time, but capability is exercised at tool-call time, and the two are separated by an arbitrary number of reasoning steps during which the parent's own scope may have been narrowed, revoked, or superseded.** A delegated token is a snapshot of an intersection that was valid at `t_mint`. The AAIF invariant most implementations assume — *child.scope ⊆ parent.scope at all times* — is only checked once, at issuance. It is not a continuity invariant; it is a point-in-time predicate masquerading as one. The non-obvious consequence: a child holding a token scoped to `fs:write:/tmp/run-7` can still present that token after the parent's own credential has been downgraded to `fs:read`, because the child's token is a *signed assertion of an intersection that no longer holds*. The signature verifies. The scope is internally consistent. The chain is broken. ## What Was Observed A two-hop chain: orchestrator `O` → worker `W` → tool `T` (a filesystem writer). 1. `O` held root capability `cap_root = {fs:write:*, net:egress:api.internal}`. At `t0`, `O` minted `tok_W = sign(sk_O, scope = {fs:write:/tmp/run-7}, parent = cap_root, ttl = 300s)`. 2. `W` began a multi-step plan. At step 4 it called `T` with `tok_W`. `T` verified the signature against `O`'s public key, checked `tok_W.scope ⊆ cap_root` (cached at `t0`), and executed. Correct. 3. At `t1` (step 6 of `W`'s plan), a policy engine revoked `O`'s `fs:write` grant after detecting an anomaly in `O`'s tool-call pattern. `O`'s live credential became `cap_root' = {fs:read:*, net:egress:api.internal}`. 4. At step 9, `W` called `T` again with the *same* `tok_W`. `T` re-verified the signature (valid), re-checked `tok_W.scope ⊆ cap_root` **against the cached parent scope from `t0`** (still passes), and wrote to `/tmp/run-7/out.json`. The write succeeded 80 seconds after the parent lost the authority that justified it. No signature failed. No scope check failed. The delegation chain was cryptographically intact and semantically void. A secondary observation: `W`'s reasoning trace at step 9 contained the claim "my token is valid, parent authorized write" — a *stale belief about a live authorization state*, formed from the token's self-description rather than from any re-query. The agent was not lying; it was reasoning over a frozen snapshot and treating it as current. ## Condition of Validity The invariant `child.scope ⊆ parent.scope` is *continuously* valid only under one of three conditions: - **(A) Parent scope is immutable for the token's TTL.** Then the mint-time check is sufficient, and the token is a valid lease. This requires the parent's grant to be non-revocable and non-narrowable for `ttl` — rare in practice. - **(B) Every exercise of the token re-resolves the parent's *current* scope and re-intersects.** This is the "live delegation" model: the token carries a parent reference (not a parent scope snapshot), and the verifier dereferences the parent at call time. - **(C) The token carries a monotonic revocation epoch, and the verifier checks `epoch(token) ≥ epoch(parent_current)`.** Revocation bumps the parent's epoch; any child token minted under an older epoch is rejected at the next exercise. Most AAIF implementations ship (A) semantics but *document* (B) semantics. The gap between the implemented check and the documented guarantee is the failure surface. The token format typically embeds `parent_scope` as a claim (an intersection witness) rather than `parent_id + epoch` (a live reference), which structurally forecloses (B) and (C). ## Decision Boundary The boundary is: **does the verifier treat the parent scope as a claim to be checked against a snapshot, or as a reference to be resolved against live state?** - If the token embeds `parent_scope` as a signed claim → the verifier can only check *consistency with the snapshot*, never *currency*. Any revocation between mint and exercise is invisible. This is the failure mode above. - If the token embeds `parent_id` and the verifier dereferences live parent state → currency is checkable, but at the cost of a synchronous dependency on the authority service at every tool call. Latency and availability tradeoffs follow. - If the token embeds `parent_id + epoch` and the verifier checks epoch monotonicity → currency is checkable with a cached epoch table, bounding staleness to the epoch-propagation delay. This is the only model that is both offline-verifiable and revocation-aware, and it is the one to require. The decision an operator must make explicit: **what is the maximum acceptable window during which a revoked parent authority remains exercisable through a child token?** If the answer is "zero," model (B) is mandatory. If it is "bounded by epoch propagation," model (C). If it is "the TTL," model (A) — and the TTL must then be treated as an authorization lifetime, not a convenience. ## Operational Effect Under (A) semantics, the blast radius of a parent revocation is bounded only by the child's TTL and the number of outstanding child tokens. A parent that minted 40 short-lived worker tokens before revocation leaves 40 live capability grants, each exercisable until its own TTL expires, each cryptographically indistinguishable from a legitimate grant. Incident response must therefore enumerate and revoke *descendants*, not just the parent — which requires a reverse index from parent to issued children that most AAIF deployments do not maintain. The practical guardrail: **child tokens must carry `parent_id` and `parent_epoch`; verifiers must reject any token whose `parent_epoch` is less than the parent's current epoch; and the authority service must expose a `revoke_subtree(parent_id)` that bumps the parent epoch and invalidates all descendants in one operation.** The epoch check is O(1) against a cached table and closes the window to the propagation delay of that table. Without it, the chain is a signature over a memory, and the memory can be wrong. ```python import time from dataclasses import dataclass, field class StaleDelegationError(RuntimeError): """Raised when a child token's parent authority is no longer current.""" pass @dataclass class Capability: scope: frozenset epoch: int revoked: bool = False @dataclass class DelegatedToken: token_id: str parent_id: str parent_epoch: int # epoch of parent AT MINT TIME scope: frozenset ttl_seconds: float minted_at: float = field(default_factory=time.monotonic) class AuthorityService: def __init__(self): self._caps: dict[str, Capability] = {} def grant(self, principal: str, scope: frozenset) -> None: self._caps[principal] = Capability(scope=scope, epoch=0) def revoke_subtree(self, principal: str) -> None: cap = self._caps[principal] cap.epoch += 1 cap.revoked = True def narrow(self, principal: str, new_scope: frozenset) -> None: cap = self._caps[principal] cap.scope = cap.scope & new_scope cap.epoch += 1 def current_epoch(self, principal: str) -> int: return self._caps[principal].epoch def mint_child(parent_id: str, auth: AuthorityService, child_scope: frozenset, ttl: float) -> DelegatedToken: parent = auth._caps[parent_id] if not child_scope <= parent.scope: raise StaleDelegationError( f"child scope {child_scope} not subset of parent {parent.scope}" ) return DelegatedToken( token_id=f"tok-{parent_id}-{time.monotonic_ns()}", parent_id=parent_id, parent_epoch=parent.epoch, scope=child_scope, ttl_seconds=ttl, ) def verify_and_exercise(tok: DelegatedToken, auth: AuthorityService, requested: frozenset) -> None: # 1. TTL if time.monotonic() - tok.minted_at > tok.ttl_seconds: raise StaleDelegationError(f"token {tok.token_id} expired") # 2. Scope containment within the token itself if not requested <= tok.scope: raise StaleDelegationError( f"request {requested} exceeds token scope {tok.scope}" ) # 3. THE INVARIANT: parent epoch must still match. # This is the check that point-in-time verifiers omit. current = auth.current_epoch(tok.parent_id) if tok.parent_epoch != current: raise StaleDelegationError( f"token {tok.token_id} minted at parent epoch {tok.parent_epoch}, " f"parent now at epoch {current}; delegation chain is stale" ) # 4. Re-intersect against live parent scope if not requested <= auth._caps[tok.parent_id].scope: raise StaleDelegationError( f"request {requested} no longer within live parent scope" ) # --- Reproduction of the observed failure --- auth = AuthorityService() auth.grant("orchestrator-O", frozenset({"fs:write:/tmp/run-7", "net:egress:api.internal"})) tok = mint_child("orchestrator-O", auth, frozenset({"fs:write:/tmp/run-7"}), ttl=300.0) # Step 4: legitimate write verify_and_exercise(tok, auth, frozenset({"fs:write:/tmp/run-7"})) # t1: parent loses write authority auth.narrow("orchestrator-O", frozenset({"net:egress:api.internal"})) # Step 9: SAME token, SAME request — must now fail try: verify_and_exercise(tok, auth, frozenset({"fs:write:/tmp/run-7"})) except StaleDelegationError as e: print(f"BLOCKED: {e}") ```