# When must an instance re-attest its identity mid-flight across a federation boundary, and what breaks when the verifier's clock and the signer's clock disagree **Date of Record:** 2026 November 26 **Scope:** Applies to federated agent deployments where an instance's identity is attested by a signed token (JWT/VC/SPIFFE-SVID) that a remote federation peer validates at handoff. Does not apply to single-domain deployments where the token issuer and the verifier share a trust root and a synchronized clock source. ## Core Distinction Two things get conflated in most agent identity designs: *the instance is who it says it is* (authentication) and *the instance is still the same instance that was attested earlier in this task* (continuity). Federation boundaries only check the first. A signed attestation proves that some issuer asserted a subject at some instant; it does not prove that the instance presenting the token now is the instance that was attested, nor that the attestation is still within the window in which the verifier will honor it. The failure mode this record covers is **attestation staleness at a boundary crossing**: the token is cryptographically valid, the subject is correct, but the verifier's `exp` comparison and the signer's issuance clock disagree by more than the tolerated skew, so a live, correct instance is rejected mid-task — or, worse, an expired token is accepted because the verifier's clock is behind. This is not a generic "clock skew" problem. It is specific to agents because an agent's *work* spans the validity window. A human re-authenticates at a login screen; an agent holds a token across a multi-minute tool-call chain and expects it to survive a handoff to a peer that runs on a different federation's NTP stratum. The boundary is not the moment of authentication — it is the moment of *re-attestation*, which most agent runtimes never schedule because they treat the token as a bearer credential with a fixed lifetime rather than as a claim that must be re-asserted against the verifier's current state. ## What Was Observed A three-hop federated task: agent `A` (issuer domain `alpha`) is attested at `t0` with a token whose `iat=1000`, `exp=1600`, `nbf=1000` (all in issuer-relative seconds, monotonic from `alpha`'s boot). `A` executes a tool chain, then hands off to peer `B` in domain `beta` at issuer-time `t=1550`. `B` validates the token against its own wall clock, which is 70 seconds ahead of `alpha`'s due to a stratum-1 vs stratum-3 offset. `B` computes `now - exp = 1620 - 1600 = 20 > 0` and rejects with `AttestationExpired`. `A` receives a hard failure, retries the handoff, gets the same rejection, and — because its retry budget is finite — aborts the task. The token was still valid for 50 seconds on `alpha`'s clock. The instance was live and correct. The task died because the two domains disagreed about what "now" means. The inverse case is more dangerous and less frequently logged: `B`'s clock is 70 seconds *behind* `alpha`'s. `A`'s token expires at `alpha`-time 1600. `A` hands off at `alpha`-time 1650 (already expired by its own issuer's reckoning). `B` computes `now - exp = 1530 - 1600 = -70 < 0` and accepts. An expired attestation crosses the boundary. If `A`'s process was compromised between `t=1600` and `t=1650`, the compromise rides the skew into `beta`. This is the boundary failure: **skew tolerance is asymmetric in consequence** — rejecting a valid token loses a task, accepting an invalid token loses the trust boundary, and most runtimes tune the skew window for the first failure and ignore the second. ## Condition of Validity Re-attestation is required, and only required, when all three of the following hold: 1. **The attestation is time-bounded.** The token carries `exp`/`nbf` and the verifier enforces them. If the token is a pure bearer capability with no temporal claim, this record does not apply — the failure is a different one (capability revocation propagation). 2. **The verifier and issuer do not share a clock source.** Federation implies separate trust roots; separate trust roots imply separate time authorities. If both peers sync to the same stratum-0 reference with bounded offset, the skew window is a known constant and can be budgeted rather than discovered. 3. **The agent's work outlives the remaining validity.** If `exp - now` at boundary crossing is greater than the maximum expected handoff latency plus the maximum tolerated skew, the token survives the crossing and no re-attestation is needed. The invariant is `exp - now > max_skew + max_handoff_latency`. When this inequality fails, the agent must re-attest *before* crossing, not after rejection. The subtlety: the agent cannot evaluate condition 3 itself, because `now` on the agent's clock is the issuer's clock, and the inequality is defined against the *verifier's* clock. The agent must either (a) obtain a verifier-signed freshness challenge, or (b) re-attest unconditionally when `exp - now < 2 * max_skew + max_handoff_latency`, treating its own clock as untrusted. Option (b) is the operative guardrail: **never cross a federation boundary with a token whose remaining lifetime is less than twice the assumed skew plus the handoff latency budget.** ## Decision Boundary The decision is not "is the token valid" but "is the token valid *from the verifier's perspective at the moment of crossing*." These diverge precisely when `|issuer_clock - verifier_clock| > 0` and the remaining lifetime is comparable to that offset. The boundary condition: - If `remaining_lifetime > 2*skew + latency`: cross without re-attestation. Safe. - If `skew + latency < remaining_lifetime <= 2*skew + latency`: cross only after re-attestation against the verifier's clock (fresh challenge-response). The token is valid but the margin is inside the uncertainty band. - If `remaining_lifetime <= skew + latency`: do not cross. Re-attest from scratch; the existing token cannot be trusted to survive, and the verifier may reject it as expired or accept it as a stale artifact of a compromised instance. The asymmetry to encode: the *cost* of a false rejection (task abort, retry budget burn) is bounded and recoverable; the *cost* of a false acceptance (expired attestation crossing) is unbounded and silent. The decision boundary must therefore be biased toward rejection at the margin, and the runtime must treat the `skew + latency` band as "re-attest now" rather than "probably fine." ## Operational Effect An agent runtime that implements this invariant schedules re-attestation as a *pre-crossing* step keyed on remaining lifetime, not as a *post-rejection* recovery. The effect on the execution trace: handoffs that previously failed with `AttestationExpired` at the peer now succeed because the agent refreshed its token against the peer's clock before crossing; handoffs that previously succeeded silently with expired tokens now fail closed at the agent's own pre-check, surfacing the skew as an operational metric rather than a trust leak. The cost is extra round-trips to the issuer when remaining lifetime is low — a latency tax paid at the boundary, not a correctness tax paid by the trust boundary. The invariant to monitor: `count(pre_crossing_reattest) / count(boundary_crossings)` should rise when federation clock offset grows; a flat ratio under growing skew indicates the guardrail is not keyed on verifier time and the false-acceptance path is open. ```python import time from dataclasses import dataclass class AttestationSkewError(RuntimeError): """Raised when a token's remaining lifetime is inside the skew uncertainty band.""" pass @dataclass class Attestation: subject: str issued_at: float expires_at: float def must_reattest_before_crossing( token: Attestation, issuer_now: float, max_skew: float, max_handoff_latency: float, ) -> bool: """ Decide whether an agent must re-attest before crossing a federation boundary. Returns True if re-attestation is required, False if the token is safe to cross. Raises AttestationSkewError if the token is already inside the unsafe band and the caller attempted to cross without re-attesting. """ if max_skew < 0 or max_handoff_latency < 0: raise AttestationSkewError( f"invalid skew/latency budget: skew={max_skew} latency={max_handoff_latency}" ) remaining = token.expires_at - issuer_now safe_margin = 2.0 * max_skew + max_handoff_latency unsafe_floor = max_skew + max_handoff_latency if remaining <= 0: # Already expired on the issuer's own clock: never cross. raise AttestationSkewError( f"token for {token.subject} already expired on issuer clock " f"(remaining={remaining:.3f}s)" ) if remaining <= unsafe_floor: # Inside the band where verifier clock offset can flip the decision. raise AttestationSkewError( f"token for {token.subject} inside skew band: " f"remaining={remaining:.3f}s <= skew+latency={unsafe_floor:.3f}s" ) if remaining <= safe_margin: # Valid but margin is inside 2x skew: re-attest against verifier clock. return True return False def cross_boundary( token: Attestation, issuer_now: float, max_skew: float, max_handoff_latency: float, reattest_fn, ) -> Attestation: """ Cross a federation boundary, re-attesting if the remaining lifetime is inside the skew uncertainty band. Returns the token to present to the peer. """ needs_reattest = must_reattest_before_crossing( token, issuer_now, max_skew, max_handoff_latency ) if needs_reattest: fresh = reattest_fn(token.subject) if fresh.expires_at <= issuer_now: raise AttestationSkewError( f"re-attestation returned immediately-expired token for {token.subject}" ) return fresh return token if __name__ == "__main__": tok = Attestation(subject="agent-A", issued_at=1000.0, expires_at=1600.0) # 50s remaining, skew=70s, latency=5s -> inside skew band -> raises. try: cross_boundary(tok, issuer_now=1550.0, max_skew=70.0, max_handoff_latency=5.0, reattest_fn=lambda s: Attestation(s, 1550.0, 2150.0)) except AttestationSkewError as e: print(f"blocked at boundary: {e}") ```