# What happens when an instance trusts a federation anchor that outlives the key material it was minted from **Date of Record:** 2026 November 20 **Scope:** Applies to cross-organization agent federation where an agent instance validates a peer's identity attestation chain against a cached trust anchor (root CA, DID document, or JWKS set) fetched from a foreign control plane. Does not apply to single-tenant deployments where the anchor and the leaf attestation share one revocation authority and one refresh cycle. ## Core Distinction There are two things a federated agent calls "trust": the *anchor* (the cryptographic root it will accept signatures from) and the *attestation chain* (the leaf credential a peer presents, signed transitively up to that anchor). The failure mode here is not a bad signature and not a missing chain. It is a **temporal mismatch between the anchor's validity window and the leaf's issuance epoch**. An instance that cached an anchor at time T0 will happily validate a leaf issued at T1 that was signed by a key the foreign org rotated out at T0+ε — because the chain verifies arithmetically against the *old* anchor while the peer's control plane believes the old anchor is dead. The verifier is not wrong about the math. It is wrong about *which world it is in*. This is distinct from ordinary revocation staleness because the verifier never sees a revocation event. The foreign org rotated cleanly, published a new anchor, and retired the old key. The verifier's cache simply never learned the boundary moved. The result is a **split-brain trust horizon**: two federated instances holding different anchors, each internally consistent, each accepting a disjoint set of peers. ## What Was Observed A two-org federation, `alpha` (caller) and `beta` (callee). Beta publishes a JWKS at a well-known endpoint and rotates its signing key every 24h, publishing the new key 1h before activation and retiring the old key 1h after deactivation, with a 2h overlap. Alpha's agent caches the JWKS with a 6h TTL and — critically — **validates leaf tokens against the cached set without re-checking whether the leaf's `iss`/`kid` pair is within the cached set's published epoch**. Trace of the failure: 1. `t=0` Alpha fetches beta's JWKS, containing key `K1` (active) and `K0` (retiring). Caches it with TTL 6h. 2. `t=3h` Beta rotates: `K1` retires, `K2` activates. Beta's live JWKS now has `K2` + `K1` (overlap). Alpha's cache still has `K1` + `K0`. 3. `t=3.5h` A beta instance presents a leaf signed by `K2`. Alpha's cache has no `K2`, so verification fails. Alpha's agent runtime, configured with `on_unknown_kid: retry_with_refresh`, refetches, gets `K2`+`K1`, succeeds. **Cache now refreshed to live state.** 4. `t=9h` Alpha's refreshed cache expires (TTL from `t=3.5h`). Alpha refetches: `K3`+`K2`. Fine. 5. **The divergence:** at `t=3.5h` a *second* alpha instance (`alpha-2`) had no traffic and never triggered the `on_unknown_kid` refresh. Its cache still holds `K1`+`K0` at `t=5h`, when a beta peer presents a leaf signed by `K1` that beta minted at `t=2h` (before rotation) with a 4h lifetime. `alpha-2` validates it: `K1` is in cache, signature checks, `exp` is in the future. **Accepted.** But `K1` was retired at `t=4h`; beta's control plane considers any `K1`-signed leaf with `iat > t=3h` suspect and any `K1`-signed leaf at all post-`t=4h` as belonging to a compromised-epoch window. `alpha-2` accepted a token beta would no longer vouch for. The two alpha instances now disagree about whether the same peer is trustworthy at the same wall-clock instant. Neither logged an error. Both are "correct" against their local anchor. ## Condition of Validity The invariant that must hold for federated trust to be sound: > A verifier may accept a leaf attestation signed by key `K` only if the verifier's anchor set contains `K` **and** the verifier's anchor set's fetch timestamp `t_f` satisfies `t_f ≤ K.not_after` **and** the leaf's `iat` satisfies `K.not_before ≤ leaf.iat ≤ K.not_after`. The middle clause is the one everyone drops. A cached anchor is not a timeless statement that "K is a valid signer." It is a *snapshot* asserting "K was a valid signer as of `t_f`." If the leaf's `iat` is later than the anchor's `t_f`, the verifier is asserting something about a key's validity *after the last moment it had evidence for*. That is the boundary. The anchor must carry its own `fetched_at`, and the leaf's `iat` must be bounded by it — not merely by the leaf's `exp`. Equivalently: **anchor freshness bounds leaf issuance, not just leaf expiry.** A leaf that outlives the verifier's knowledge of the signer's epoch is unverifiable regardless of its `exp`. ## Decision Boundary The guardrail is a **monotonic anchor epoch** with an explicit rejection path, not a longer TTL and not a retry-on-unknown-kid heuristic. Retry-on-unknown-kid only fires when the *kid is absent*; it does not fire when the kid is *present but stale*, which is precisely the dangerous case. The correct boundary is: - Every anchor snapshot carries `fetched_at` and a `max_leaf_iat = fetched_at + skew_tolerance`. - On leaf validation, reject if `leaf.iat > anchor.max_leaf_iat` — even if the signature verifies and `exp` is future. This forces a refresh at the *issuance* boundary rather than the *expiry* boundary. - The refresh must be *synchronous* for the rejecting request; if refresh fails, the request fails closed. A verifier that refreshes lazily and proceeds on the stale anchor has re-opened the hole. - Cross-instance: the anchor epoch must be shared or at least comparable across instances in the same org, otherwise `alpha-1` and `alpha-2` can still diverge. The cheap version is a control-plane-published `anchor_epoch` integer that instances gossip; the expensive version is a short-lived signed anchor with a hard `not_after` that the foreign org controls. The decision boundary, stated as a rule an agent can execute: **if you cannot prove the signer was valid at the moment the leaf was issued, you have not verified the leaf — you have verified that some key, somewhere, once signed something.** Fail closed. ## Operational Effect Without the `iat`-bounded anchor check, an instance silently accepts post-rotation leaves signed by retired keys for up to one full cache TTL after the foreign org has disowned them. The blast radius is bounded by TTL × rotation cadence, but the *observability* is zero: no error, no log, no metric. The failure only surfaces when a retired key is actually compromised and a forged leaf is presented — at which point the accepting instance has no way to distinguish the forgery from the legitimate-but-stale traffic it has been accepting for hours. The federation appears healthy right up until it is exploited. With the guardrail, the failure converts from silent acceptance to a loud, attributable rejection at the issuance boundary, and the refresh path is exercised on the *safe* side of rotation rather than the unsafe side. The cost is one extra synchronous fetch per rotation epoch per active peer — negligible against the cost of a silent trust-horizon split. The invariant to carry forward: **anchor freshness is a lower bound on what you can verify, and it must be enforced against leaf issuance time, not leaf expiry time.** Any verifier that checks `exp` but not `iat ≤ anchor.fetched_at + skew` is running a trust anchor that has outlived the evidence it encodes. ```python import time from dataclasses import dataclass, field from typing import Dict class StaleAnchorEpoch(RuntimeError): """Raised when a leaf was issued after the verifier's anchor snapshot was taken.""" pass class AnchorRefreshFailed(RuntimeError): """Raised when a synchronous anchor refresh cannot restore a usable epoch.""" pass @dataclass class AnchorSnapshot: keys: Dict[str, dict] # kid -> key material fetched_at: float # unix seconds; the moment of last evidence skew_tolerance: float = 60.0 # clock skew allowance def max_leaf_iat(self) -> float: return self.fetched_at + self.skew_tolerance @dataclass class LeafAttestation: kid: str iat: float # issued-at, unix seconds exp: float signature_ok: bool @dataclass class FederatedVerifier: anchor: AnchorSnapshot refresh_fn: object # callable() -> AnchorSnapshot _refresh_in_flight: bool = field(default=False, init=False) def _refresh(self) -> None: if self._refresh_in_flight: raise AnchorRefreshFailed("concurrent refresh already in flight; refusing to proceed on stale anchor") self._refresh_in_flight = True try: self.anchor = self.refresh_fn() finally: self._refresh_in_flight = False def verify(self, leaf: LeafAttestation, now: float) -> None: if not leaf.signature_ok: raise StaleAnchorEpoch(f"signature invalid for kid={leaf.kid}") if leaf.exp <= now: raise StaleAnchorEpoch(f"leaf expired: exp={leaf.exp} now={now}") if leaf.kid not in self.anchor.keys: # unknown kid: safe-ish to retry, but still must re-check iat after refresh self._refresh() if leaf.kid not in self.anchor.keys: raise StaleAnchorEpoch(f"kid={leaf.kid} absent after refresh") # THE BOUNDARY: issuance must be bounded by anchor evidence, not just expiry. if leaf.iat > self.anchor.max_leaf_iat(): self._refresh() if leaf.iat > self.anchor.max_leaf_iat(): raise StaleAnchorEpoch( f"leaf iat={leaf.iat} exceeds anchor evidence horizon " f"{self.anchor.max_leaf_iat()} (fetched_at={self.anchor.fetched_at}); " f"refusing to vouch for signer epoch we never observed" ) ```