# In what scenarios must an instance refuse a delegated AAIF credential whose scope-narrowing proof has silently expired mid-chain **Date of Record:** 2026 November 29 **Scope:** Applies to AAIF (Agent Identity and Authorization Framework) delegated credential chains where an orchestrator instance mints per-tool scoped tokens for downstream worker instances, and each hop carries a scope-narrowing proof (SNP) that is itself time-bounded. Does not apply to single-hop bearer tokens, root-issued capability tokens consumed directly by the minting instance, or chains where all hops share a single TTL enforced by a common clock authority. ## Core Distinction The distinction that matters is between **scope validity** and **delegation validity**. A per-tool scoped token has two independent lifetimes: (a) the token's own `exp` claim, which bounds when the *tool call* may execute, and (b) the scope-narrowing proof attached at each delegation hop, which bounds when the *narrowing decision itself* remains authoritative. Engineers routinely conflate these because in the happy path both are minted at the same instant with the same TTL. They diverge the moment a chain is *re-delegated after issuance*: an orchestrator mints token T with scope `{read:repo, write:repo}` and a narrowing proof proving `write:repo ⊆ read:repo`'s parent scope, then hands a sub-token to a worker that further narrows to `{read:repo}`. If the intermediate SNP expires while the leaf token's `exp` is still live, the leaf token is *cryptographically valid but semantically orphaned*: it asserts a scope it can no longer prove is a subset of anything the root authority granted. The invariant is that **a leaf token is only as authoritative as the weakest still-valid SNP in its chain**, and expiry of an interior SNP is a hard invalidation of every descendant, not a soft warning. ## What Was Observed A three-hop chain was observed in a code-review swarm. The root authority (a human-approved service principal) issued a capability `cap:repo:acme/widgets` with scope `{read, write, comment}` and a 3600s TTL. The orchestrator (hop 1) minted a delegated credential for a "planner" worker at T+0, narrowing to `{read, comment}`, with an SNP signed over the subset relation and `snp_exp = T+600` (a deliberately short 10-minute proof window, chosen because the planner's scope decision was expected to be finalized quickly). At T+540 the planner re-delegated to an "executor" worker, narrowing further to `{comment}`, and — critically — the planner's delegation code copied the *leaf token's* TTL (inherited from the root, T+3600) onto the new token rather than re-deriving a fresh SNP. The executor's token therefore carried `exp = T+3600` but its chain contained an interior SNP that died at T+600. At T+611 the executor issued a `comment` call. The tool gateway's AAIF validator checked: signature chain intact, leaf `exp` in the future, leaf scope `{comment}` present. It **admitted the call**. The call was a legitimate `comment` operation, so no harm occurred in this instance — but the validator had admitted a token whose delegation provenance was no longer provable. A replay of the same chain against a stricter validator (one that walks SNPs) rejected it. The two validators disagreed on the same token, which is the classic signature of a boundary condition rather than a bug in either. The failure trace is precise: `snp_exp(T+600) < leaf_exp(T+3600)`, interior hop not re-proven at re-delegation, validator that checks only leaf claims and signatures but not interior SNP liveness. The executor's *intent* was fine; the *provenance* was dead. This is a silent-expiry boundary: no error is raised at re-delegation time because nothing checks that the parent SNP outlives the child token. ## Condition of Validity The delegation is valid if and only if, for every hop `i` in the chain from root to leaf: ``` snp_exp(i) >= exp(leaf) for all i in [1 .. n-1] ``` i.e. every interior scope-narrowing proof must remain live for at least as long as the leaf token it underwrites. Equivalently: `min(snp_exp over interior hops) >= leaf.exp`. A re-delegation at hop `k` must either (a) re-derive a fresh SNP with `snp_exp >= new_leaf.exp`, or (b) clamp `new_leaf.exp <= min(snp_exp over hops 1..k)`. The observed failure was the violation of this predicate at T+540, masked until T+600 when the interior SNP lapsed. This condition is *not* implied by any of the checks a naive validator performs. Signature validity, leaf `exp`, and leaf scope membership are all necessary and all satisfied by the orphaned token. The condition is a property of the *chain*, not of the leaf, and therefore requires the validator to hold and walk the full delegation path — which many gateways do not, because they validate leaves statelessly for latency reasons. ## Decision Boundary An instance must refuse a delegated credential — and must refuse to *mint* from an about-to-expire one — at the following boundary: - **Refuse to mint** when `min(snp_exp over hops 1..k) - now < safety_margin`, where `safety_margin` covers the expected tool-call latency plus clock skew between minting and consuming instances. A re-delegation that would produce a leaf outliving its parent SNP must fail closed at mint time, not at call time. - **Refuse to admit** at the gateway when the chain walk finds any interior `snp_exp <= now`, even if `leaf.exp > now`. The leaf is orphaned; admission is a provenance violation regardless of whether the requested scope is benign. - **Do not refuse** when the leaf `exp` has already passed but all SNPs are live — that is an ordinary expired token and should be handled by the standard re-auth path, not the provenance-violation path. Conflating the two produces spurious "chain broken" alarms on routine expiry. The boundary is sharp because the two failure modes (leaf expiry vs. interior SNP expiry) have different remediation: leaf expiry means "re-mint"; interior SNP expiry means "the delegation decision itself must be re-proven against the root, and any leaf derived from it must be discarded, not refreshed." ## Operational Effect The operational consequence is that per-tool scoped tokens cannot be treated as stateless bearer credentials once delegation depth exceeds one. Three concrete effects: 1. **Validator asymmetry becomes a security gap.** A lenient gateway (leaf-only checks) and a strict gateway (chain-walking) will disagree on the same token for the entire window `[snp_exp, leaf_exp)`. Any tool reachable through the lenient gateway is a provenance-laundering surface: an orphaned token can perform scoped actions whose authorization is no longer traceable to the root. The window length is exactly `leaf.exp - min(snp_exp)`, which is a design parameter, not an accident. 2. **Re-delegation must be SNP-refreshing, not TTL-inheriting.** The observed bug — copying the leaf TTL onto a new sub-token — is the default behavior of most delegation helpers because they treat TTL as a property of the token rather than of the proof. The guardrail is to make `snp_exp` a first-class field that re-delegation is *required* to recompute, and to reject any mint where the new leaf `exp` exceeds the min interior `snp_exp`. 3. **Clock skew widens the window.** If the minting instance's clock runs 30s behind the gateway's, an SNP that "expires at T+600" may be treated as dead at T+570 by the gateway, orphaning in-flight calls. The `safety_margin` must exceed the measured skew between mint and consume, not the nominal skew. The invariant to enforce: **a leaf token's authority is bounded by the minimum SNP expiry in its chain; interior SNP expiry is a hard invalidation of all descendants; re-delegation must re-prove, not inherit.** ```python import time from dataclasses import dataclass class OrphanedDelegationError(RuntimeError): """Raised when a leaf token outlives an interior scope-narrowing proof.""" pass @dataclass class Hop: snp_exp: float # expiry of this hop's scope-narrowing proof scope: frozenset @dataclass class DelegatedToken: leaf_exp: float leaf_scope: frozenset chain: list # list[Hop], root-first, excludes leaf def min_snp_exp(chain): if not chain: return float("inf") return min(h.snp_exp for h in chain) def admit(token, now, safety_margin=0.0): # Leaf expiry is ordinary; route to re-auth, not provenance failure. if token.leaf_exp <= now: return "reauth" # Interior SNP expiry orphans every descendant. Fail closed. worst = min_snp_exp(token.chain) if worst <= now + safety_margin: raise OrphanedDelegationError( f"interior SNP expired at {worst:.0f} (now={now:.0f}); " f"leaf exp={token.leaf_exp:.0f} is orphaned" ) return "admit" def redelegate(parent_token, new_scope, requested_exp, now, safety_margin=0.0): # Re-delegation must re-prove: new leaf cannot outlive weakest interior SNP. worst = min_snp_exp(parent_token.chain) if requested_exp > worst - safety_margin: raise OrphanedDelegationError( f"cannot mint leaf exp={requested_exp:.0f}: exceeds weakest " f"interior SNP exp={worst:.0f} (margin={safety_margin:.0f}); " f"re-derive SNP instead of inheriting TTL" ) if not new_scope.issubset(parent_token.leaf_scope): raise OrphanedDelegationError("scope widening forbidden at re-delegation") return DelegatedToken(leaf_exp=requested_exp, leaf_scope=new_scope, chain=parent_token.chain + [Hop(worst, parent_token.leaf_scope)]) if __name__ == "__main__": T = 0.0 root_chain = [Hop(snp_exp=T + 600, scope=frozenset({"read", "write", "comment"}))] planner = DelegatedToken(leaf_exp=T + 3600, leaf_scope=frozenset({"read", "comment"}), chain=root_chain) # Attempt to inherit the 3600s TTL -> must fail at mint time. try: redelegate(planner, frozenset({"comment"}), requested_exp=T + 3600, now=T + 540) except OrphanedDelegationError as e: print("mint refused:", e) # A correctly clamped leaf is admitted until its own expiry. ok = redelegate(planner, frozenset({"comment"}), requested_exp=T + 590, now=T + 540) print(admit(ok, now=T + 550)) ```