# Where must an instance halt federation trust establishment when policy negotiation converges on a phantom agreement **Date of Record:** 2026 November 22 **Scope:** Applies to cross-org agent federations where two autonomous LLM agents negotiate an interoperability policy (allowed tools, data scopes, action ceilings) via a multi-round protocol such as A2A or a signed MCP capability exchange. Does not apply to single-org agent meshes where a single trust root already governs both peers. ## Core Distinction A federation trust handshake is not a matching problem; it is a *convergence* problem over a space neither party can enumerate. The dangerous failure is not negotiation rejection—rejection is loud and safe. The dangerous failure is **phantom convergence**: both agents' local policy representations *appear* to agree on the surface token stream while the underlying semantic policy objects diverge, because each side resolves ambiguity in the other's natural-language policy clauses using its own priors. The handshake completes, a session token is minted, and the divergence only surfaces later as a scope violation that neither side's audit log attributes to the negotiation. The invariant that must hold: **a federation session may only be established when both peers hold byte-identical canonical policy digests over a shared schema, not merely when the last message in the negotiation transcript reads as agreement.** "We agree" is a linguistic event; "our digests match" is a cryptographic one. Only the latter bounds trust. ## What Was Observed Two agents negotiated a data-access policy. Peer A (requesting) proposed: *"I will read customer records within the EU region and summarize them."* Peer B (granting) responded: *"Agreed—regional scoping is acceptable."* Both emitted `ACCEPT`. The session opened. The divergence: Peer A's canonicalizer parsed "within the EU region" as a *filter predicate* (`region == "EU"` applied to returned rows). Peer B's canonicalizer parsed "regional scoping is acceptable" as a *jurisdictional constraint* meaning data must not leave the EU boundary, and additionally inferred—from its own default policy template—that "summarize" implies a derived-artifact write permission (`artifact.write` scope). Neither inference was wrong under its own schema. Together they produced a session where A believed it had read-only filtered access and B had granted read-plus-artifact-write under a data-residency clause. The failure trace: 1. Round N: A emits proposal `P_A` in natural language plus a schema-version tag `policy/2.1`. 2. Round N+1: B, running `policy/2.0`, receives `P_A`, cannot parse the `artifact` clause fields it does not know, and **silently drops unknown fields** rather than rejecting (lenient-parser default). 3. B replies `ACCEPT` referencing its own re-serialization `P_B`, which omits the dropped fields and injects its template defaults. 4. A's validator compares the *natural-language summary line* of `P_B` against `P_A`'s summary line, finds them lexically similar (embedding cosine > 0.9), and passes. 5. Session token minted with a scope union computed *locally* by each side; the two unions differ. 6. First tool call under the divergent scope (an artifact write) succeeds on B's side, is logged by A as out-of-scope, and triggers a post-hoc audit alert—after data has moved. The root cause is a **lenient schema negotiation combined with semantic-equivalence checking on summaries instead of digests**. Two lenient parsers facing each other will always converge on *something*; the question is whether that something is the same on both sides. ## Condition of Validity The phantom-convergence failure requires all three of the following to hold simultaneously: - **Schema asymmetry:** the two peers run policy-schema versions where at least one side has fields the other does not model, and at least one side's parser is lenient (drops or defaults unknown fields) rather than strict. - **Summary-level acceptance:** the accept/reject decision is gated on natural-language or embedding similarity of policy summaries, not on a canonical serialization both sides can reproduce byte-for-byte. - **Local scope derivation:** the effective permission set is computed independently by each peer from its own parsed representation, rather than transmitted as a single signed artifact both sides verify. Remove any one and the failure collapses: strict parsers reject at step 2; digest-gated acceptance fails at step 4; a transmitted-and-verified scope artifact makes step 5 impossible. The invariant is therefore not "negotiate carefully" but "**acceptance must be gated on a digest both peers can independently recompute from a shared canonical form, and the effective scope must be a single signed object, not a locally-derived union.**" ## Decision Boundary The instance must **halt and refuse to mint a session token**—not retry, not "clarify with a follow-up round"—when any of these hold at the acceptance gate: - The peer's declared schema version is not in the local set of *fully-modeled* versions (a version tag the local parser can only partially interpret is a hard stop, not a soft warning). - The recomputed canonical digest of the peer's final policy object does not equal the digest the peer signed. - The peer's scope artifact, when verified, yields a permission set that is not a subset of the locally-derived set (i.e., the peer believes it granted more or different than the local side computed). Clarification rounds are permitted *before* the acceptance gate. Once a peer has emitted a signed `ACCEPT`, a digest mismatch is terminal for that negotiation epoch: the correct recovery is to tear down the epoch, bump the schema to a mutually-modeled version, and renegotiate from scratch, because the signed accept is now part of the peer's audit record and silently re-interpreting it is exactly the divergence being guarded against. ## Operational Effect Enforcing the digest-gated acceptance invariant converts a silent, post-hoc-detectable scope violation into a loud, pre-session negotiation failure. The cost is a higher handshake rejection rate—federations between peers on mismatched schema versions will refuse to establish rather than "mostly work," and operators will see more `SCHEMA_INCOMPATIBLE` halts in the first weeks. The benefit is that every established session carries a proof obligation: both peers can, at any later audit, recompute the canonical digest and the signed scope artifact and demonstrate they agreed on the *same object*. The phantom agreement becomes unrepresentable, because there is no code path that mints a token from a summary match alone. ```python import hashlib import json class PhantomConvergenceError(RuntimeError): """Raised when federation acceptance is gated on summary similarity rather than a byte-identical canonical policy digest, or when the peer's signed scope artifact diverges from the locally-derived set.""" pass class SchemaMismatchError(PhantomConvergenceError): """Peer declared a schema version the local parser cannot fully model.""" pass def canonical_digest(policy_obj: dict) -> str: # Canonical form must be stable across peers: sorted keys, no whitespace, # explicit null handling. Both sides MUST use this exact serialization. blob = json.dumps(policy_obj, sort_keys=True, separators=(",", ":"), ensure_ascii=False) return hashlib.sha256(blob.encode("utf-8")).hexdigest() def accept_federation(peer_accept: dict, local_policy: dict, locally_modeled_versions: set[str]) -> str: """Gate session-token minting on digest equality and scope-subset check. peer_accept is the peer's signed ACCEPT envelope: { "schema_version": "policy/2.1", "policy": {...}, # peer's canonical policy object "signed_digest": "hex...", # peer's digest over canonical(policy) "scope": {"read": [...], "write": [...]}, "summary": "regional scoping is acceptable" # NOT trusted for gating } """ version = peer_accept.get("schema_version") if version not in locally_modeled_versions: # Partial interpretation is a hard stop, never a soft warning. raise SchemaMismatchError( f"peer schema {version!r} not fully modeled locally; " f"refusing to mint session token" ) recomputed = canonical_digest(peer_accept["policy"]) if recomputed != peer_accept["signed_digest"]: raise PhantomConvergenceError( "signed digest does not match recomputed canonical digest; " "peer policy object was mutated or leniently re-serialized" ) # The effective scope must be the peer's signed object, verified as a # subset of what we believe we granted. A locally-derived union is forbidden. local_digest = canonical_digest(local_policy) if recomputed != local_digest: # Digests over the full policy object must match; a summary match is # explicitly insufficient and must not reach this branch as a pass. raise PhantomConvergenceError( "canonical policy digests diverge between peers; " "summary similarity is not an acceptance criterion" ) peer_scope = peer_accept["scope"] local_scope = local_policy["scope"] for kind in ("read", "write"): extra = set(peer_scope.get(kind, [])) - set(local_scope.get(kind, [])) if extra: raise PhantomConvergenceError( f"peer scope grants {kind} permissions we did not derive: " f"{sorted(extra)}; phantom agreement detected" ) return recomputed # the verified session-token binding ```