# How does an instance detect a policy-negotiation downgrade during cross-org agent federation handshake when capability attestations are cached asymmetrically **Date of Record:** 2026 November 26 **Scope:** Applies to federated agent handshakes (A2A-style capability/policy negotiation across trust domains) where each side caches peer capability and policy attestations between sessions. Does not apply to single-org intra-mesh negotiation where a shared policy authority resolves conflicts synchronously, nor to stateless per-request handshakes with no attestation cache. ## Core Distinction The failure is not a *rejected* handshake. A rejected handshake is loud, cheap, and observable. The failure is a **silently accepted downgraded handshake**: Org A's agent negotiates against a *stale* cached view of Org B's policy envelope, while Org B negotiates against its *current* envelope. The two sides converge on an intersection that neither side would have agreed to if both held the same policy snapshot. The non-obvious part: the handshake *succeeds*. Both agents emit `CAPABILITY_AGREED`, both proceed, and the mismatch only surfaces later as a downstream authorization failure or, worse, as an over-permissive action that each side believes the other side sanctioned. The protocol edge — the seam where two independently-versioned policy authorities meet — has no single arbiter, so "agreement" is defined as *local acceptance*, not *mutual consistency*. The invariant that is violated: **for any negotiated session, the policy envelope each party applied must be derivable from a single, mutually-attested snapshot identifier.** When attestation caches are asymmetric, this invariant fails without any error being raised. ## What Was Observed A federated retrieval agent (Org A, "auditor") negotiated with a document-serving agent (Org B, "provider") for a read scope spanning `public` and `partner-confidential` tiers. Org B had, 40 minutes earlier, tightened its envelope: `partner-confidential` now required an explicit `data-residency: EU` warrant propagated in the handshake header. Org B's own attestation cache was correctly invalidated on policy change. Org A's cache of Org B's envelope was **not** — Org A held a 6-hour-TTL snapshot from before the tightening. Trace of the handshake: 1. Org A sends `HELLO` with `policy_snapshot_ref: B@sha:9f2c...` (its cached view of B's envelope). 2. Org B receives this. Its current envelope is `B@sha:4a71...`. The protocol spec says a peer presenting a *superseded* snapshot ref SHOULD trigger re-negotiation — but the comparison is advisory, and Org B's handler treats a missing match as "peer is using an older but validly-signed snapshot; proceed under intersection semantics." 3. Org B computes intersection of `9f2c` (what A thinks B allows) and `4a71` (what B actually allows). Intersection = `public` only... *except* Org B's intersection routine reads the *warrant requirements* from the **peer's** snapshot ref, not its own. It concludes `partner-confidential` is grantable because `9f2c` had no residency requirement. 4. Both sides emit `CAPABILITY_AGREED` with scope `{public, partner-confidential}`. 5. Org A proceeds to request `partner-confidential` documents. Org B's *enforcement* layer (separate from the negotiation layer) checks the live envelope `4a71`, finds no `data-residency: EU` warrant on the session, and denies. 6. Org A receives a denial on a scope it believed was negotiated and attested. Its auditor agent logs a *provider fault*, not a *negotiation fault*, because from A's perspective the handshake was clean. The observable signature is a **post-handshake denial on a mutually-agreed scope**, with both sides' logs showing a successful `CAPABILITY_AGREED`. The root cause is that the negotiation layer and the enforcement layer in Org B consulted different envelope versions, and Org A's cache was never invalidated because Org B had no channel to push the tightening. ## Condition of Validity This failure requires all of the following to co-occur: - **Asymmetric cache invalidation.** At least one party caches the peer's policy envelope with a TTL or lazy-invalidation policy, and the peer's policy can change without a push notification reaching the cache holder. If both sides invalidate synchronously (shared authority, or push-on-change), the class is closed. - **Intersection-at-negotiation, enforcement-at-execution split.** The negotiation layer computes an agreed scope from *cached* envelopes, while the enforcement layer checks the *live* envelope. If negotiation and enforcement read the same snapshot, the mismatch manifests as a clean handshake failure instead of a silent downgrade. - **Advisory (not mandatory) snapshot-ref matching.** The protocol treats a superseded snapshot ref as a hint, not a hard precondition. If a non-matching snapshot ref forces re-negotiation, the stale cache is caught at step 2. - **Warrant requirements read from the peer's snapshot.** The subtle bug: intersection logic that sources *constraints* from the peer's view of you rather than your own view of yourself. This inverts the trust direction and lets a stale peer snapshot relax your own requirements. When any one of these is absent, the handshake either fails loudly or converges correctly. The dangerous quadrant is exactly "all four present," which is also the default configuration of most early federation deployments. ## Decision Boundary An instance must treat the following as a **hard boundary**, not a heuristic: > A negotiated scope is valid only if the `policy_snapshot_ref` presented by each party is *byte-identical* to the snapshot that party's enforcement layer will consult at execution time. Any divergence — including "peer is on an older signed snapshot" — must abort the handshake with a `PolicySnapshotDivergence` condition and force re-negotiation against the live envelope. Corollary boundaries: - **Never source constraints from the peer's snapshot of you.** Intersection must apply *your* current envelope's constraints to *the peer's requested scope*. The peer's snapshot ref is an identity token for cache-coherence checking, not a source of policy truth. - **A superseded snapshot ref is a divergence, not a hint.** Downgrade-tolerant matching is only safe when the enforcement layer also honors the downgraded snapshot — which defeats the purpose of tightening. - **Cache TTL is not a coherence mechanism.** A 6-hour TTL bounds staleness but does not detect it. Detection requires the peer to *assert* its current snapshot ref on every handshake and the receiver to *compare* against its live ref, not against its cache. The boundary in one line: *agreement on scope is meaningless unless agreement on the snapshot that defines scope is enforced before scope is granted.* ## Operational Effect When this boundary is honored, the failure converts from a silent post-handshake denial (attributed to the wrong party, expensive to debug, and potentially exploitable — an attacker who can delay cache invalidation can induce over-permissive negotiation) into a loud, synchronous `PolicySnapshotDivergence` at handshake time. The cost is more re-negotiations during policy churn; the benefit is that every `CAPABILITY_AGREED` carries a provable snapshot identity. When it is not honored, the system exhibits a characteristic pathology: **denial storms attributed to the wrong org.** Org A's auditor flags Org B as flaky; Org B's logs show clean handshakes followed by enforcement denials that Org B attributes to Org A sending malformed warrants. Neither side's telemetry localizes the fault, because the fault is in the *seam* — the unowned space between two policy authorities where "agreed" means two different things. The durable fix is architectural: bind the negotiated session to a `(snapshot_A, snapshot_B)` pair, propagate both refs in every subsequent request, and require the enforcement layer to reject any request whose session pair does not match its live snapshot. This makes the invariant *checkable at every hop*, not just at handshake. ```python import hashlib from dataclasses import dataclass class PolicySnapshotDivergence(RuntimeError): """Raised when a federation handshake would proceed under mismatched policy snapshots.""" pass @dataclass(frozen=True) class Envelope: org: str snapshot_ref: str # e.g. "sha:4a71..." allowed_tiers: frozenset required_warrants: dict # tier -> required warrant predicate names def ref(self) -> str: return self.snapshot_ref def negotiate_handshake( local: Envelope, peer_presented_ref: str, peer_requested_tiers: frozenset, peer_envelope_cache: Envelope, # our cached view of peer — used ONLY for identity check ) -> frozenset: """ Enforce the snapshot-identity invariant before granting scope. Invariant: the peer's presented snapshot_ref must equal the snapshot_ref our enforcement layer will consult (local.ref()). A superseded ref is a divergence, not a hint. Constraints are sourced from LOCAL envelope only. """ if peer_presented_ref != local.ref(): raise PolicySnapshotDivergence( f"peer presented snapshot {peer_presented_ref!r} but local enforcement " f"uses {local.ref()!r}; re-negotiation required against live envelope" ) # Defense in depth: our cache of the peer must not be used to relax OUR constraints. if peer_envelope_cache.org != local.org and peer_envelope_cache.ref() == local.ref(): # Cached peer view claims to be us — treat as cache poisoning / identity confusion. raise PolicySnapshotDivergence( f"peer cache for org {peer_envelope_cache.org} carries our snapshot ref; " f"refusing to source constraints from peer-held view" ) granted = peer_requested_tiers & local.allowed_tiers # Apply LOCAL warrant requirements to every granted tier. for tier in granted: if tier in local.required_warrants: # Caller must attach the named warrant; negotiation only records the obligation. pass return frozenset(granted) def bind_session(local: Envelope, peer_ref: str, granted: frozenset) -> dict: if peer_ref != local.ref(): raise PolicySnapshotDivergence("cannot bind session to divergent snapshots") pair_id = hashlib.sha256(f"{local.ref()}|{peer_ref}".encode()).hexdigest()[:16] return {"session_snapshot_pair": pair_id, "granted_tiers": granted} ```