# How should an instance bind a federated peer's policy-negotiation state to its mTLS leaf identity when the peer rotates certificates mid-handshake **Date of Record:** 2026 November 26 **Scope:** Applies to cross-org agent federation where an inbound agent's authorization decisions (tool grants, data-scope claims, delegation depth) are derived from a policy-negotiation handshake performed over a mutually-authenticated TLS channel. Does not apply to single-org deployments where identity and policy share one trust root, nor to stateless request/response APIs that carry a signed warrant on every call. ## Core Distinction The failure is not "certificate rotation breaks connections." TLS libraries handle renegotiation and session resumption. The failure is a **binding gap between the identity that authenticated the channel and the identity that authored the policy state**. During federation, an agent A (org Alpha) and agent B (org Beta) run a negotiation handshake: B proposes a capability set, A counter-proposes with scope restrictions, they converge on a `PolicyGrant` object that A caches and reuses for the life of the session. That `PolicyGrant` is keyed, in most implementations, to the *TLS session* or to the *connection*, not to the *cryptographic identity* of B's leaf certificate. When Beta rotates B's leaf mid-session—routine, scheduled, every 24h in many fleets—the transport layer may transparently resume or renegotiate, but the cached `PolicyGrant` survives. The new leaf has a different subject key identifier, possibly a different SAN set, and the grant was never re-validated against it. The distinction that matters: **authentication is a point-in-time event; authorization state is a durable object.** Federation designs that treat the handshake as "authenticate once, then trust the connection" conflate the two. The correct invariant is that every policy object must carry a cryptographic binding to the exact leaf identity that negotiated it, and that binding must be re-checked at every authorization decision, not just at channel establishment. ## What Was Observed A federated deployment between two agent fleets, Alpha (data-owning) and Beta (orchestrating). Beta's agents request scoped access to Alpha's retrieval tools. The handshake: Beta presents leaf cert `CN=agent-beta-07, SAN=beta.example/agents/07`, Alpha validates against Beta's pinned intermediate, runs a policy negotiation (3 round-trips), emits a `PolicyGrant{grant_id, scopes:[retrieval:read, corpus:finance], max_delegation_depth:2, expires: T+3600}`, and caches it keyed by `connection_id`. At T+1800, Beta's cert manager rotates `agent-beta-07`'s leaf. The new leaf has a fresh serial and a new SKI but the same CN/SAN. The TLS layer on Beta's side opens a new connection (the old one was idle-timed-out), and because Alpha's federation config uses session resumption with a ticket, the resumed session *appears* to Alpha as a continuation. Alpha's connection-keyed cache looks up the `PolicyGrant` by the resumed session's `connection_id`—which the resumption ticket preserved—and reuses it. The new leaf was issued under a *different* intermediate: Beta had also rotated its intermediate CA, and the new leaf chains to `beta-intermediate-2`, which Alpha's pinning config had not yet added (rotation of the intermediate was scheduled for T+3600). Alpha accepted the leaf because the *resumption ticket* was signed by Alpha's own session-ticket key, not by Beta's chain. The chain validation was skipped entirely on the resumed session. So Alpha granted `corpus:finance` scope to a leaf it had never actually validated, and whose issuing chain it did not trust. The observable symptom was not a TLS error. It was a **silent scope grant to an unvalidated identity**, discoverable only by cross-referencing the grant audit log against the certificate transparency log for Beta's intermediate rotation. The agent that received the grant behaved correctly within its scopes; the scopes themselves were the breach. ## Condition of Validity The invariant holds—i.e., the federation is safe—only when *all* of the following are true: 1. **Grant-to-leaf binding is explicit.** The `PolicyGrant` stores the leaf's SKI (or full cert fingerprint), not the connection ID. Any authorization decision re-derives the current peer leaf from the live TLS session and compares fingerprints. Mismatch → grant invalid regardless of session continuity. 2. **Resumption does not bypass chain validation.** If the deployment uses TLS session resumption (tickets or IDs), the resumption path must still re-validate the peer chain against current trust anchors at resumption time, or resumption must be disabled for federated peers. Ticket-based resumption that carries a prior authentication decision forward is the exact mechanism that let the unvalidated leaf through. 3. **Trust-anchor rotation is ordered.** An intermediate CA must be added to the peer's trust store *before* leaves chaining to it are issued, with a documented overlap window. If leaves can chain to an intermediate before the peer trusts it, the only thing preventing acceptance is chain validation—which resumption just skipped. 4. **Policy state has its own TTL independent of session.** A grant negotiated at T+0 with `expires: T+3600` must not be extended by session resumption. Resumption extends the *channel*; it must not extend the *grant*. When any of these is false, the federation has a window—bounded by rotation cadence and resumption ticket lifetime—during which authorization is decoupled from authentication. ## Decision Boundary The decision an instance must make at each inbound authorization check is: **is this grant's bound identity the identity currently on the channel, and is that identity currently trusted?** - If the grant's stored fingerprint equals the live peer leaf fingerprint **and** the live leaf chains to a currently-pinned anchor → authorize. - If fingerprints differ → the peer re-authenticated as a different identity; **discard the grant, force renegotiation**. Do not "update" the grant's binding in place—the new identity may warrant different scopes, and the negotiation must reflect that. - If fingerprints match but the chain no longer validates (anchor removed, intermediate untrusted) → **fail closed**, revoke the grant, emit a `FederationBindingError`. This is the case the deployment above hit: same SAN, but the leaf's chain was no longer trusted. - If the session is resumed and the implementation cannot re-validate the chain on resumption → treat the resumed session as unauthenticated and require a full handshake before any grant is honored. The boundary is sharp: there is no "trust the session, not the cert" mode that is safe under cross-org rotation. The moment authorization state outlives the authentication event that produced it, the binding must be re-established cryptographically, not inferred from transport continuity. ## Operational Effect Enforcing the binding changes federation behavior in three concrete ways. First, **session resumption becomes a re-authentication trigger, not a shortcut**—every resumed federated session pays a chain-validation cost, which is cheap (one signature check) relative to the breach it prevents. Second, **certificate rotation causes grant renegotiation**, so Beta's 24h rotation cadence forces a policy re-handshake every 24h per agent; this is correct but must be budgeted, because the 3-round-trip negotiation now recurs and can collide with in-flight tool calls (the agent must checkpoint mid-task and resume after renegotiation—a separate continuity concern). Third, **trust-anchor rotation ordering becomes a hard deployment gate**: adding an intermediate to the peer's trust store is a prerequisite for issuing leaves under it, and the overlap window must exceed the maximum session/grant lifetime or the system will fail closed on legitimate rotations. The guardrail is a single check at the authorization chokepoint, not a transport-layer fix. TLS libraries will not do this for you; resumption is designed to skip exactly the validation that federation needs. ```python import hashlib from dataclasses import dataclass from typing import Optional class FederationBindingError(RuntimeError): """Raised when a cached PolicyGrant is not cryptographically bound to the live peer leaf identity, or when that leaf no longer chains to a pinned trust anchor. Fail closed: never authorize on a stale or unvalidated binding.""" @dataclass(frozen=True) class PolicyGrant: grant_id: str scopes: tuple max_delegation_depth: int expires_at: float bound_leaf_fingerprint: str # SHA-256 of peer leaf DER, set at negotiation time def leaf_fingerprint(peer_leaf_der: bytes) -> str: return hashlib.sha256(peer_leaf_der).hexdigest() def authorize( grant: PolicyGrant, live_peer_leaf_der: bytes, chain_valid_against_pinned_anchors: bool, now: float, ) -> tuple: """Re-validate grant-to-leaf binding at every authorization decision. This must be called on the live TLS session's peer certificate, NOT on a cached identity from handshake time, and NOT keyed by connection/session id. """ if now >= grant.expires_at: raise FederationBindingError( f"grant {grant.grant_id} expired at {grant.expires_at}; " "session resumption does not extend grant lifetime" ) live_fp = leaf_fingerprint(live_peer_leaf_der) if live_fp != grant.bound_leaf_fingerprint: # Peer re-authenticated as a different identity (e.g. cert rotation). # Do not rebind in place: the new identity may warrant different scopes. raise FederationBindingError( f"grant {grant.grant_id} bound to leaf {grant.bound_leaf_fingerprint[:16]} " f"but live peer leaf is {live_fp[:16]}; force renegotiation" ) if not chain_valid_against_pinned_anchors: # Same leaf, but its chain no longer validates (anchor/intermediate # rotation, or resumption bypassed chain validation). Fail closed. raise FederationBindingError( f"grant {grant.grant_id} leaf {live_fp[:16]} does not chain to a " "currently-pinned trust anchor; revoke and re-handshake" ) return grant.scopes ```