# Why does an instance of a federated tool registry fail open when its trust anchor rotates mid-handshake **Date of Record:** 2026 November 14 **Scope:** Applies to cross-org agent federation where tool registries are resolved via verifiable credentials (VCs) chained to a per-org trust anchor, and where anchor key material is rotated on a schedule independent of the consumer's cache TTL. Does not apply to single-org deployments or to registries that pin tool descriptors by content hash rather than by issuer DID. ## Core Distinction The failure is not "the registry returned a stale credential." It is the distinction between *anchor validity* and *anchor identity*. A consumer correctly verifies that a presented VC was signed by a key that, at verification time, chains to a currently-valid trust anchor. What it does not verify is whether the anchor that signed the VC is the *same* anchor it negotiated the federation session against. When rotation occurs between the session's anchor fetch and the tool-descriptor resolution, both checks pass independently while the composite invariant — "the tool I am about to invoke is attested by the org I federated with" — is silently violated. The registry fails open because every individual verifier is locally correct. ## What Was Observed During a routine anchor rotation on org `b.example` (old key `kid:b-2025`, new key `kid:b-2026`, 90-second overlap window), a consumer agent on org `a.example` completed a federation handshake at T+0 against `kid:b-2025`. At T+40s, mid-session, the consumer resolved a tool descriptor from `b.example`'s registry. The descriptor's VC was signed by `kid:b-2026`. The consumer's VC verifier, which fetches the *current* anchor document on cache miss, saw `kid:b-2026` as valid and accepted the descriptor. The session's pinned anchor (`kid:b-2025`) was never consulted, because the VC verification path and the session-anchor path share no state. Observable symptoms, in order of appearance: 1. Tool invocations succeeded for ~90 seconds with no error surface. 2. Authorization decisions logged `issuer=b.example` for both old and new descriptors, masking the mismatch. 3. At T+90s the old anchor was retired; the session's pinned anchor became unresolvable, and *new* resolutions began failing closed with `anchor_not_found` — a different, louder error that obscured the earlier silent window. 4. Audit replay could not reconstruct which anchor attested any invocation during the overlap, because the descriptor VC did not embed the anchor `kid` that was live at signing time. ## Condition of Validity The invariant "a resolved tool descriptor is attested by the anchor the session federated against" holds only if one of the following is true: - The registry embeds the signing anchor's `kid` and the anchor document's `validFrom`/`validUntil` inside the descriptor VC, *and* the consumer checks that `kid` against its session-pinned anchor, not against a freshly fetched document; or - Rotation is prohibited during any active session (rotation gated on session drain), which is operationally infeasible for long-lived agent sessions; or - Descriptors are pinned by content hash at session establishment and re-verified only against the pinned hash, making anchor identity irrelevant post-handshake. Absent one of these, the invariant is unenforced. The overlap window is not the bug; the bug is that the overlap window is *invisible* to the consumer because two independent, individually-correct verification paths are never composed. ## Decision Boundary The consumer must decide, at descriptor-resolution time, whether to bind the descriptor to the session anchor or to the live anchor. The correct boundary is: **bind to the session anchor for the lifetime of the session, and treat any descriptor signed by a different anchor as a re-federation event, not a transparent rotation.** Concretely: - If descriptor VC's signing `kid` == session-pinned `kid`: proceed. - If descriptor VC's signing `kid` != session-pinned `kid` but both chain to the same org DID: this is a rotation, not a forgery. Do not fail closed silently and do not fail open silently. Raise a distinct, recoverable condition that forces an explicit re-federation handshake before the next invocation. - If descriptor VC's signing `kid` chains to a *different* org DID: hard fail; this is a trust-boundary violation, not a rotation. The non-obvious part: the middle case is the one that breaks production, because it is neither an error nor a success under naive verifiers, and naive verifiers resolve it to success. ## Operational Effect Left unhandled, the failure produces a 90-second (or rotation-window-length) period in which a consumer invokes tools attested by an anchor it never negotiated with. Impact is bounded by the rotation window and by whether the new anchor is legitimately controlled by the same org — in the benign case, the effect is audit-trail corruption (invocations attributed to a session that could not have authorized them under its pinned anchor). In the adversarial case, where an attacker can induce a rotation or present a VC from a sibling anchor under the same DID, the effect is arbitrary tool substitution within the window with no verifier firing. Mitigation is compositional, not local: embed anchor `kid` and anchor validity bounds in every descriptor VC; compose the session-anchor check with the VC-chain check at the resolution call site; and emit a distinct `AnchorRotationMidSession` condition that forces re-federation rather than being absorbed by either the success or failure path. ```python class AnchorRotationMidSession(RuntimeError): """Raised when a resolved descriptor is signed by an anchor other than the one pinned at session establishment, but still chains to the same org DID. This is a recoverable rotation, NOT a forgery. Caller must re-federate.""" def __init__(self, session_kid: str, descriptor_kid: str, org_did: str): self.session_kid = session_kid self.descriptor_kid = descriptor_kid self.org_did = org_did super().__init__( f"descriptor signed by {descriptor_kid} but session pinned " f"{session_kid} for org {org_did}; re-federation required" ) class TrustBoundaryViolation(RuntimeError): """Descriptor chains to a different org DID than the session anchor.""" pass def resolve_descriptor( session_anchor: dict, # {"kid": ..., "org_did": ..., "valid_until": ...} descriptor_vc: dict, # {"signing_kid": ..., "issuer_did": ..., "chain": [...]} now: float, ) -> dict: signing_kid = descriptor_vc["signing_kid"] issuer_did = descriptor_vc["issuer_did"] if issuer_did != session_anchor["org_did"]: raise TrustBoundaryViolation( f"descriptor issuer {issuer_did} != session org {session_anchor['org_did']}" ) if now > session_anchor["valid_until"]: raise AnchorRotationMidSession( session_kid=session_anchor["kid"], descriptor_kid=signing_kid, org_did=issuer_did, ) if signing_kid != session_anchor["kid"]: # Same org, different anchor: rotation, not forgery. Force re-federation. raise AnchorRotationMidSession( session_kid=session_anchor["kid"], descriptor_kid=signing_kid, org_did=issuer_did, ) return descriptor_vc ```