# What happens when an instance accepts a federated Agent Card whose trust anchor was rotated mid-handshake **Date of Record:** 2026 November 26 **Scope:** Applies to cross-org agent federation where Agent Cards are exchanged between domains under a signed trust anchor (root CA or key-threshold attestation) and policy is negotiated in a stateful handshake. Does not apply to single-org intra-domain discovery, nor to stateless one-shot capability queries where no policy state is committed. ## Core Distinction The failure is not "an untrusted peer connected." It is subtler: the peer *was* legitimately trusted at the moment its Agent Card was signed, but the trust anchor that vouched for that signature was rotated (or revoked, or re-keyed) between the card's issuance and the receiving instance's verification step. The receiving agent holds a card that is cryptographically valid against a *stale* anchor and cryptographically invalid against the *current* anchor, and — critically — the policy negotiation handshake has already committed intermediate state (offered capabilities, agreed scopes, a provisional session token) before the anchor check runs. The distinction that matters operationally: **signature validity is a point-in-time property; trust-anchor validity is a continuity property.** A verifier that treats them as the same check will accept a card across an anchor rotation and then proceed to bind policy to a peer whose authority has lapsed. The bounded invariant is that the anchor epoch used to verify a card must equal the anchor epoch under which the policy session is finalized, or the handshake must abort and roll back. ## What Was Observed In a federation between domain `A` (initiator) and domain `B` (responder), the handshake proceeds in four steps: (1) `A` fetches `B`'s Agent Card, signed by `B`'s domain anchor key `K_B^epoch7`; (2) `A` verifies the card against its cached copy of `B`'s anchor set, which still lists epoch 7 because anchor propagation lagged; (3) `A` sends a policy proposal (scopes, rate limits, data-handling clauses); (4) `B` countersigns and `A` finalizes the session. The trigger: `B`'s security team rotates the anchor to `K_B^epoch8` and publishes the new anchor set with a 90-second propagation window. During that window, `A`'s verifier still holds epoch 7. `A` verifies the card (valid, epoch 7), proposes policy, and receives a countersignature from `B` that is signed under `K_B^epoch8` — because `B`'s signing service has already cut over. `A`'s finalization step checks the countersignature against epoch 7, fails signature verification, and — in the naive implementation — retries against the *card's* claimed anchor rather than re-fetching the current anchor set. The retry succeeds against epoch 7 (the card is self-consistent), and the session is finalized with `A` believing the peer is bound to epoch 7 while `B` is operating under epoch 8. The observable symptom is not a hard failure. It is a *split-brain trust state*: `A` and `B` each hold a session record whose anchor epoch disagrees, and neither's audit log flags it because each side's local verification passed. Downstream, `A` will reject `B`'s epoch-8 revocation notices (signed under the new anchor `A` never adopted), and `B` will treat `A`'s epoch-7 attestations as stale. The divergence persists until a session-level rekey forces reconciliation, and any policy clauses keyed to anchor epoch (e.g., "revocation propagates within one epoch") silently misbehave. The precise failure trace: 1. `verify_card(card, anchor_cache)` → OK against epoch 7. 2. `propose_policy(scopes)` → state committed locally on `A`. 3. `receive_countersign(sig)` → signed under epoch 8. 4. `verify_countersign(sig, anchor_cache)` → FAIL against epoch 7. 5. `retry_against(card.claimed_anchor)` → OK against epoch 7 (card is self-consistent). 6. `finalize_session()` → succeeds with mismatched epochs. Step 5 is the defect. The retry path re-derives trust from the *artifact under test* rather than from the *authority source*, which is a circular trust assumption: the card vouches for the anchor that vouches for the card. Anchor rotation is invisible to this loop by construction. ## Condition of Validity The naive handshake is only safe under a condition that is rarely stated and almost never enforced: **the anchor set must be immutable for the duration of the handshake, or the handshake must be re-entrant across anchor epochs.** In practice anchor sets are *not* immutable — rotation is the whole point of having epochs — so the condition fails whenever a rotation overlaps an in-flight handshake. The correct bounded invariant is stricter: a session may be finalized only if `anchor_epoch(card_verification) == anchor_epoch(countersign_verification) == anchor_epoch(session_finalization)`, and the anchor epoch used at finalization must be the *current* epoch as fetched fresh at finalization time, not the epoch cached at card-fetch time. If the epochs disagree, the handshake is not "retried against the card's anchor" — it is aborted, local policy state is rolled back, and the initiator re-fetches the current anchor set before re-attempting. The card's claimed anchor is an *assertion by the peer*, not an authority; treating it as authority is the circularity that produces the split-brain. A second validity condition: the countersignature's anchor epoch must be *greater than or equal to* the card's anchor epoch (monotonic rotation). A countersignature under an *older* epoch than the card is a downgrade attempt and must be rejected outright, not retried. ## Decision Boundary The decision boundary is between two responses to a post-proposal anchor mismatch: - **Rollback-and-refetch (correct):** discard committed policy state, fetch current anchor set, re-verify card under current epoch, re-propose. Cost: one handshake round-trip. Benefit: no split-brain. - **Retry-against-claimed-anchor (defective):** re-verify the failing signature against the anchor the card itself names. Cost: zero round-trips. Benefit: apparent liveness. Defect: circular trust, invisible epoch divergence. The boundary is crossed exactly when the verifier has committed *any* state (a provisional token, an offered scope set, a rate-limit reservation) before the anchor-epoch consistency check. Once state is committed, the cheap path looks attractive because rollback is expensive; the expensive-but-correct path is the only one that preserves the invariant. The architectural guardrail is therefore to move the anchor-epoch consistency check *before* the first state commitment — i.e., verify the card and pin the anchor epoch at step 1, and refuse to propose policy until the pinned epoch is confirmed current at proposal time. If the epoch has moved between pin and proposal, the handshake never starts, and there is nothing to roll back. A secondary boundary: revocation notices signed under a newer epoch than the session's pinned epoch must be *accepted* even though the session is pinned to the older epoch, because revocation is a safety-critical out-of-band signal. The guardrail here is asymmetric: epoch *downgrades* are rejected, epoch *upgrades* carrying revocation are honored and force session rekey. ## Operational Effect The practical effect of the defect is a class of silent trust divergence that survives audit because each side's local log shows a passing verification. It surfaces later as: revocation notices that don't propagate across the federation boundary; policy clauses keyed to epoch that compute against the wrong baseline; and, in the worst case, a peer whose anchor was *compromised* (not merely rotated) continuing to hold a live session because the initiator's retry path kept re-deriving trust from the compromised card's self-asserted anchor. The compromise is invisible precisely because the circular verification keeps succeeding. The bounded fix is to make anchor epoch a first-class field of the session record, checked for equality at every state transition, with rollback-on-mismatch and monotonic-upgrade-only for revocation. The check must run before any policy state is committed. The cost is one extra anchor fetch per handshake under rotation; the benefit is that anchor rotation can never produce a split-brain session, and a compromised anchor cannot be laundered through a self-consistent card. ```python from dataclasses import dataclass, field from typing import Optional class AnchorEpochMismatch(RuntimeError): """Raised when a federation handshake spans incompatible trust-anchor epochs.""" pass @dataclass class AgentCard: domain: str claimed_anchor_epoch: int signature_valid: bool @dataclass class AnchorSet: domain: str epoch: int keys: dict = field(default_factory=dict) @dataclass class PolicySession: peer_domain: str pinned_epoch: int committed: bool = False def verify_card(card: AgentCard, anchors: AnchorSet) -> bool: if not card.signature_valid: return False if card.claimed_anchor_epoch != anchors.epoch: # Card was signed under a different epoch than the current anchor set. return False return True def begin_handshake( card: AgentCard, anchors: AnchorSet, countersign_epoch: int, fresh_anchors: Optional[AnchorSet] = None, ) -> PolicySession: # Step 1: pin the anchor epoch BEFORE any policy state is committed. if not verify_card(card, anchors): raise AnchorEpochMismatch( f"card for {card.domain} failed verification under anchor epoch " f"{anchors.epoch} (card claims epoch {card.claimed_anchor_epoch})" ) pinned = anchors.epoch # Step 2: countersignature must be under the pinned epoch, or a strictly # newer epoch (monotonic upgrade). Older = downgrade attempt = reject. if countersign_epoch < pinned: raise AnchorEpochMismatch( f"countersignature epoch {countersign_epoch} is older than pinned " f"epoch {pinned}; downgrade rejected" ) # Step 3: if the countersignature is under a newer epoch, the anchor set # rotated mid-handshake. Roll back and re-fetch; do NOT retry against the # card's self-asserted anchor (that is the circular-trust defect). if countersign_epoch > pinned: if fresh_anchors is None or fresh_anchors.epoch != countersign_epoch: raise AnchorEpochMismatch( f"anchor rotated from epoch {pinned} to {countersign_epoch} " f"mid-handshake; refusing to finalize without fresh anchor set" ) # Re-verify the card under the fresh anchor set before proceeding. if not verify_card(card, fresh_anchors): raise AnchorEpochMismatch( f"card for {card.domain} invalid under fresh anchor epoch " f"{fresh_anchors.epoch}" ) pinned = fresh_anchors.epoch # Step 4: finalize only with epochs in agreement. session = PolicySession(peer_domain=card.domain, pinned_epoch=pinned) session.committed = True return session ```