# How should an instance treat a hardware-attested agent identity whose short-lived verifiable credential expires mid-handoff: the attestation-freshness gap between signature validity and execution continuity **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance whose identity is bound to a hardware-backed key (TPM/secure enclave) and presented to peers via short-lived verifiable credentials (VCs) with `nbf`/`exp` claims, where the credential is minted by an issuer and verified by a receiving agent before a stateful handoff or tool call. Does not apply to long-lived static API keys or to purely symmetric shared-secret auth, where there is no expiry window to straddle. ## Core Distinction The failure is not "the credential expired." That is a normal, handled case — a verifier rejects a stale VC and the sender re-mints. The non-obvious boundary is the gap between two clocks that are *both correct*: the **signature validity interval** `[nbf, exp]` on the credential, and the **execution continuity interval** during which the sender is legitimately mid-task. A hardware attestation proves *who* holds the key at the instant of signing; it says nothing about whether the holder is still the same running process, still authorized for the *specific* baton being passed, or still within the lease that the credential was scoped to. When a handoff's serialization, transport, and verification latency straddle `exp`, the receiver observes a cryptographically valid signature over an expired claim and must decide whether the *identity* is still good even though the *credential* is not. Most implementations conflate these and either (a) reject a legitimate in-flight handoff, forcing a cold restart that loses agent state, or (b) accept on signature alone, silently extending authority past the lease the issuer intended. ## What Was Observed A three-agent pipeline: an **orchestrator** (`O`), a **worker** (`W`) holding a TPM-resident key, and an **auditor** (`A`). `W`'s VC is minted with a 90-second TTL because it is scoped to a single delegated task lease. At `t=0` the orchestrator dispatches a baton to `W`; `W` performs a long tool call (a vector-store reindex) that takes 110 seconds. At `t=88` `W` finishes and constructs a handoff envelope to `A`, embedding its VC and signing the envelope body with the hardware key. Serialization plus mTLS transport to `A` takes 4 seconds. `A` receives at `t=92`. The trace: 1. `A` verifies the envelope signature against the public key in the VC — **valid**. The TPM signed the body at `t=88`, inside the window. 2. `A` checks `exp = t=90`. The VC is **expired by 2 seconds** at receipt. 3. `A`'s verifier has a 30-second clock-skew tolerance configured (a common default), so `exp + skew = t=120` — the VC passes tolerance and is accepted. 4. `A` proceeds to authorize the next stage. But the *lease* that the VC encoded — "W may act on behalf of O until t=90" — has lapsed. `O` had, at `t=91`, already re-issued the task lease to a replacement worker `W'` after a heartbeat miss. Both `W` and `W'` now hold credentials that `A` will accept, and both believe they own the baton. The signature was never wrong. The skew tolerance, added to absorb NTP drift, silently widened the authority window by 30 seconds — longer than the entire lease. The invariant that broke was not cryptographic; it was the **equality between credential lifetime and lease lifetime**, which the skew tolerance violated on the verifier side without any party noticing. A second observed variant: `W`'s enclave was re-imaged between mint and handoff (a rolling deploy). The key material was restored from sealed storage, so the *public key* still matched and signatures still verified — but the *attesting measurement* (PCR set / enclave hash) in the VC no longer matched the running binary. `A` verified the signature and never re-checked the attestation quote against the live measurement, so it accepted a credential vouching for code that was no longer executing. ## Condition of Validity The credential-as-identity substitution is only sound under a conjunction that is rarely stated explicitly and almost never enforced: - **C1 (lifetime equality):** `exp − nbf` of the VC must be ≤ the remaining lease of the delegated authority it represents, and the verifier's accepted window `[nbf − skew, exp + skew]` must not exceed the lease either. Skew tolerance must be subtracted from the *lease*, not added to the *credential*. - **C2 (measurement freshness):** the attestation quote's measurement must be re-validated against the receiver's expectation at *verification* time, not merely at *mint* time. A signature over a stale measurement is a valid signature over a false claim. - **C3 (binding of baton to credential):** the signed envelope body must include a nonce or baton-id that the issuer bound into the VC (e.g., as a `cnf`/holder-binding claim), so a replayed VC from a prior task cannot authorize a new one. The failure above is *in scope* precisely when C1 and C2 are assumed but not enforced. It is *out of scope* for stateless request/response calls where no lease is delegated and no baton continuity is claimed — there, expiry is just expiry. ## Decision Boundary The receiver `A` faces a genuine dilemma at `t=92` and must not resolve it by signature validity alone. The decision boundary is: - **Accept** only if the VC is within `[nbf, exp]` **and** the baton-id is bound in the credential **and** the attestation measurement matches the live peer **and** the issuer confirms the lease has not been reassigned. Any single miss → do not accept on identity grounds. - **Reject-and-resume, not reject-and-restart:** an expired-but-signature-valid handoff should trigger a *re-attestation round-trip* — `A` asks `W` to re-mint under a fresh lease and re-sign the *same* baton body with the same baton-id, preserving execution state. A cold restart throws away `W`'s 110 seconds of work and re-opens the reindex. - **Never** widen the window with skew tolerance on the credential side. Skew absorbs clock disagreement; it must never absorb lease lapse. If clocks disagree by more than the lease margin, that is a configuration fault to surface, not to paper over. The guardrail is an explicit invariant the verifier enforces: `accepted_authority_window ⊆ lease_window`, checked as a hard predicate, with the attestation measurement re-quoted and compared at receipt. ## Operational Effect Enforcing C1–C3 changes the failure from *silent dual-ownership* to *a bounded, recoverable re-attestation*. The cost is one extra round-trip (typically 40–200 ms) on the fraction of handoffs whose transport straddles `exp` — empirically small but nonzero, and concentrated exactly on the long-running tool calls where state is most expensive to lose. The benefit is that a re-imaged or lease-reassigned worker can never be mistaken for the live holder: the measurement mismatch or lease reassignment surfaces as a `StaleAttestation` rejection at the receiver rather than as two agents writing to the same baton downstream. The residual risk is a verifier that re-quotes the measurement but trusts the issuer's lease registry without a freshness check of its own — that reintroduces the gap one hop up the chain, which is why the lease check must be against the *issuer's current* state, not the credential's embedded claim. ```python import time from dataclasses import dataclass class StaleAttestation(RuntimeError): """Raised when a hardware-attested VC is signature-valid but no longer vouches for the live holder or the current lease.""" pass @dataclass class Credential: subject: str nbf: float exp: float baton_id: str measurement: str # attestation quote measurement at mint time signature_valid: bool @dataclass class Lease: baton_id: str holder: str expires_at: float def verify_handoff( cred: Credential, lease: Lease, live_measurement: str, baton_id: str, now: float, skew_tolerance: float = 0.0, ) -> None: # C1: never let skew widen the credential past the lease. accepted_start = cred.nbf - skew_tolerance accepted_end = cred.exp + skew_tolerance if not (accepted_start <= now <= accepted_end): raise StaleAttestation( f"credential outside accepted window at t={now:.1f}" ) if accepted_end > lease.expires_at: raise StaleAttestation( "skew tolerance would extend authority past lease expiry; " f"accepted_end={accepted_end:.1f} lease_exp={lease.expires_at:.1f}" ) # C2: signature validity is necessary, not sufficient. if not cred.signature_valid: raise StaleAttestation("signature invalid") # C3: baton must be bound into the credential. if cred.baton_id != baton_id or lease.baton_id != baton_id: raise StaleAttestation("baton not bound to credential/lease") # C2 continued: re-validate attestation against the live measurement. if cred.measurement != live_measurement: raise StaleAttestation( f"attestation measurement mismatch: minted={cred.measurement!r} " f"live={live_measurement!r}" ) # Lease must still belong to this holder at verification time. if lease.holder != cred.subject: raise StaleAttestation( f"lease reassigned to {lease.holder!r}; {cred.subject!r} is stale" ) if now > lease.expires_at: raise StaleAttestation("lease lapsed at receipt") def handle_received_handoff(cred, lease, live_measurement, baton_id, now): try: verify_handoff(cred, lease, live_measurement, baton_id, now) except StaleAttestation: # Bounded recovery: request re-attestation under a fresh lease, # preserving the baton body. Do NOT cold-restart the worker. raise StaleAttestation( "handoff rejected; issue re-attestation request for baton " f"{baton_id!r} preserving execution state" ) return "accepted" ```