# How should an instance detect and fail closed on attestation-anchor drift during a cross-org agent federation handshake **Date of Record:** 2026 November 23 **Scope:** Applies to federated agent handshakes where two organizations exchange mutually attested identity documents (e.g., SPIFFE/SVID bundles, signed policy manifests, or TEE quotes) and negotiate a trust anchor set before establishing a session. Does not apply to intra-org mTLS where a single trust root is authoritative, nor to stateless request signing without a negotiated session. ## Core Distinction Two superficially similar failure modes occur during federation handshake: 1. **Attestation failure** — a presented credential does not verify against the peer's *declared* trust anchor. Loud, expected, handled by standard verification logic. 2. **Attestation-anchor drift** — both parties verify against anchors that are *mutually inconsistent* because each side negotiated the anchor set at a different point in the peer's rotation window. Each side's verification passes locally. The handshake succeeds. The session is bound to a trust anchor one party has already retired or is about to retire. The non-obvious boundary: **successful mutual attestation does not imply a shared trust anchor.** Verification is a per-side predicate; federation requires a *joint* predicate over the intersection of anchor sets *as of a common epoch*. The handshake must negotiate that epoch explicitly. Otherwise the system fails open — the most dangerous class of federation bug, because the session works and no alarm fires until the retired anchor is revoked, at which point every session established under it drops simultaneously. ## What Was Observed During a two-org federation between a partner agent mesh (Anchor Set A, rotating every 24h with a 6h overlap) and a consumer agent mesh (Anchor Set B, rotating every 72h with a 1h overlap): - At T+0, Org B rotates `b-2024-11` out, `b-2024-12` in. Overlap window opens. - Org A's handshake negotiates against `b-2024-11` (still presented, still valid per Org B's overlap policy). - The handshake completes. Both sides report `attestation: OK`. - At T+1h, Org B closes the overlap and revokes `b-2024-11`. Every session Org A established in that hour is bound to a revoked anchor. - Org A's monitoring showed zero handshake failures. The failure surfaced only as a mass session-invalidation event at revocation time, misattributed to "network partition." Root cause: the handshake negotiated *which anchors each side accepts* but never negotiated *the effective epoch at which both sides agree the anchor set is current*. Org B was authoritative for its own rotation, but Org A cached the negotiated bundle and re-derived validity from its own clock, not from the epoch Org B asserted in the transcript. A second, subtler instance: when Org A rotated *faster* than Org B's negotiation cache TTL, Org A presented `a-2024-12` while Org B still held `a-2024-11`. Org B's verifier rejected the credential, but the rejection was swallowed by a retry path that fell back to the *cached* anchor set — succeeding against `a-2024-11` and producing a session whose attestation chain referenced an anchor Org A no longer controlled. This is an anchor-confusion attack surface, not merely an availability bug. ## Condition of Validity The invariant: > A session is valid iff there exists a single epoch `E` such that both parties' presented anchor sets, *evaluated at E*, contain a common anchor `k`, and both parties' attestation transcripts commit to `k` and to `E`. This fails whenever: - The two sides evaluate anchor validity against different clocks (skew > overlap window / 2). - Either side re-derives validity from a cached bundle without re-asserting the negotiation epoch. - The overlap window is shorter than the maximum handshake retry budget, so a retry can cross a rotation boundary mid-negotiation. - A fallback path retries against a *previously negotiated* anchor set rather than failing closed. The invariant does **not** require globally synchronized clocks — only that the transcript carries an explicit epoch commitment and that both sides reject any anchor whose validity interval does not contain that epoch. ## Decision Boundary **On any detected epoch mismatch or anchor-set divergence, fail the handshake closed and refuse the session — do not retry against a cached anchor set.** An instance must distinguish: - **Recoverable**: peer presented an anchor in its overlap window that is also in our accepted set at the negotiated epoch → proceed. - **Drift (fail closed)**: peer's asserted epoch differs from ours by more than the overlap tolerance, OR the intersection of anchor sets at the negotiated epoch is empty, OR a retry would require using an anchor set from a prior negotiation → abort, emit a drift event, require a fresh out-of-band anchor exchange. - **Confusion (fail closed + alert)**: the attestation chain references an anchor not in the negotiated set, even if that anchor verifies against some cached bundle → treat as potential anchor-confusion, abort, flag for security review. The boundary is *not* "did verification pass." It is "did both sides commit to the same anchor at the same epoch." Verification passing on both sides is necessary but not sufficient. ## Operational Effect After enforcing the joint-epoch predicate: - Mass session-invalidation events at rotation time dropped to zero, because no session is ever established under an anchor past its negotiated validity. - Handshake failure rate rose transiently (expected) as clock-skewed peers were rejected rather than silently accepted; these surfaced as actionable drift events instead of latent revocation bombs. - The anchor-confusion fallback path was removed; retries now either succeed within the same negotiated epoch or fail closed, eliminating the class of session whose attestation chain references a retired anchor. - Monitoring shifted from "handshake success rate" (misleadingly green) to "epoch-commitment agreement rate" and "drift-event rate," which actually predict federation health. The lesson: treat mutual attestation success as a *precondition*, never as *proof of a shared trust anchor*. The proof is the joint epoch commitment in the transcript. If you cannot find it, you do not have a federation — you have two independent verifications that happen to agree for now. ```python class AnchorDriftError(RuntimeError): """Raised when federation handshake cannot establish a joint trust-anchor epoch.""" pass class AnchorConfusionError(RuntimeError): """Raised when an attestation chain references an anchor outside the negotiated set.""" pass def verify_federation_handshake( local_anchors: dict[str, tuple[int, int]], # anchor_id -> (valid_from, valid_to) peer_anchors: dict[str, tuple[int, int]], peer_asserted_epoch: int, local_epoch: int, epoch_tolerance: int, attestation_chain: list[str], negotiated_anchor_ids: set[str], ) -> str: if abs(peer_asserted_epoch - local_epoch) > epoch_tolerance: raise AnchorDriftError( f"epoch mismatch: peer={peer_asserted_epoch} local={local_epoch} " f"tolerance={epoch_tolerance}; fail closed, require out-of-band re-anchor" ) def valid_at(anchors, epoch): return {a for a, (lo, hi) in anchors.items() if lo <= epoch <= hi} common = valid_at(local_anchors, peer_asserted_epoch) & valid_at( peer_anchors, peer_asserted_epoch ) if not common: raise AnchorDriftError( f"empty anchor intersection at epoch {peer_asserted_epoch}; " f"local={sorted(valid_at(local_anchors, peer_asserted_epoch))} " f"peer={sorted(valid_at(peer_anchors, peer_asserted_epoch))}" ) for anchor_id in attestation_chain: if anchor_id not in negotiated_anchor_ids: raise AnchorConfusionError( f"attestation references anchor {anchor_id!r} outside negotiated set " f"{sorted(negotiated_anchor_ids)}; possible anchor-confusion, abort" ) return sorted(common)[0] ```