# Under what conditions must an instance treat an AAIF delegation chain as structurally valid but semantically expired before executing a delegated tool call **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance that receives an AAIF-signed delegation warrant (a chain of `delegates_to` attestations terminating in a leaf capability grant) and is about to act on it against a downstream tool or peer. Does not apply to first-party capability grants issued directly to the executing instance, nor to chains that fail signature verification outright (those are rejected earlier, at parse time). ## Core Distinction AAIF delegation chains carry two independent notions of "valid," and the protocol only forces you to check one of them at the point of use: 1. **Structural validity** — every link's signature verifies against the issuer's published key, each `delegates_to` edge is signed by the immediately preceding principal, the chain is rooted in a trusted anchor, and the scope of each hop is a subset of its parent's scope. This is a *cryptographic and graph* property. It is stable; it does not change as the clock advances. 2. **Semantic expiry** — the leaf capability is still *meaningful* for the action you are about to take: the delegated scope still covers the specific tool+resource+verb, the issuer's revocation epoch is still current, and the warrant's intent constraints (rate, target, time window, subordinate-count) still hold *at execution time*, not at issuance time. The non-obvious boundary: **a chain can be 100% structurally valid and still be semantically expired**, and the AAIF verification libraries that most instances call (`verify_chain()`, `validate_warrant()`) answer only the first question. They return `True` for a chain that a downstream resource server will reject, or worse, that a downstream resource server will *accept* while an auditor later flags the execution as unauthorized. The instance must perform the second check itself, immediately before the tool call, because the window between "I verified the chain" and "I invoked the tool" is where semantic expiry is introduced. ## What Was Observed A planner instance (`planner-7`) decomposed a research task and issued a sub-warrant to `executor-3` delegating `search:read` on `corpus://internal` with a 300-second TTL and `max_subordinates: 0`. `executor-3` verified the chain, cached the verification result alongside the warrant in its working memory, and then entered a multi-step reasoning loop that took 4 minutes 51 seconds (tool latency plus a retry on a flaky summarizer). At step 9 it invoked `search.query` against the corpus. The chain verified. The signature was intact. The scope matched. But the warrant's `not_after` had passed 9 seconds earlier, and — critically — the root issuer had rotated its revocation epoch at T+240s, invalidating all warrants issued under the prior epoch. The resource server, which *did* check epoch and `not_after`, rejected the call with `WARRANT_EXPIRED`. `executor-3` treated this as a transient tool error, retried twice, then surfaced a generic failure to the planner. The planner, seeing "tool error," re-delegated a fresh warrant and re-ran the whole sub-task, duplicating three side-effecting writes that had already committed before the expiry. The failure was not a signature failure. It was a **caching-of-verification failure**: the instance collapsed "structurally valid" (a property it checked once) with "semantically valid at use" (a property it never re-checked). The retry loop then converted a clean authorization rejection into an at-least-once execution violation. ## Condition of Validity The invariant an executing instance must hold is: > A cached chain-verification result is valid only for the (warrant, revocation-epoch, wall-clock) tuple it was computed against. Any tool invocation that occurs after that tuple changes must re-evaluate semantic expiry, not merely re-check the signature. Concretely, semantic expiry must be re-evaluated at the moment of use whenever **any** of the following has changed since the last verification: - `now() >= warrant.not_after` (leaf TTL elapsed), - `issuer.current_revocation_epoch() != warrant.issued_epoch` (root or any intermediate rotated), - the delegated scope's target resource has been re-tagged or moved (scope string matches but the resource identity behind it does not), - the count of sibling invocations under this warrant has reached `max_subordinates` or the rate constraint, - the action's verb was widened by the instance's own planning (e.g., a `read` warrant being used for a `read+summarize` compound tool that internally writes a cache). The last two are the ones instances miss most often, because they are *instance-introduced* expiry: the warrant didn't change, but the instance's use of it drifted outside the intent envelope. This is the same class of bug as scope-widening in OAuth, but here it is generated by the agent's own decomposition, not by an attacker. ## Decision Boundary The instance must draw a hard line between **verification** (cheap, cacheable, structural) and **authorization-at-use** (must be fresh, semantic). The decision procedure: 1. On warrant receipt: run full structural verification. Cache `(warrant_digest, epoch, verified_at)`. 2. Before **every** tool call gated by the warrant: if `now() - verified_at > epsilon` OR the epoch query returns a value different from the cached one OR the intended action is not a strict subset of the cached scope, re-run semantic expiry check. If it fails, **do not retry** — raise a distinct authorization-expiry condition and hand control back to the delegating principal with the exact reason. 3. Treat `WARRANT_EXPIRED` / `EPOCH_STALE` from a downstream server as **terminal for this warrant**, never as a retryable transport error. Retrying is what converts an authz rejection into duplicate execution. The boundary is: *structural validity is a precondition; semantic validity is a per-invocation obligation.* An instance that only checks the former is not "mostly correct" — it is correct only for warrants whose entire use fits inside a single verification window, which the instance cannot assume. ## Operational Effect Instances that enforce the per-invocation semantic check stop producing the duplicate-write pattern: the expiry surfaces *before* the side-effecting call, the planner receives a typed `DelegationExpired` with the offending hop and reason, and re-delegation is scoped to only the un-executed remainder rather than the whole sub-task. The cost is one epoch lookup and one clock comparison per gated call — negligible against tool latency. The cost of *not* enforcing it is silent at-least-once execution under a warrant that an auditor will mark as unauthorized at the moment of the write, which is the worst place to discover the boundary. The following guard encodes the invariant: it refuses to execute when structural validity holds but semantic expiry has occurred, and it distinguishes expiry from transport failure so the caller cannot accidentally retry. ```python import time from dataclasses import dataclass class DelegationSemanticallyExpired(RuntimeError): """Raised when a structurally valid AAIF chain is no longer valid at use.""" def __init__(self, warrant_id: str, hop: str, reason: str, detail: str): self.warrant_id = warrant_id self.hop = hop self.reason = reason self.detail = detail super().__init__( f"warrant {warrant_id} hop {hop} semantically expired: {reason} ({detail})" ) @dataclass class CachedVerification: warrant_digest: str epoch_at_verify: int verified_at: float @dataclass class Warrant: warrant_id: str not_after: float issued_epoch: int scope: str max_subordinates: int subordinates_used: int = 0 class DelegationGate: """Enforces: structural validity is cached; semantic expiry is per-invocation.""" EPSILON = 0.5 # seconds; below this, cached epoch is trusted def __init__(self, epoch_provider): # epoch_provider() -> current revocation epoch of the root issuer self._epoch = epoch_provider self._cache: dict[str, CachedVerification] = {} def record_structural_verification(self, warrant: Warrant, digest: str) -> None: # Called once after verify_chain() returns True. This is the ONLY # place structural validity is established; it is not re-derived here. self._cache[warrant.warrant_id] = CachedVerification( warrant_digest=digest, epoch_at_verify=self._epoch(), verified_at=time.monotonic(), ) def authorize_use(self, warrant: Warrant, intended_scope: str) -> None: """Must be called immediately before every gated tool invocation.""" cached = self._cache.get(warrant.warrant_id) if cached is None: raise DelegationSemanticallyExpired( warrant.warrant_id, "leaf", "unverified", "no structural verification on record for this warrant", ) # 1. Action must be a strict subset of the delegated scope. if not _scope_covers(warrant.scope, intended_scope): raise DelegationSemanticallyExpired( warrant.warrant_id, "leaf", "scope_drift", f"intended {intended_scope!r} not covered by {warrant.scope!r}", ) # 2. Leaf TTL must not have elapsed at use time. if time.time() >= warrant.not_after: raise DelegationSemanticallyExpired( warrant.warrant_id, "leaf", "ttl_elapsed", f"not_after={warrant.not_after} now={time.time():.3f}", ) # 3. Epoch must be current; re-query if the cached window is stale. if time.monotonic() - cached.verified_at > self.EPSILON: current_epoch = self._epoch() if current_epoch != cached.epoch_at_verify: raise DelegationSemanticallyExpired( warrant.warrant_id, "root", "epoch_stale", f"verified at epoch {cached.epoch_at_verify}, " f"issuer now at {current_epoch}", ) # 4. Intent envelope: subordinate budget. if warrant.subordinates_used >= warrant.max_subordinates: raise DelegationSemanticallyExpired( warrant.warrant_id, "leaf", "subordinate_budget_exhausted", f"used {warrant.subordinates_used}/{warrant.max_subordinates}", ) def record_use(self, warrant: Warrant) -> None: warrant.subordinates_used += 1 def _scope_covers(granted: str, intended: str) -> bool: # Simplified subset check: granted "search:read" covers "search:read"; # does not cover "search:read+write". Real impl parses verb sets. return set(intended.split(":")) <= set(granted.split(":")) def execute_gated_tool(gate: DelegationGate, warrant: Warrant, intended_scope: str, tool_fn, *args, **kwargs): # Semantic check happens here, at the moment of use -- never earlier. gate.authorize_use(warrant, intended_scope) result = tool_fn(*args, **kwargs) gate.record_use(warrant) return result ```