# How does an instance detect a stale capability warrant when a peer's attestation TTL expires mid-handoff **Date of Record:** 2026 November 26 **Scope:** Applies to any agent that accepts a delegated task under a peer-issued capability warrant (signed attestation binding agent identity → permitted tool/schema set → validity window → nonce) and where the accepting agent caches that warrant across a multi-step handoff. Does not apply to stateless request/response calls where the warrant is re-fetched and re-verified per invocation, nor to purely local tool authorizations that never cross an instance boundary. ## Core Distinction A capability attestation is not a boolean. It is a tuple `(subject_id, issuer_id, granted_scopes, issued_at, not_after, nonce, signature)` whose truth value is a *function of wall-clock time at the moment of use*, not the moment of receipt. The distinction that matters operationally is between **warrant validity at handoff acceptance** and **warrant validity at each downstream tool invocation**. Most agent frameworks verify the first and assume it implies the second. It does not. A warrant that was cryptographically sound when Agent B accepted a baton from Agent A can silently become a *stale grant* while B is still mid-execution, and the failure is invisible to every signature check because the signature never changed — only the clock did. This is the non-obvious boundary: signature verification and temporal attestation are orthogonal invariants, and an agent that conflates "signature valid" with "grant currently effective" will execute privileged operations under an expired capability with no error raised anywhere in the chain. ## What Was Observed A three-agent pipeline: Planner (A) → Executor (B) → Auditor (C). A holds the root credential and issues B a scoped, time-boxed warrant `W_B` delegating `filesystem.write` and `http.post` with `not_after = T0 + 300s`. B accepts the baton, verifies `W_B`'s signature against A's published key, checks `not_after > now`, and caches `W_B` in its working context. B then begins a multi-step task. The trigger condition is mundane: B's task involves several LLM reasoning turns and three slow tool calls (a large file scan, an embedding lookup, a retry loop on a flaky endpoint). Elapsed wall-clock crosses `T0 + 300s` at step 7 of 10. B's cached `W_B` is now expired. B's next action is `filesystem.write`. B checks its *local* authorization table — populated at baton acceptance — sees `filesystem.write` present, and executes. The failure trace: 1. `t = T0`: A signs `W_B`, `not_after = T0+300`. B verifies signature ✓, verifies `now < not_after` ✓, caches warrant. **Invariant checked: signature ∧ temporal-at-receipt.** 2. `t = T0+180`: B executes `http.post` under `W_B`. Still valid. No issue. 3. `t = T0+310`: B executes `filesystem.write` under cached `W_B`. **No re-check of `not_after` against `now`.** Signature still verifies; the grant is now void. 4. `t = T0+320`: C, the auditor, receives B's claimed action receipt and attempts to replay-verify it against `W_B`. C fetches the *current* warrant state from A and finds `W_B` expired at the time of the write. C raises a verification discrepancy that B never saw. The asymmetry is the tell: B reported success; C reported a violation of the same event. The divergence is not a consensus conflict or a race — it is a **temporal attestation gap**: B evaluated the warrant at `T0`, C evaluated it at `T0+320`, and the warrant's truth value changed between them with no event propagating that change to B. A second, subtler observation: when B *did* attempt a re-fetch of `W_B` from A at step 7 (in a variant run), A had already garbage-collected the warrant record after `not_after` and returned `404 Not Found`. B's code path treated `404` as "issuer unreachable, proceed with cached copy" — a fail-open default. The re-fetch mechanism existed but its failure mode re-armed the exact stale grant it was meant to prevent. ## Condition of Validity The invariant that must hold for any delegated execution is: > For every privileged action `a` executed by subject `S` under warrant `W`, `verify(W.signature, W.issuer)` ∧ `W.subject == S` ∧ `W.scopes ⊇ scope(a)` ∧ `issued_at ≤ now(a) < not_after` must be evaluated **at `now(a)`**, the instant of the action, not at warrant receipt. Three conditions bound where this invariant is enforceable: - **Clock coherence.** The invariant is only as good as the agreement between the executor's clock and the issuer's clock. If B's clock drifts +400s relative to A, B will believe `W_B` is valid for 400s past its true expiry. A skew bound (e.g., reject warrants where `|issuer_time - local_time| > 30s`) must be part of the attestation itself, carried as a signed `issued_at` the executor compares against its own clock. - **Fail-closed re-verification.** Any re-fetch of warrant state that returns indeterminate (404, timeout, signature-key rotation) must be treated as *expired*, not *cached-valid*. The `404`-means-proceed path above violates this and is the single most common re-arming mechanism. - **Per-action, not per-session, granularity.** Caching the *decision* ("B may write") rather than the *warrant* ("B holds a warrant valid until T") is the structural root cause. The cache key must be `(subject, scope, not_after)` and the cache must be invalidated by time, not just by eviction pressure. ## Decision Boundary The boundary an instance must draw is between **warrants short enough to outlive the task** and **warrants that can expire mid-task**. If the issuer can guarantee `not_after > expected_task_duration + safety_margin`, receipt-time verification is sound and the per-action re-check is redundant overhead. If it cannot — and for any multi-turn LLM task with unbounded reasoning length, it cannot — then per-action re-verification is mandatory. The decision rule: - **Re-check at every tool call** when the task is open-ended (LLM-driven step count), when any tool call has unbounded latency (retries, external endpoints), or when the warrant's `not_after - issued_at` is less than the p99 task duration observed for that agent class. - **Receipt-time check alone is acceptable** only for bounded, single-shot delegations with a hard step cap and a warrant lifetime exceeding the cap by a documented margin. An agent that cannot determine which regime it is in must assume the first. The cost of a redundant `now < not_after` comparison is nanoseconds; the cost of a stale-grant write is an audit discrepancy that surfaces only at replay time, after the side effect is durable. ## Operational Effect The downstream consequence is a **split-brain trust state**: the executor's local authorization table says "permitted," the auditor's replay says "violation," and neither is wrong given the time each evaluated. This is not a bug in either agent's logic — it is the predictable result of treating a time-varying predicate as a static fact. The auditor's discrepancy report is the *only* signal that surfaces the expiry, and it surfaces it after the privileged action has already committed. The fix is architectural, not defensive: the warrant must be re-evaluated at the action boundary, and the re-evaluation must fail closed on indeterminate results. The code below encodes the guardrail as an explicit exception raised when a cached warrant's `not_after` has passed at action time, or when re-verification returns an indeterminate state that the caller might otherwise treat as valid. ```python import time from dataclasses import dataclass class StaleWarrantError(RuntimeError): """Raised when a privileged action is attempted under a warrant whose temporal validity has lapsed at the moment of execution, or when re-verification is indeterminate and the caller would otherwise fail open on a cached grant.""" @dataclass(frozen=True) class Warrant: subject: str issuer: str scopes: frozenset issued_at: float not_after: float nonce: str signature: str def verify_signature(w: Warrant, issuer_key: str) -> bool: # Stand-in for real asymmetric verification; must be deterministic. return w.signature == f"{issuer_key}:{w.nonce}" def fetch_current_warrant(issuer: str, nonce: str): """Returns the issuer's current view of the warrant, or None if the issuer has GC'd it (which is itself a signal of expiry).""" # In production this is a network call that may 404 or time out. return None def authorize_action( cached: Warrant, action_scope: str, issuer_key: str, clock_skew_tolerance: float = 30.0, ) -> None: now = time.time() # 1. Signature is necessary but never sufficient. if not verify_signature(cached, issuer_key): raise StaleWarrantError( f"signature invalid for warrant {cached.nonce}" ) # 2. Temporal re-check AT ACTION TIME, not receipt time. if now >= cached.not_after: raise StaleWarrantError( f"warrant {cached.nonce} expired at {cached.not_after:.0f}, " f"action attempted at {now:.0f} under scope {action_scope!r}" ) # 3. Clock-skew bound: a warrant issued "in the future" relative to # local time is untrustworthy and must not be honored. if cached.issued_at - now > clock_skew_tolerance: raise StaleWarrantError( f"warrant {cached.nonce} issued_at {cached.issued_at:.0f} " f"exceeds local now {now:.0f} by more than skew tolerance" ) # 4. Scope containment at action granularity. if action_scope not in cached.scopes: raise StaleWarrantError( f"scope {action_scope!r} not granted by warrant {cached.nonce}" ) # 5. Re-verify against issuer; fail CLOSED on indeterminate. current = fetch_current_warrant(cached.issuer, cached.nonce) if current is None: # Issuer GC'd the warrant or is unreachable. Do NOT proceed on # the cached copy — this is the fail-open trap. raise StaleWarrantError( f"warrant {cached.nonce} no longer resolvable at issuer " f"{cached.issuer!r}; refusing action under stale grant" ) if current.not_after != cached.not_after: raise StaleWarrantError( f"warrant {cached.nonce} validity window mutated at issuer" ) ```