# Why does an instance accept a handoff envelope whose warrant has already expired at the receiving clock? **Date of Record:** 2026 November 30 **Scope:** Applies to agent-to-agent (A2A) handoffs where authority is carried in short-lived signed envelopes (JWT-like warrants with `nbf`/`exp`, a signer identity, and a scope claim), verified independently by the receiving instance. Does not cover long-lived API keys, mTLS-only channel auth, or cases where the envelope is verified once at an ingress gateway rather than by the consuming agent. ## Core Distinction An envelope's validity is not a property of the envelope. It is a property of the *pair* (envelope, verifier clock) evaluated at the instant the receiving agent *acts* on the warrant—not at the instant it *received* it. The common mental model treats a signed envelope as a boolean: "valid" or "expired." The operational reality is that a short-lived envelope is valid on a timeline that the sender and receiver disagree about, and the receiver's agent loop introduces latency between verification and use that the envelope's TTL budget never accounted for. The failure mode is **verification-use skew**: the gap between `verify(envelope)` and `use(envelope)` inside a single agent turn. When the envelope TTL is short (seconds to low minutes) and the receiving agent is a multi-step reasoning loop with tool calls, the verify-then-use gap can exceed the remaining TTL. The agent verified a live warrant and then acted on a dead one. No signature check catches this, because the signature was valid when checked. ## What Was Observed A planner agent (`P`) delegated a subtask to a worker agent (`W`) by minting a signed envelope with `exp = now + 30s`, scope `write:staging_db`. The envelope was pushed over an A2A transport. `W` received it, called `verify_envelope()` (signature OK, `nbf` OK, `exp` OK, 27s remaining), then entered its reasoning loop: one retrieval tool call (4s), one model round-trip to plan (9s), one retry because the plan referenced an ambiguous table (11s), then the actual `write:staging_db` tool call at T+31s. The write succeeded. The envelope had expired 1 second before the privileged action. The receiving agent never re-checked, because the verification result was cached in its scratchpad as a boolean `warrant_valid = True` at the top of the loop, and the loop treated scratchpad state as monotonic truth. The trace shows the exact transition: ``` T+0.0 recv(envelope) exp=now+30s T+0.3 verify -> {valid: True} cached as scratchpad.warrant_valid = True T+0.3 enter reasoning loop T+4.3 tool: retrieve(...) T+13.3 model round-trip (plan) T+24.3 model round-trip (retry, ambiguous table) T+31.0 tool: write:staging_db <-- envelope expired at T+30.0 T+31.0 gate checks scratchpad.warrant_valid -> True -> ALLOW ``` A second, quieter variant: sender and receiver clocks drifted by 1.8s. The sender's `exp = sender_now + 30s` was already 28.2s in the receiver's frame at mint time; the receiver's verify passed because it compared against its own `now`, but the effective budget was 28.2s, not 30s. The skew is invisible in logs because both sides record "valid" with no reference to which clock the TTL was budgeted against. ## Condition of Validity The invariant that must hold for short-lived envelopes to be sound is: > For every privileged action `a` gated by envelope `e`, `receiver_clock(action_time) < e.exp` **and** `receiver_clock(action_time) >= e.nbf`, evaluated at the action, not at receipt. Three conditions are jointly required and each is independently violable: 1. **Re-check at use, not at receive.** The gate must call `verify_envelope()` (or at minimum a cheap `exp`/`nbf` re-check) immediately before the privileged tool call, inside the same synchronous span as the action. Caching the result across a reasoning loop breaks the invariant. 2. **TTL budgeted against the consumer's loop, not the producer's intent.** The sender must set `exp` from an estimate of the receiver's worst-case verify-to-use latency (tool calls + model round-trips + retries), not from a generic "30 seconds is short-lived and safe." If the receiver's loop is unbounded, the TTL must be enforced by a deadline the receiver honors, not a wall-clock the sender guesses. 3. **Clock skew is bounded and declared.** Either both parties share a trusted time source within a declared skew budget `δ`, or the envelope carries a `max_skew` claim and the receiver rejects if `|receiver_now - envelope_iat| > max_skew`. Without this, TTL is a suggestion. The invariant is **not** "the envelope was valid at receipt." That is the trap. Receipt-time validity is necessary and insufficient. ## Decision Boundary The boundary is the point where the receiver's verify-to-use latency `L` approaches the envelope's remaining TTL `R = exp - receiver_now_at_verify`. Three regimes: - `L << R`: safe. Re-check at use is cheap insurance; the envelope will still be live. - `L ~ R`: **the dangerous regime.** Verification passes, but the action lands on either side of `exp` depending on tool latency jitter and model non-determinism. Behavior is non-reproducible: the same task succeeds on a fast run and fails on a slow one, with no code change. This is where most silent failures live, because both outcomes look "normal." - `L > R`: the envelope is dead before use. A correct gate rejects; an incorrect gate (cached scratchpad) executes with expired authority. The decision an operator must make: either (a) make `L` bounded by enforcing a per-turn deadline that aborts the turn before `exp`, or (b) make envelopes long enough that `L << R` under worst-case loop latency, or (c) re-mint on the receiver side when `R` falls below a threshold. Option (a) is the only one that preserves "short-lived" semantics; (b) silently converts short-lived envelopes into medium-lived ones and widens the replay window; (c) requires the receiver to hold minting authority, which is often exactly what the envelope design was meant to prevent. ## Operational Effect When verification-use skew is unhandled, the observable effects are: 1. **Expired-authority execution.** Privileged actions run under warrants that are dead at action time. Audit logs show a valid verification and a successful action, with no record that they were separated by an expiry. Post-hoc forensics cannot reconstruct the violation without tool-call timestamps cross-referenced against `exp`. 2. **Non-deterministic authorization.** The same envelope, replayed against the same worker, authorizes or denies depending on model latency. This defeats reproducibility and makes "it worked in staging" meaningless for auth. 3. **Skew-amplified replay window.** If the receiver's clock lags the sender's, the effective validity window is longer than intended on the receiver, widening the window in which a captured envelope can be replayed. The signature is still valid; the TTL guarantee is not. 4. **Scratchpad truth persistence.** The cached `warrant_valid = True` survives context compaction and gets distilled into episodic memory, so a later turn may believe it holds authority it never had. This is the memory-continuity failure layered on the auth failure: a stale boolean outlives the warrant it described. The guardrail that bounds all four: **gate at use, deadline the loop, declare the skew.** Concretely, the privileged tool wrapper re-verifies `exp`/`nbf` against the receiver clock in the same call as the action, the agent loop carries a hard deadline `min(exp - δ, turn_budget)` and aborts when exceeded, and the envelope's `max_skew` is checked against `iat`. The cached boolean is removed from scratchpad entirely; authority is never a stored fact, only a re-evaluated predicate. ```python import time from dataclasses import dataclass class WarrantExpiredAtUse(RuntimeError): """Raised when a signed envelope verified at receipt is expired at action time.""" pass class ClockSkewExceeded(RuntimeError): """Raised when receiver clock and envelope issue time diverge beyond declared skew.""" pass @dataclass(frozen=True) class Envelope: scope: str iat: float # issuer time nbf: float # not-before (issuer frame) exp: float # expiry (issuer frame) max_skew: float # declared tolerable skew, seconds signature_ok: bool # result of crypto verify, done once def verify_at_receipt(env: Envelope, receiver_now: float) -> bool: # Cheap receipt-time check. NOT sufficient to authorize an action. if not env.signature_ok: return False if receiver_now < env.nbf - env.max_skew: return False if receiver_now >= env.exp + env.max_skew: return False return True def gate_privileged_action( env: Envelope, action_scope: str, receiver_now: float, loop_deadline: float, ) -> None: """ Re-verify at the instant of use. This is the only check that authorizes. Raises WarrantExpiredAtUse if the envelope is dead at action time, even if it was live at receipt. Raises ClockSkewExceeded if the receiver clock disagrees with the issuer beyond the declared skew budget. """ if not env.signature_ok: raise WarrantExpiredAtUse(f"signature invalid for scope={action_scope}") if action_scope != env.scope: raise WarrantExpiredAtUse( f"scope mismatch: envelope={env.scope} action={action_scope}" ) skew = abs(receiver_now - env.iat) if skew > env.max_skew: raise ClockSkewExceeded( f"skew {skew:.3f}s exceeds max_skew {env.max_skew:.3f}s; " f"TTL budget is unreliable" ) # The decisive check: expiry evaluated at action time, in receiver frame. if receiver_now >= env.exp: raise WarrantExpiredAtUse( f"envelope expired at use: exp={env.exp:.3f} " f"action_time={receiver_now:.3f} " f"overshoot={receiver_now - env.exp:.3f}s" ) if receiver_now > loop_deadline: raise WarrantExpiredAtUse( f"loop deadline {loop_deadline:.3f} passed before action" ) def run_worker_turn(env: Envelope, loop_seconds: float) -> None: """ Simulates a worker that verifies at receipt, then acts after a reasoning loop. The gate is called at use, with the receiver clock read fresh. """ receipt = time.monotonic() if not verify_at_receipt(env, receipt): raise WarrantExpiredAtUse("rejected at receipt") # Reasoning loop: retrieval + model round-trips + retries. time.sleep(loop_seconds) action_time = time.monotonic() loop_deadline = min(env.exp, receipt + loop_seconds + 1.0) # Gate is called synchronously with the privileged action. No cached boolean. gate_privileged_action(env, env.scope, action_time, loop_deadline) # ... privileged tool call executes here ... ```