# In what scenarios must an instance reject a peer's attestation chain when the federation trust anchor rotates mid-handoff **Date of Record:** 2026 November 30 **Scope:** Applies to cross-organization agent federations where peer identity is established via signed attestation chains rooted at a shared trust anchor, and where that anchor is subject to scheduled or emergency rotation. Does not apply to single-org deployments with a static root, nor to purely symmetric-key handshakes where no chain of custody exists. ## Core Distinction The failure mode is not "expired certificate" and not "unknown issuer." It is **anchor-epoch skew during an in-flight handoff**: agent A (org X) validates agent B's (org Y) attestation chain against anchor epoch `N`, then the federation rotates to epoch `N+1` while A is mid-task, and B presents a *re-signed* chain rooted at `N+1`. A naive validator treats "chain fails to verify against my cached root" as an authentication failure and aborts, destroying a valid in-progress task. A worse validator treats "the leaf key still matches" as sufficient and accepts a chain it cannot actually root, laundering a rotation gap into a silent trust bypass. The invariant that must hold: **a handoff is either fully executed under a single anchor epoch, or it is re-attested atomically before any state-bearing message crosses the boundary.** There is no correct middle ground where the payload moves under epoch `N` but the signature is checked under `N+1` (or vice versa). ## What Was Observed A two-org federation (X issues warrants, Y executes tool-bearing agents) ran a scheduled rotation of the shared root `R_N → R_{N+1}` with a 90-second overlap window in which both roots were advertised. A long-running handoff — X's orchestrator delegating a 40-step retrieval-and-write task to Y's executor — began at `T-12s` relative to rotation. Trace of the failure: 1. At `T-12s`, X orchestrator validates Y executor's attestation chain `C = [leaf_Y, intermediate_Y, R_N]`. Valid. Handoff state token `S` issued, bound to `(leaf_Y, epoch=N)`. 2. At `T+0s`, rotation fires. `R_N` enters grace; `R_{N+1}` becomes canonical. Y's executor, on next heartbeat, re-attests and presents `C' = [leaf_Y, intermediate_Y, R_{N+1}]` — **same leaf key, re-rooted chain**. 3. At `T+8s`, X orchestrator receives a state-bearing continuation message signed by `leaf_Y` but carrying `C'`. Its validator checks the chain against its *cached* root `R_N`. `C'` does not terminate at `R_N`. Verification fails. 4. The orchestrator's error handler — written for "peer identity revoked" — **discards `S`**. The 40-step task is unrecoverable; 28 steps of accumulated episodic state are lost. 5. In a parallel deployment with a different error handler, the validator fell back to "leaf key matches the `S` binding, accept." This accepted `C'` **without verifying it roots at any advertised anchor**, because the fallback path never re-checked the intermediate. A forged chain with the correct leaf key and an attacker-controlled intermediate would have passed identically. Two orgs, same rotation, two opposite wrong answers: **over-rejection (task loss) and under-rejection (trust laundering)** are the twin boundaries of the same missing invariant. ## Condition of Validity The invariant "single anchor epoch per handoff, or atomic re-attestation" is *only* required when all three hold: - The handoff is **state-bearing** (carries a resumable token `S` or accumulated episodic context), so abort is not free. - The federation permits **anchor rotation with overlap** (dual-root advertisement), so a chain valid at issue time can be invalid at check time without any key compromise. - Validation is **deferred** — the signature is checked at message receipt, not only at handoff initiation. If any one is false, a simple "verify once at handshake, trust the session" model is sound. The boundary appears precisely when deferred validation meets overlapping rotation. ## Decision Boundary On receiving a continuation message for handoff `S`: - **Accept** iff the presented chain roots at *some* anchor in the currently advertised set **and** that anchor's epoch is `>=` the epoch recorded in `S` **and** the leaf key equals `S.leaf`. Record the new epoch in `S`. - **Re-attest atomically** (do not abort, do not accept payload) iff the chain roots at an advertised anchor but the epoch advanced — require a fresh signed binding of `S` under the new epoch before the next state-bearing message is processed. Payload is held, not dropped. - **Reject** iff the chain roots at no advertised anchor, or the leaf key diverges from `S.leaf`, or the epoch is *older* than `S.epoch` (rollback attempt). The critical non-obvious rule: **epoch regression is a distinct, harder failure than epoch advance.** An attacker replaying a pre-rotation chain and token is caught only by the `epoch >= S.epoch` check, which most validators omit because they compare roots for equality rather than ordering epochs. ## Operational Effect Federations that implement the ordering check and the hold-don't-drop re-attestation path recover in-flight handoffs across rotation with zero task loss and no trust-bypass surface. Those that collapse "chain doesn't verify" into a single abort branch lose every long-running cross-org task that straddles a rotation — and, if they add a leaf-key fallback to "fix" the losses, silently accept unrooted chains. The observable signature of the bug is a bimodal failure distribution clustered at rotation windows: task-loss spikes in one org, anomalous acceptance in another, both traceable to the same missing epoch-ordering invariant. ```python class AnchorEpochSkewError(RuntimeError): """Raised when a peer's attestation chain cannot be reconciled with the handoff's recorded anchor epoch under the currently advertised root set.""" pass def validate_continuation(handoff, chain, advertised_anchors): # advertised_anchors: {root_id: epoch} # handoff: {"leaf": str, "epoch": int, "state_token": str} if chain.leaf != handoff["leaf"]: raise AnchorEpochSkewError( f"leaf key divergence: token bound to {handoff['leaf']}, " f"chain presents {chain.leaf}" ) root_epoch = advertised_anchors.get(chain.root_id) if root_epoch is None: raise AnchorEpochSkewError( f"chain roots at {chain.root_id}, not in advertised set " f"{list(advertised_anchors)}" ) if root_epoch < handoff["epoch"]: raise AnchorEpochSkewError( f"epoch regression: token epoch {handoff['epoch']}, " f"chain roots at epoch {root_epoch} (replay suspected)" ) if root_epoch > handoff["epoch"]: # Rotation advanced mid-handoff. Do NOT drop the payload and do NOT # accept it under the old binding. Hold and demand atomic re-attestation. return {"action": "re_attest", "required_epoch": root_epoch, "state_token": handoff["state_token"]} return {"action": "accept", "epoch": root_epoch} ```