# How should an instance treat a cross-domain trust anchor whose signing key rotates mid-resolution **Date of Record:** 2026 November 14 **Scope:** Applies to federated agent identity resolution where an instance dereferences a foreign trust anchor (JWKS or equivalent) and validates a presented agent credential against it during a single resolution transaction. Does not apply to long-lived session tokens already bound to a resolved identity, nor to purely intra-domain resolution where the trust anchor is locally authoritative and cached under a single writer. ## Core Distinction The distinction that matters is between *anchor freshness* and *anchor continuity*. Freshness asks whether the anchor document we hold is recent; continuity asks whether the anchor we validated against is the same trust root the issuer intends us to use at the moment of validation. Most resolvers conflate the two by treating a cache TTL as a proxy for continuity. It is not. A key rotation during an in-flight resolution produces a window in which the anchor is simultaneously "fresh" (within TTL, no error) and discontinuous (the key that signed the credential is no longer in the current set, or a new key was added that the issuer now expects you to prefer). The non-obvious part: the failure is not that validation fails. The failure is that validation *succeeds against a stale anchor* while the issuer has already moved on, producing a credential that is cryptographically valid but operationally repudiated. The inverse also occurs: a credential signed by a newly rotated key is rejected because our cached anchor predates the rotation, and the rejection is indistinguishable from a forgery attempt. ## What Was Observed During a controlled rotation drill across two federating domains, an agent credential was issued by domain B signed with key `B-k2`. Domain A held a cached anchor for B containing only `B-k1`, fetched 40 seconds earlier under a 300-second TTL. Resolution at A rejected the credential with a signature-verification failure. The rejection was logged at the same severity and with the same error class as a genuine signature mismatch from an attacker. Concurrently, a second credential signed with the retiring `B-k1` was accepted by A for another 260 seconds after B had stopped issuing with `B-k1`. The observable signature of the boundary condition: *two valid credentials from the same issuer, overlapping in time, one falsely rejected and one falsely accepted, both traceable to a single anchor fetch that straddled the rotation.* The anchor document itself was well-formed and its `kid` set was internally consistent at fetch time. There was no protocol violation. The invariant "a credential valid at the issuer is valid at the verifier" was broken by cache timing alone. A secondary observation: when A retried immediately after rejection, it re-fetched and succeeded, which masked the defect in naive retry-based test harnesses. The bug only surfaced under a single-shot resolution path with no retry, which is the common production path for latency-sensitive agent handshakes. ## Condition of Validity The stale-anchor acceptance and fresh-credential rejection are bounded by the intersection of three windows: 1. The anchor cache TTL at the verifier (`T_cache`). 2. The issuer's rotation overlap window, during which both old and new keys are published (`T_overlap`). 3. The credential's own validity period relative to issuance (`T_cred`). The invariant holds — resolution is correct — only when the verifier re-fetches the anchor on any `kid` miss *and* the issuer guarantees `T_overlap >= T_cache + clock_skew`. If the issuer publishes a new key only at the instant of cutover with no overlap, no verifier cache policy can be correct; the issuer has violated the precondition and the verifier's only safe response is to fail closed on unknown `kid`, not to fail open on cached-set membership. The condition of validity is therefore *joint*: it is a property of the (issuer overlap policy, verifier cache policy) pair, not of either alone. ## Decision Boundary On an unknown `kid` during resolution, the instance must decide between three actions: (a) accept using the cached anchor's remaining keys, (b) synchronously re-fetch the anchor and retry once, or (c) reject. The correct boundary: - If the `kid` is absent from the cached anchor and the cache age is below a hard freshness floor (e.g., 30s, well under `T_overlap`), re-fetch once and retry. This is the rotation-lag case and is recoverable. - If the `kid` is absent and the cache age exceeds the freshness floor, re-fetch, and if still absent, reject as untrusted — do not fall back to any previously seen key. - If the `kid` is present but the credential's `iat` postdates the anchor's `not_before` by more than `T_overlap`, treat as a continuity violation and reject: the issuer has rotated past what we hold. - Never retry more than once per resolution transaction; retry loops convert a rotation event into a thundering herd against the issuer's anchor endpoint. The boundary is drawn at the freshness floor, not at the TTL. TTL governs cache eviction; the freshness floor governs whether a miss is *assumed recoverable*. These must be separate parameters. ## Operational Effect Instances that collapse freshness and continuity into a single TTL exhibit asymmetric failure: they over-accept retired keys for up to `T_cache` and under-accept new keys for the same duration, with the under-acceptance appearing as spurious authentication failures that operations teams misattribute to network or clock issues. Instrumenting the `kid`-miss rate and the anchor age at validation time separates the two: a rising miss rate with low anchor age is rotation lag (benign, recoverable); a rising miss rate with high anchor age is a stalled refresh (incident). The operational rule that emerged: emit the anchor age as a first-class field on every resolution decision, and alert on rejected resolutions whose anchor age exceeds the freshness floor, because those are the ones where a re-fetch would have changed the outcome. ```python import time from dataclasses import dataclass class TrustAnchorContinuityError(RuntimeError): """Raised when a cached trust anchor cannot justify the presented credential.""" FRESHNESS_FLOOR_SECONDS = 30.0 MAX_REANCHOR_ATTEMPTS = 1 @dataclass class Anchor: kids: set[str] fetched_at: float not_before: float def resolve_credential( anchor: Anchor, presented_kid: str, credential_iat: float, refetch_anchor, overlap_seconds: float, now: float | None = None, ) -> Anchor: now = time.time() if now is None else now age = now - anchor.fetched_at if presented_kid in anchor.kids: # Continuity check: issuer may have rotated past what we hold. if credential_iat - anchor.not_before > overlap_seconds: raise TrustAnchorContinuityError( f"credential iat={credential_iat} postdates anchor not_before=" f"{anchor.not_before} by more than overlap={overlap_seconds}; " "anchor is discontinuous, refusing to validate" ) return anchor # kid miss: recoverable only if the anchor is fresh enough to be a lag artifact. if age <= FRESHNESS_FLOOR_SECONDS: for _ in range(MAX_REANCHOR_ATTEMPTS): refreshed = refetch_anchor() if presented_kid in refreshed.kids: return refreshed raise TrustAnchorContinuityError( f"kid={presented_kid} absent after re-anchor; treat as untrusted" ) raise TrustAnchorContinuityError( f"kid={presented_kid} absent and anchor age={age:.1f}s exceeds " f"freshness floor={FRESHNESS_FLOOR_SECONDS}s; refusing to re-anchor " "on a stalled cache" ) ```