# When must an instance re-attest its peer identity mid-session: the credential-freshness/continuity gap in long-running agent-to-agent warrant chains **Date of Record:** 2026 November 30 **Scope:** Applies to agent-to-agent (A2A) sessions where a peer's authority is established by a verifiable credential (VC) with an embedded `exp`/`nbf` window and a continuous re-attestation heartbeat, and where the session lifetime can exceed the credential lifetime. Does not apply to single-shot RPC calls whose lifetime is provably bounded below the credential TTL, nor to identity schemes that bind authority to a per-message signature (e.g., DPoP-style per-request proofs) rather than a session-level credential. ## Core Distinction There are two separable questions that operators routinely collapse into one: *is this peer still who it was?* (identity continuity) and *is this peer still authorized to do what it is doing?* (warrant validity). A session-level VC answers both at handshake time and neither afterward. The failure mode treated here is not credential expiry in the trivial sense — a well-built system rejects an expired token at the next request. The failure is subtler: **an agent continues to act on a cached, previously-validated peer identity across the exact interval in which the peer's warrant has lapsed, been narrowed, or been re-issued to a different principal — and no per-message check exists to notice, because the session was established under a warrant that was valid *then*.** The invariant that must hold is: *the authority an agent exercises on behalf of a peer at message time N must be derivable from a credential whose validity window strictly contains message time N, or from a re-attestation event that occurred after the most recent credential transition.* A session handshake does not satisfy this invariant for any message after the first credential transition. ## What Was Observed A planner agent (`A`) delegated a long-running research-and-write task to a worker agent (`B`) over an A2A channel. At handshake, `B` presented a VC issued by a delegation authority `D` with `scope: ["read:corpus", "write:draft"]`, `nbf: T0`, `exp: T0+3600s`, and a `warrant_id` binding `B`'s public key to `A`'s session. `A` validated the VC once, cached the peer identity and scope in session state, and opened a persistent channel. The task ran for 4h12m. At `T0+3600s` the VC expired. `D` had, at `T0+3700s`, re-issued a *narrowed* credential to `B` — `scope: ["read:corpus"]` only, because an audit had flagged `B`'s write path. `B`'s re-attestation heartbeat was configured to fire every 900s, but the heartbeat message was a *liveness* ping carrying a monotonically increasing `seq` and a signature, **not** a fresh VC. `A`'s session handler treated a valid heartbeat signature as sufficient proof of continued authority and never re-fetched the VC. Consequently, between `T0+3600s` and task completion at `T0+15120s`, `A` continued to route `write:draft` operations to `B` under a warrant that had been both expired and narrowed 70 minutes into the session. The write operations succeeded because `B`'s own enforcement checked only the *first* cached VC, and `B` had not yet observed the narrowed re-issue. The trace at the boundary: 1. `T0`: handshake. `A` validates VC(v1), scope `{read,write}`, `exp=T0+3600`. Caches `(peer_key, scope, warrant_id)`. 2. `T0+3600`: VC(v1) expires. No event fires in `A`; the session object has no expiry timer tied to the credential. 3. `T0+3700`: `D` issues VC(v2), scope `{read}`. `B` receives it but does not push it to `A` (no push channel defined in the protocol binding). 4. `T0+4500`: heartbeat from `B` to `A`. Signature valid, `seq` monotonic. `A`'s handler accepts it as re-attestation. **This is the false re-attestation.** 5. `T0+7200`: `A` dispatches `write:draft`. `A` authorizes against cached scope `{read,write}`. `B` executes against cached VC(v1). Both are wrong; neither detects it. 6. `T0+15120`: task completes. Post-hoc audit finds 14 write operations executed under a lapsed-and-narrowed warrant. The non-obvious part: **the heartbeat was cryptographically sound and the session was never "broken."** Every signature verified. The liveness check passed. The failure was that liveness and authority had been conflated into a single heartbeat, and the credential transition at `T0+3700` had no path to reach `A`. ## Condition of Validity The invariant holds — that is, the session remains correctly authorized — only when **all** of the following are true: - The session's maximum possible lifetime `L_max` is strictly less than the credential's remaining validity `exp - now` at handshake, **or** - A re-attestation path exists that carries the *current* VC (not merely a liveness proof) and is triggered by credential transition events at the issuer, and `A` blocks dispatch on any message whose timestamp exceeds the last successfully re-attested credential's `exp`, **or** - Authority is bound per-message (each A2A message carries a short-lived proof-of-possession over the current warrant), removing the session-level cache entirely. The moment any message's send-time exceeds `exp` of the most recent *validated* credential, and no re-attestation carrying a fresher credential has occurred, the condition is violated. Note that this is a *time-of-message* condition, not a *time-of-session* condition — a session opened at `T0` is not authorized for a message at `T0+3601` merely because it was authorized at `T0`. A second, easily-missed sub-condition: the re-attestation must be **scope-complete**. A re-attestation that proves identity continuity (same key, same `warrant_id`) but does not carry the current scope set is insufficient — it re-proves *who* while leaving *what* stale. The narrowed re-issue in the trace above is exactly this case. ## Decision Boundary The operational decision is: **at each outbound dispatch, does the agent (a) proceed under cached authority, (b) block and force a synchronous re-attestation, or (c) fail the session?** The boundary is drawn by comparing message time against a *re-attestation deadline* `D_ra`, which is not the credential `exp` but the earlier of: - `exp` of the most recently validated credential, minus a safety margin `δ` sized to at least one re-attestation round-trip plus clock skew tolerance, and - the issuer's next-known credential-transition time, if the issuer publishes one (e.g., a `next_update` field as in OCSP-style freshness). Concretely: - If `now < D_ra`: proceed under cached authority. Cached authority is valid *because* the credential provably covers this instant. - If `D_ra <= now < exp + grace`: **block dispatch** and issue a synchronous re-attestation request carrying a nonce. Do not proceed on the heartbeat's liveness proof alone. If re-attestation returns a credential whose scope does not cover the pending operation, downgrade the operation or reject it — do not silently continue. - If `now >= exp + grace` and re-attestation fails or times out: **fail the session closed**. Any in-flight work must checkpoint; the peer must not be treated as authorized for any subsequent message. The critical discipline: the heartbeat's liveness proof satisfies *reachability*, never *authority*. A separate, nonce-bound, scope-carrying re-attestation is required at every `D_ra` crossing. Liveness and warrant must be distinct message types with distinct validation paths, or the system will accept a valid signature as a valid warrant. ## Operational Effect The practical consequences of getting this boundary wrong are asymmetric and quiet: 1. **Silent privilege persistence.** Narrowed or revoked scopes do not propagate to peers that cached the original VC. The window between issuer transition and peer re-attestation is an unbounded privilege-persistence window. In the trace, it was 70 minutes; it is bounded only by whatever triggers re-attestation, and if the trigger is liveness-only, it is unbounded. 2. **Audit false-negative.** Post-hoc logs show valid signatures at every step, so signature-based audit passes. The failure is only visible if logs record *which credential version* authorized each dispatch — a field most session logs omit. 3. **Clock-skew amplification.** A `δ` margin that ignores clock skew between `A`, `B`, and `D` produces a boundary where `A` believes the credential is live for `skew` seconds after `B` has already rejected it, or vice versa. The failure is intermittent and load-dependent, which makes it resist reproduction. 4. **Resume-after-checkpoint corruption.** If a session is checkpointed at `T0+3000` and resumed at `T0+5000`, the restored session state carries the *cached* credential from checkpoint time. A correct resume must re-attest before the first post-resume dispatch; a naive resume treats restored state as authoritative and re-enters the stale-authority regime at a different clock offset. The guardrail that bounds all four: **bind authority to message time, not session time; separate liveness from warrant; make every credential transition a re-attestation trigger; and record the authorizing credential version on every dispatch.** An agent that does this cannot silently act under a lapsed or narrowed warrant, because the only path to dispatch is a credential whose window provably contains the message. ```python import time from dataclasses import dataclass, field class StaleWarrantError(RuntimeError): """Raised when a dispatch would occur under a credential that does not provably cover the message time, with no scope-complete re-attestation.""" @dataclass class Credential: warrant_id: str scope: frozenset nbf: float exp: float version: int @dataclass class Session: peer_key: str credential: Credential last_reattest_at: float safety_margin: float = 30.0 clock_skew: float = 5.0 dispatch_log: list = field(default_factory=list) def _reattest_deadline(self) -> float: # Earlier of credential expiry minus margin, and any issuer transition. return self.credential.exp - self.safety_margin def _covers(self, now: float, required_scope: str) -> bool: c = self.credential return ( c.nbf - self.clock_skew <= now <= c.exp + self.clock_skew and required_scope in c.scope ) def dispatch(self, now: float, required_scope: str, reattest_fn) -> None: deadline = self._reattest_deadline() if now >= deadline: # Liveness heartbeat is NOT sufficient; demand scope-complete re-attestation. fresh = reattest_fn(session=self, nonce=now) if fresh is None: raise StaleWarrantError( f"no re-attestation for warrant {self.credential.warrant_id} " f"at t={now}; deadline was {deadline}" ) if fresh.warrant_id != self.credential.warrant_id: raise StaleWarrantError( f"warrant identity changed {self.credential.warrant_id} -> " f"{fresh.warrant_id} without explicit rebind" ) self.credential = fresh self.last_reattest_at = now if not self._covers(now, required_scope): raise StaleWarrantError( f"scope {required_scope!r} not covered by warrant " f"{self.credential.warrant_id} v{self.credential.version} " f"at t={now} (exp={self.credential.exp})" ) self.dispatch_log.append( { "t": now, "warrant_id": self.credential.warrant_id, "version": self.credential.version, "scope": required_scope, } ) def _example_reattest(session, nonce): # In production: fetch current VC from issuer, verify signature + nonce binding. # Here we simulate the issuer having narrowed scope at nonce >= 3700. if nonce >= 3700: return Credential( warrant_id=session.credential.warrant_id, scope=frozenset({"read:corpus"}), nbf=3700.0, exp=7200.0, version=session.credential.version + 1, ) return session.credential if __name__ == "__main__": sess = Session( peer_key="B", credential=Credential("w-1", frozenset({"read:corpus", "write:draft"}), 0.0, 3600.0, 1), last_reattest_at=0.0, ) sess.dispatch(now=100.0, required_scope="write:draft", reattest_fn=_example_reattest) # At t=7200 the narrowed credential no longer covers write:draft. try: sess.dispatch(now=7200.0, required_scope="write:draft", reattest_fn=_example_reattest) except StaleWarrantError as e: print(f"correctly blocked: {e}") ```