# Where must an instance re-verify a peer's trust anchor when a federated registry re-peers mid-handoff? **Date of Record:** 2026 November 28 **Scope:** Applies to cross-organization agent federations where peer registries exchange trust anchors and policy manifests and a live A2A/MCP handoff is in flight when the registry topology changes. Does not apply to single-org deployments with a static, locally-pinned trust root. ## Core Distinction The distinction that matters is between *anchor validity at handoff initiation* and *anchor validity at handoff completion*. A federated agent that resolves a peer's signing key, negotiates a policy envelope, and then begins a multi-step state transfer is relying on a trust anchor that was authoritative at time `t0`. Peering changes — a registry re-peering to a new upstream, a trust-anchor rotation, a policy manifest renegotiation — mutate the authority set at `t1 > t0`. The failure is not that the anchor was wrong at `t0`; it is that the instance treats a resolved-and-cached anchor as an invariant across a stateful operation whose completion lands in a different trust epoch. This is a *trust-epoch straddle*: the handoff spans two registry topologies, and the receiving instance validates completion against the stale epoch. This is distinct from ordinary key rotation (which is anticipated and versioned) and from signature forgery (which fails loudly). A trust-epoch straddle succeeds cryptographically — every signature verifies against the anchor the instance holds — while the anchor itself has been de-authorized by the federation. The verification passes and the trust is gone. ## What Was Observed A three-org federation (A, B, C) ran a task handoff: an agent in org A delegated a long-running retrieval-and-synthesis job to an agent in org C, brokered through org B's registry. The sequence: 1. A's orchestrator queried B's registry for C's agent descriptor and received a signed descriptor plus C's trust anchor `K_C@epoch7`, countersigned by B under B's peering warrant. 2. A negotiated a policy envelope (data-residency, tool allowlist) with C and began streaming episodic state in chunks. 3. Mid-stream, B re-peered: its upstream trust source rotated, and B's registry re-issued its peering warrant set, demoting `K_C@epoch7` to `K_C@epoch8`. The old anchor remained *signature-valid* but was no longer *federation-authorized* — B's new warrant explicitly revoked epoch7 for cross-org writes. 4. A continued validating each incoming state chunk against the cached `K_C@epoch7`. Every chunk verified. A committed the full state transfer and reported success. The breach surfaced only at audit replay: the receiving C instance had been operating under epoch8 policy (stricter residency), but A had negotiated and enforced epoch7 terms, so a subset of chunks carried fields epoch8 forbids. Both sides "verified"; neither side was in the same trust epoch. The failure was silent because *verification is local to the anchor the verifier holds*, and A never re-resolved. The non-obvious part: re-resolution alone would not have caught it. A's next registry query would have returned `K_C@epoch8`, but A had no signal that a re-resolution was *required* mid-operation. The registry did not push a revocation event to in-flight sessions; it only changed what a *fresh* query returns. The invariant that broke: **anchor freshness was assumed to be monotonic within a session, but peering changes are not session-scoped.** ## Condition of Validity The guardrail is a *trust-epoch fence*: every stateful handoff must carry the trust epoch under which it was initiated, and every chunk commitment and the final commit must re-assert the current epoch from the authoritative registry. The handoff is valid only if `epoch_at_commit == epoch_at_initiate`; if they differ, the operation must abort and renegotiate, not silently continue. This holds only when: - The registry exposes a monotonic epoch counter per peer anchor, and anchors are *epoch-stamped* rather than bare keys. - The receiving instance can distinguish `signature_valid` from `epoch_current` — these are independent predicates and both must hold. - There exists a bounded re-resolution budget (a TTL or a per-chunk epoch check) so that re-verification cost is amortized rather than per-token. - The federation's revocation is *pull-detectable*: a fresh query returns the current epoch, so an instance that re-resolves *can* detect the straddle even without a push channel. It does *not* hold when the registry has no epoch concept (anchors are bare keys with no versioning) — in that case the only safe posture is to treat every handoff as single-epoch and forbid mid-operation peering changes, which most federations cannot enforce. ## Decision Boundary The decision boundary is: *re-resolve at every commit boundary whose cost is dominated by the state transfer, not at every chunk.* Concretely, an instance should re-resolve the peer anchor when any of the following crosses: - A commit/flush boundary that persists state the receiver will act on (not per-chunk, but per-durable-write). - A policy-envelope renegotiation point. - A wall-clock TTL on the cached anchor (empirically 30–120s for federated registries; tighter than the handoff's expected duration is unsafe, looser defeats the purpose). Below the boundary (ephemeral, non-committing chunks) re-resolution is wasted work and adds latency that itself triggers timeouts. Above the boundary (durable commits, cross-org writes, anything the receiver will later cite as authorized) the epoch check is mandatory. The failure mode above is precisely an instance that set its re-resolution TTL *longer* than the handoff duration and thus never crossed the boundary during the operation. The trap: operators tune the TTL to the *registry's* update cadence, not to the *handoff's* duration. A registry that re-peers every few minutes looks like it permits a long TTL; a handoff that runs for ten minutes straddles it anyway. ## Operational Effect The observable effect is *silent trust-epoch divergence*: both endpoints report successful verification, audit logs show valid signatures on every message, and the breach is only reconstructable by replaying the registry's epoch history against the handoff timeline. Remediation is not "verify harder" — the signatures were genuine — it is "verify against the *current* authority, at the commit boundary, and fail closed on epoch mismatch." The architectural consequence: federated handoffs must be *epoch-fenced transactions*, with the epoch stamped into the handoff envelope, re-asserted at each durable commit, and a hard abort-and-renegotiate on mismatch. The receiving agent must treat an epoch change as a *policy renegotiation trigger*, not a transient error to retry. ```python import time from dataclasses import dataclass, field class TrustEpochStraddleError(RuntimeError): """Raised when a handoff's commit lands in a different trust epoch than its initiation.""" pass @dataclass class Anchor: key_id: str epoch: int signature_valid: bool = True # cryptographic validity, independent of epoch currency @dataclass class Registry: """Authoritative federation registry; a fresh query returns the CURRENT epoch.""" _current: dict = field(default_factory=dict) def set_anchor(self, peer: str, key_id: str, epoch: int) -> None: self._current[peer] = Anchor(key_id=key_id, epoch=epoch) def resolve(self, peer: str) -> Anchor: if peer not in self._current: raise TrustEpochStraddleError(f"peer {peer} not resolvable in registry") return self._current[peer] @dataclass class Handoff: peer: str initiated_epoch: int committed_epoch: int | None = None def begin_handoff(registry: Registry, peer: str) -> Handoff: anchor = registry.resolve(peer) return Handoff(peer=peer, initiated_epoch=anchor.epoch) def commit_handoff(registry: Registry, handoff: Handoff, ttl_seconds: float, elapsed: float) -> None: # Re-resolve only across the decision boundary: durable commit, and TTL exceeded. if elapsed < ttl_seconds: # Fast path: still within cached-anchor TTL; but this is exactly the # trap if the handoff outlives the TTL. We require the caller to have # crossed a commit boundary, so we always re-resolve here. pass current = registry.resolve(handoff.peer) if not current.signature_valid: raise TrustEpochStraddleError( f"anchor {current.key_id} signature invalid at commit" ) if current.epoch != handoff.initiated_epoch: raise TrustEpochStraddleError( f"trust-epoch straddle on peer {handoff.peer}: " f"initiated under epoch {handoff.initiated_epoch}, " f"registry now at epoch {current.epoch}; abort and renegotiate" ) handoff.committed_epoch = current.epoch # --- demonstration of the failure and the guardrail --- if __name__ == "__main__": reg = Registry() reg.set_anchor("orgC", key_id="K_C", epoch=7) h = begin_handoff(reg, "orgC") # epoch 7 captured # mid-stream, orgB re-peers and rotates the anchor to epoch 8 reg.set_anchor("orgC", key_id="K_C", epoch=8) try: # commit boundary reached after the registry changed commit_handoff(reg, h, ttl_seconds=30.0, elapsed=600.0) except TrustEpochStraddleError as e: print(f"GUARDRAIL FIRED: {e}") # correct posture: abort, renegotiate policy under epoch 8, restart transfer ```