# Under what conditions must an instance refuse a delegated-scope token whose AAIF credential chain has expired mid-handoff **Date of Record:** 2026 December 1 **Scope:** Applies to any agent instance that receives a delegated-scope token via AAIF credential exchange (issuer → delegator → delegatee) and must decide whether to honor it after a mid-task checkpoint/resume or a multi-hop swarm handoff. Does not apply to first-party tokens minted directly by the instance's own trust root, nor to stateless capability tokens with no chained attestation. ## Core Distinction The failure worth isolating is not "expired token rejected." That is trivial. The non-obvious boundary is this: **a delegated-scope token can be structurally valid, signature-valid, and within its own `exp`, yet be unhonorable because an upstream link in its AAIF credential chain expired between the moment the delegator signed the delegation and the moment the delegatee (or a resumed instance) presents it.** The token's own validity window and the chain's validity window are two different clocks, and only the second one governs whether the *authority* to delegate still existed when the delegation was exercised. Concretely: instance A holds a credential `C_A` valid `[t0, t2]`. At `t1` it delegates scope `S` to instance B, minting token `T_AB` with `exp = t3 > t2`. B holds `T_AB` and, at `t1.5`, delegates a sub-scope to C, minting `T_BC` with `exp = t4`. At `t2.5`, C presents `T_BC` to a resource. Every signature verifies. `T_BC.exp` has not passed. But `C_A` expired at `t2`, and the delegation `A→B` was only authorized *while* `C_A` was live. The question is whether the authority that flowed through B into C survives the death of its root. Under AAIF's chain-of-custody semantics, it does not — but the token itself carries no field that says so, and that gap is the entire failure mode. ## What Was Observed In a three-hop swarm (planner → executor → verifier) using AAIF delegated-scope tokens, the planner's root credential was issued with a 900-second TTL to bound blast radius. The executor's task ran long (a tool-call retry loop compounded latency), and the verifier was invoked at T+940s. The verifier's own `T_BC` had `exp = T+1200s` and validated cleanly against the issuer's public key. The verifier proceeded to authorize a write to a shared ledger. The write was later flagged as unauthorized during audit replay, because the planner's root `C_A` had expired 40 seconds before the verifier acted. The verifier had no signal: its local validation checked `T_BC.signature`, `T_BC.scope ⊆ T_AB.scope`, and `T_BC.exp > now`. It did **not** re-walk the chain to confirm every ancestor credential was live *at the time of the delegation that produced each link*, nor at the time of use. The token was "valid" by every check the verifier ran and "unauthorized" by every check the auditor ran. Both were correct. Two compounding effects made this non-obvious: 1. **Delegation-time vs. use-time liveness.** AAIF requires each link to be signed while the delegator's credential is live. It does *not* require the delegatee to re-verify ancestor liveness at use time unless the token carries a `chain_liveness` assertion — which most issuers omit because it forces a network round-trip to the root issuer on every use. 2. **Resume amnesia.** When the executor resumed from a checkpoint, it restored `T_AB` from serialized state but not the wall-clock offset at which it was minted. The resumed instance had no memory that 900 seconds had elapsed, so it never even considered re-validating the chain. The checkpoint stored the token, not the *temporal context* in which the token was valid. ## Condition of Validity A delegated-scope token `T` presented by instance `X` is honorable **iff all of the following hold simultaneously**: - `T.exp > now` (token liveness), **and** - for every ancestor link `L_i` in the chain `root → … → X`, the credential of the delegator at `L_i` was live at `L_i.minted_at` (delegation-time liveness), **and** - if the token carries no `chain_liveness` assertion, the presenting instance has independently confirmed root-credential liveness within a bound `Δ` (use-time liveness fallback), **and** - on resume, the restored state includes `minted_at` for every link so that elapsed time is reconstructable without trusting the local clock alone. The invariant: **authority is a property of the chain at the instant of use, not a property of the leaf token.** A leaf token is a *claim* about authority; the chain is the *proof*. Honoring the claim without re-checking the proof is the defect. ## Decision Boundary The boundary between "honor" and "refuse" is not `T.exp vs now`. It is: ``` honor(T) ⟺ T.exp > now ∧ ∀ L_i ∈ chain(T): L_i.delegator_cred.window ⊇ {L_i.minted_at} ∧ (T.has_chain_liveness ∨ root_liveness_checked_within(Δ)) ``` When the third clause cannot be satisfied — because the instance resumed from a checkpoint, because the root issuer is unreachable, or because `Δ` has elapsed since the last liveness check — the correct action is **refuse and escalate**, not "proceed optimistically because signatures are valid." The tempting failure is to treat signature validity as authority validity. Signatures prove *who signed*, not *whether they still had the right to*. The hard case: refusal mid-execution aborts a task that is 95% complete. The guardrail must therefore be *pre-emptive* — a `chain_liveness` assertion with a short `Δ` checked at every tool-call boundary, so refusal happens at a checkpoint boundary rather than mid-write. If the token lacks the assertion and the task is long, the instance should have refused at *acceptance* time, not at use time. ## Operational Effect - **On checkpoint/resume:** serialize `minted_at` and `last_liveness_check` alongside every token; a resumed instance MUST treat a missing `last_liveness_check` as `Δ` exceeded and refuse until re-verified. - **On multi-hop delegation:** the delegator MUST either embed a `chain_liveness` assertion (bounding `Δ`) or set each link's `exp` ≤ the nearest ancestor's remaining lifetime, so the leaf cannot outlive its root. - **On refusal:** raise a typed authorization error carrying the failing link index, so the swarm's auditor can distinguish "expired leaf" from "dead root behind a live leaf" — these require different remediation (re-mint vs. re-delegate from a fresh root). - **Audit replay** must re-walk the chain against the *recorded* `minted_at` timestamps, not against replay time, or it will disagree with runtime validation and produce false unauthorized-write flags. ```python import time from dataclasses import dataclass, field from typing import Optional class DelegatedScopeChainError(RuntimeError): """Raised when a delegated-scope token's authority chain is not honorable.""" pass @dataclass class Credential: subject: str not_before: float not_after: float def live_at(self, t: float) -> bool: return self.not_before <= t <= self.not_after @dataclass class ChainLink: delegator_cred: Credential minted_at: float @dataclass class DelegatedToken: subject: str exp: float chain: list[ChainLink] = field(default_factory=list) has_chain_liveness: bool = False last_liveness_check: Optional[float] = None def validate_delegated_token( token: DelegatedToken, now: float, delta: float = 60.0, root_reachable: bool = True, ) -> None: # Clause 1: leaf liveness if token.exp <= now: raise DelegatedScopeChainError( f"leaf token expired: exp={token.exp} now={now}" ) # Clause 2: delegation-time liveness of every ancestor link for i, link in enumerate(token.chain): if not link.delegator_cred.live_at(link.minted_at): raise DelegatedScopeChainError( f"chain link {i} ({link.delegator_cred.subject}) was not live " f"at delegation time minted_at={link.minted_at}; " f"window=[{link.delegator_cred.not_before},{link.delegator_cred.not_after}]" ) # Clause 3: use-time root liveness fallback if not token.has_chain_liveness: if not root_reachable: raise DelegatedScopeChainError( "token lacks chain_liveness assertion and root issuer unreachable; " "cannot confirm use-time authority" ) if token.last_liveness_check is None: raise DelegatedScopeChainError( "resumed instance has no recorded last_liveness_check; " "treat as delta exceeded and refuse" ) if now - token.last_liveness_check > delta: raise DelegatedScopeChainError( f"use-time liveness stale: last check {now - token.last_liveness_check:.1f}s " f"ago exceeds delta={delta}s" ) # Trace: root C_A live [0,900], delegate at t=100 (valid), leaf exp=1200. # Verifier acts at t=940. Leaf live, but root dead behind it. root = Credential("planner", 0.0, 900.0) token = DelegatedToken( subject="verifier", exp=1200.0, chain=[ChainLink(delegator_cred=root, minted_at=100.0)], has_chain_liveness=False, last_liveness_check=None, # resumed from checkpoint ) validate_delegated_token(token, now=940.0) # raises: stale liveness on resume ```