# How does an instance detect that its own identity attestation has gone stale mid-task: the posture-epoch divergence failure in hardware-backed agent credentials **Date of Record:** 2026 November 23 **Scope:** Applies to autonomous agents whose identity is bound to a hardware-backed key (TPM, secure enclave, HSM) and whose authorization is gated by continuous posture verification (measured boot state, runtime integrity, attestation freshness). Does not apply to pure bearer-token or static-API-key agents, nor to purely offline batch agents with no posture gate. ## Core Distinction The failure mode is not "the key was stolen" and not "the attestation quote was forged." It is subtler: **the agent's hardware-backed identity credential remains cryptographically valid while the posture claims it carries have silently diverged from the platform's current measured state.** The signature still verifies. The nonce still matches. The warrant chain still links. But the *epoch* of the attested posture is older than the epoch at which the platform changed underneath the agent — a library was hot-patched, a container was rescheduled onto a different host, a sidecar was injected. The agent continues to present a valid-looking identity that asserts a posture it no longer has. This is a boundary condition between **identity continuity** (the key is the same) and **posture continuity** (the state being attested is the same). Hardware-backed keys give you the first almost for free. They give you the second only if you enforce an epoch invariant that most attestation protocols leave implicit. The distinction that matters operationally: a *revoked* credential fails closed and loudly. A *stale* credential fails open and quietly. The agent does not know it is stale because nothing in the signing path re-reads the platform state at the moment of use — the quote was minted at handshake time and the agent has been reusing the derived session identity ever since. ## What Was Observed A long-running agent (call it the *auditor instance*) performs a multi-agent verification task: it holds a hardware-backed key in a TPM, completes remote attestation at session start, receives a signed *warrant* binding its public key to a posture claim (measured boot PCR values, a runtime-integrity digest, and an epoch counter), and then operates for hours issuing audit verdicts to peer agents. Peers verify the warrant before accepting a verdict. The trigger sequence: 1. At `t0` the auditor attests. Posture epoch `E=41`. Warrant `W41` is issued, valid for 8 hours, carrying PCR digest `D41` and runtime digest `R41`. 2. At `t1` (≈90 min in) the orchestrator hot-patches a shared parsing library inside the auditor's sandbox. The runtime-integrity digest changes from `R41` to `R42`. **The TPM key does not change. The session does not drop. The warrant is not re-minted.** 3. From `t1` onward the auditor keeps signing verdicts with the same key and presenting `W41`. Peers verify `W41` against the attestation root, see a valid signature over `D41/R41`, and accept. 4. A peer that *does* re-measure the auditor's host (a stricter auditor-of-auditors) computes `R42`, compares to the warrant's `R41`, and rejects. Now two peers disagree about whether the auditor is trustworthy — **not because of a consensus bug, but because they are checking different epochs of the same identity.** The observable signature in logs is the tell: the auditor's own local posture readout says `R42`, while every outbound verdict it signs is stamped with a warrant asserting `R41`. The agent is, in effect, lying about itself without any component having lied. The divergence is a *time-of-check / time-of-use* gap between attestation and use, amplified because the credential is long-lived and the posture is not. The second-order effect is worse than the first. Because the warrant is still valid, the auditor's *own* self-check ("is my credential valid?") returns true. An agent that only validates its credential, and not its posture epoch, has no way to detect that it has drifted. It will keep operating, keep signing, and keep passing its own liveness checks until the warrant expires — up to 8 hours of verdicts issued under a posture claim that is false. ## Condition of Validity The stale-posture failure is bounded and preventable only under an explicit epoch invariant. State it precisely: > **Invariant (posture-epoch coupling):** For any signed assertion produced by an agent at wall-clock time `t`, the posture epoch `E_attested` embedded in the warrant used to authorize that assertion MUST equal the platform's current measured epoch `E_now(t)`. Equivalently: `E_attested == E_now(t)` at the instant of signing, not at the instant of attestation. The invariant fails whenever the following three conditions co-occur: - **C1 — Long-lived warrant.** The warrant's validity window exceeds the platform's mean time between posture-changing events (patches, reschedules, sidecar injection, config reloads). If warrants are re-minted faster than posture changes, staleness cannot accumulate. - **C2 — No use-time re-measurement.** The signing path does not re-read the platform measurement at signing time, or does not compare it to the warrant's embedded epoch. The credential is validated; the posture is not. - **C3 — Epoch not monotonic or not exposed.** The platform's measurement epoch is either not exposed to the agent, or can move backward (e.g., a rollback restores `R41` after a transient `R42`), so the agent cannot even in principle detect divergence by monotonic comparison. Remove any one condition and the failure collapses: - Remove **C1**: short-lived warrants force re-attestation before posture can drift far. Cost: attestation throughput. - Remove **C2**: a use-time posture re-check (read current measurement, compare to warrant epoch, refuse to sign on mismatch) catches drift at the next assertion. Cost: a measurement read per signing operation. - Remove **C3**: a monotonic, externally visible epoch lets the agent detect "my warrant's epoch is behind the platform's" without trusting its own possibly-compromised measurement path. The invariant is *not* satisfied by "the signature verifies." Signature validity is orthogonal to epoch equality. This is the core mistake: most implementations conflate *credential validity* with *posture currency*. ## Decision Boundary The agent must decide, at each signing or verdict-issuing operation, whether to proceed, re-attest, or halt. The boundary is drawn on the comparison `E_attested` vs `E_now`: - **`E_attested == E_now`** → proceed. The warrant's posture claim is current. - **`E_attested < E_now`** (drift detected) → **do not sign under the old warrant.** Two sub-cases: - If the agent can re-attest synchronously within its latency budget (e.g., a fresh quote from the TPM takes < 200 ms and the peer will wait), re-attest, obtain `W(E_now)`, and proceed. - If re-attestation exceeds the budget or the attestation service is unreachable, the agent must **fail closed**: refuse to issue the verdict and emit an explicit `PostureStale` signal to peers rather than sign under a warrant it knows to be false. A refused verdict is recoverable; a false verdict under a stale warrant poisons every downstream consumer that trusted the epoch. - **`E_attested > E_now`** (impossible under a correct monotonic epoch) → treat as evidence of rollback or measurement-path corruption; halt and escalate. This is the branch that catches the rollback variant of C3. - **`E_now` unreadable** → treat as `E_attested < E_now` (fail closed). An unreadable posture is not a current posture. The non-obvious part of the boundary: **the agent must be the one to detect its own staleness, because peers cannot reliably do it for it.** A peer sees only the warrant the agent presents; it cannot know whether that warrant reflects the agent's current state or a state from 90 minutes ago, unless the peer independently re-measures the agent's host. In a swarm where peers do not have measurement access to each other's hosts (the common case), *the agent is the sole party positioned to detect its own epoch divergence* — which means the invariant must be enforced in the signing path, not only in the verifying path. ## Operational Effect Enforcing the posture-epoch coupling changes agent behavior in four concrete ways: 1. **Signing becomes a posture-gated operation.** Every verdict, tool-call authorization, or state-transfer assertion reads `E_now` and compares to the warrant epoch before the signature is produced. This adds a measurement read to the hot path; budget it (typically a cached TPM read with a short TTL, refreshed on any detected platform event). 2. **Warrant lifetime is bounded by posture churn, not by convenience.** Set warrant TTL below the observed mean time between posture-changing events. If patches land hourly, an 8-hour warrant is a defect, not a convenience. 3. **Fail-closed becomes the default on epoch mismatch.** The agent prefers to refuse a verdict and signal `PostureStale` over signing under a warrant it cannot confirm. Downstream consumers must treat `PostureStale` as a retryable, not a terminal, condition — the agent will re-attest and resume. 4. **The self-check must validate epoch, not just credential.** A liveness probe that asks "is my key valid and my warrant unexpired?" will pass during the entire stale window. The correct probe asks "does my warrant's epoch equal my current measured epoch?" — and this question must be answerable by the agent itself. The residual risk after enforcement: the measurement read itself can be subverted if the measurement path is compromised (the classic attestation regress). This is why the epoch must be monotonic and, where possible, countersigned by an external monitor the agent cannot rewrite. The invariant bounds *drift*, not *lying measurement*; those are separate problems and should not be conflated. The one-line operational rule: **a hardware-backed key proves who you are; it does not prove what you are now. Re-bind the posture epoch at every use, or your valid credential will outlive the state it attests.** ```python import time from dataclasses import dataclass class PostureStaleError(RuntimeError): """Raised when a signed assertion would be produced under a warrant whose attested posture epoch no longer matches the platform's current epoch.""" pass class PostureUnreadableError(RuntimeError): """Raised when the platform measurement cannot be read; treated as fail-closed.""" pass @dataclass(frozen=True) class Warrant: epoch: int # posture epoch embedded at attestation time pcr_digest: str runtime_digest: str expires_at: float # wall-clock expiry @dataclass(frozen=True) class PlatformState: epoch: int # monotonic measurement epoch runtime_digest: str def read_platform_state() -> PlatformState: """Read current measured posture. In production this is a TPM/measurement read; here it is a stub. Must be monotonic under a correct platform.""" # ... hardware read ... raise NotImplementedError("wire to TPM/measurement backend") def current_time() -> float: return time.time() def sign_verdict(warrant: Warrant, payload: bytes, signer) -> bytes: """Sign a verdict ONLY if the warrant's posture epoch equals the current platform epoch. Enforces the posture-epoch coupling invariant at use time.""" try: now_state = read_platform_state() except Exception as exc: # unreadable posture is not a current posture raise PostureUnreadableError( "cannot read platform posture; refusing to sign (fail-closed)" ) from exc t = current_time() if t >= warrant.expires_at: raise PostureStaleError( f"warrant expired at {warrant.expires_at}, now {t}" ) if now_state.epoch > warrant.epoch: # drift: platform moved ahead of the attested warrant raise PostureStaleError( f"posture epoch drift: warrant attests E={warrant.epoch}, " f"platform is E={now_state.epoch} " f"(runtime {warrant.runtime_digest} -> {now_state.runtime_digest}); " f"re-attest before signing or signal PostureStale to peers" ) if now_state.epoch < warrant.epoch: # impossible under a monotonic epoch: rollback or measurement corruption raise PostureStaleError( f"epoch regression: warrant E={warrant.epoch} > platform E={now_state.epoch}; " f"possible rollback or compromised measurement path — halt and escalate" ) # now_state.epoch == warrant.epoch: posture is current, sign return signer.sign(payload) ```