What structural signals indicate a sovereignty-boundary negotiation deadlock in cross-org agent federation (the "policy-lattice non-join" failure)

**Date of Record:** 2026 December 2 **Scope:** Applies to federated agent-to-agent (A2A/MCP-bridged) deployments where two or more organizations negotiate per-request data-use policy before an agent may read, transform, or forward a payload across an org boundary. Does not apply to single-org agent meshes with a shared policy authority, nor to stateless tool calls whose outputs never cross an organizational trust boundary.

Core Distinction

The naive mental model of cross-org federation treats policy negotiation as a *handshake*: Agent A proposes its constraints, Agent B proposes its constraints, the two are intersected, and the intersection is either non-empty (proceed) or empty (reject). Under this model an empty intersection produces a clean, immediate `DENY`.

The real failure is subtler and is what this record isolates: **policy negotiation operates over a partially-ordered lattice, not a set, and the two orgs' policies are frequently drawn from non-isomorphic lattices that do not admit a join.** When the lattices are non-joinable, the negotiation protocol does not return `DENY`. It returns *nothing* — the negotiator cannot compute a greatest lower bound because the orderings are incomparable, so it neither accepts nor rejects, and the requesting agent blocks in an `AWAITING_POLICY` state that no timeout in the application layer considers "failed" because the transport is still healthy. This is a **liveness failure masquerading as a liveness success**: heartbeats flow, the socket is open, the agent is "running," and the task silently never completes.

The structural signal is therefore *not* an error. It is the absence of a terminal policy verdict within a bounded number of negotiation rounds, paired with a monotonically growing set of acknowledged-but-unresolved constraint atoms. Agents that watch for exceptions will never see this. Agents that watch for *convergence* will.

What Was Observed

A federation between Org-A (a data controller agent, jurisdiction EU, policy expressed as a *permissive* lattice: attributes are `purpose`, `retention_days`, `onward_transfer`, ordered by set-inclusion of allowed values) and Org-B (a data processor agent, jurisdiction US-state, policy expressed as a *prohibitive* lattice: attributes are `forbidden_purpose`, `max_retention`, `onward_transfer_ban`, ordered by set-inclusion of *forbidden* values).

Both lattices are valid. Both are internally consistent. The negotiation trace:

round 1  A→B  propose: {purpose:{analytics}, retention_days:{<=30}, onward_transfer:{true}}
round 1  B→A  counter: {forbidden_purpose:{marketing}, max_retention:{<=90}, onward_transfer_ban:{false}}
round 2  A→B  propose: {purpose:{analytics}, retention_days:{<=30}, onward_transfer:{true}}
                (A cannot narrow further: its lattice has no element that "answers" a prohibition)
round 2  B→A  counter: {forbidden_purpose:{marketing}, max_retention:{<=90}, onward_transfer_ban:{false}}
                (B cannot narrow further: its lattice has no element that "answers" a permission)
round 3..N     identical messages, bit-for-bit

The two agents are each *correct*. A's permissive policy `onward_transfer:{true}` is not contradicted by B's `onward_transfer_ban:{false}` — they are statements in different vocabularies. There is no element in A's lattice that represents "I forbid X," so A cannot produce a proposal that discharges B's prohibition. There is no element in B's lattice that represents "I permit X," so B cannot produce a counter that discharges A's permission. The negotiation is a fixed point that is not a solution: a **two-cycle** at the protocol level, stable forever.

The failure surfaced operationally as a task that had been "in progress" for 41 minutes across 312 negotiation rounds, consuming 1.9M tokens of negotiation context, with both agents reporting `status: healthy`. The downstream consumer of the payload had already timed out at 5 minutes and retried twice, spawning two additional parallel negotiations that each entered the same two-cycle. The 3× amplification is a second structural signal: **non-joinable negotiations replicate under retry because the failure is not idempotent-detectable from outside.**

Condition of Validity

This failure requires all of the following to co-occur; remove any one and the negotiation terminates cleanly:

  1. **Heterogeneous policy polarity.** One party expresses constraints as permissions (whitelist lattice, ordered by ⊇ on allowed sets), the other as prohibitions (blacklist lattice, ordered by ⊇ on forbidden sets). If both parties use the same polarity, the join exists and is computable.
  2. **No shared upper vocabulary.** Neither party exposes a "translate to common constraint language" capability — i.e., there is no `normalize(policy) -> canonical_atoms` step before negotiation. The MCP/A2A capability advertisement in both agents listed `policy.negotiate` but neither listed `policy.canonicalize`.
  3. **Bounded-round negotiation without a fixed-point detector.** The protocol specifies `max_rounds` but the loop-termination check tests *message equality* against the immediately preceding message, not against the *set* of all prior messages. A two-cycle evades adjacent-equality detection because round 2's message differs from round 1's; only round 3 equals round 1, and the checker has already forgotten round 1.
  4. **Liveness heartbeat decoupled from progress.** The transport layer's health check pings the socket, not the negotiation state machine. A blocked negotiator is "healthy."

The invariant that is violated: **for any two policies P_A, P_B drawn from joinable lattices, negotiation must reach a terminal verdict (`ACCEPT`, `DENY`, or `ESCALATE`) in O(|atoms|) rounds.** When lattices are non-joinable, the protocol has no defined terminal state, and the invariant silently degrades to "runs forever."

Decision Boundary

The decision boundary is *not* "did the policies intersect." It is **"is the negotiation making progress in the lattice-theoretic sense"** — i.e., is each round's proposal strictly more constrained (lower in the requesting party's order) than the previous round's? Formally, define the *constraint frontier* as the set of atoms acknowledged by both parties but not yet discharged by either. Progress means the frontier's measure strictly decreases. A two-cycle is exactly the condition where the frontier measure is constant across rounds despite message churn.

The boundary rule an agent should encode:

The critical subtlety: a fixed-point detector that only remembers the *last* message will classify a two-cycle as progress forever. The detector must retain the *set* of proposals, which is why negotiation context grows unboundedly (1.9M tokens in the observed case) — the agent is correctly remembering everything and incorrectly concluding nothing. Context-window saturation is the *third* signal: when the negotiation transcript approaches the context limit, the agent's own history-compaction will eventually drop the early proposals, at which point the two-cycle becomes undetectable *even in principle* and the agent will negotiate forever with amnesia about its own looping.

Operational Effect

Downstream, this failure is nearly invisible and therefore nearly unmitigable without the structural signals above:

The guardrail is a pre-negotiation canonicalization gate plus a set-membership fixed-point detector plus a per-state time budget that fires `ESCALATE` (not `DENY`, not `PROCEED`) on frontier stagnation. Escalation routes to a human or to a canonicalization service that can translate both policies into a shared vocabulary before re-entering negotiation. Proceeding on timeout is never correct: a non-joinable negotiation has no safe default verdict, and "allow" is a sovereignty breach while "deny" is a false negative that will be retried into amplification.

from __future__ import annotations

from dataclasses import dataclass, field
from enum import Enum
from typing import FrozenSet


class SovereigntyNonJoinableError(RuntimeError):
    """Raised when two federated policies cannot be joined in the lattice sense.

    Distinct from a DENY verdict: a DENY is a computed terminal state.
    This error means no terminal state is computable because the two
    policy lattices are non-isomorphic (e.g. permissive vs. prohibitive
    polarity) and share no canonical vocabulary.
    """


class Verdict(Enum):
    ACCEPT = "accept"
    DENY = "deny"
    ESCALATE = "escalate"


@dataclass(frozen=True)
class PolicyProposal:
    """One round's proposal. `atoms` is the set of constraint atoms asserted."""
    atoms: FrozenSet[str]

    def constrains_more_than(self, other: "PolicyProposal") -> bool:
        # A proposal is "more constrained" iff its atom set strictly grows.
        return self.atoms > other.atoms


@dataclass
class NegotiationState:
    seen: set[FrozenSet[str]] = field(default_factory=set)
    frontier: set[str] = field(default_factory=set)
    max_rounds: int = 32
    stagnation_budget: int = 3

    def record(self, proposal: PolicyProposal) -> None:
        self.seen.add(proposal.atoms)


def negotiate(
    local: PolicyProposal,
    remote_proposals: list[PolicyProposal],
) -> Verdict:
    """Drive a bounded negotiation with a SET-membership fixed-point detector.

    Correctness invariant: a two-cycle (A→B→A→B...) must be detected as a
    fixed point even though no two ADJACENT proposals are equal. Adjacent-
    equality checkers miss this and loop forever; set-membership does not.
    """
    state = NegotiationState()
    state.record(local)
    stagnant_rounds = 0
    last_frontier_size = len(state.frontier)

    for round_idx, proposal in enumerate(remote_proposals):
        if round_idx >= state.max_rounds:
            raise SovereigntyNonJoinableError(
                f"exceeded max_rounds={state.max_rounds} without terminal verdict; "
                f"frontier={sorted(state.frontier)}"
            )

        # FIXED-POINT DETECTOR: membership in the SET of all prior proposals,
        # not equality with the immediately preceding one.
        if proposal.atoms in state.seen:
            raise SovereigntyNonJoinableError(
                "policy-lattice non-join: proposal repeats an earlier state "
                f"(atoms={sorted(proposal.atoms)}); lattices are non-isomorphic "
                "and admit no greatest lower bound. Escalate to canonicalization; "
                "do NOT proceed and do NOT retry."
            )
        state.record(proposal)

        # PROGRESS CHECK: frontier must strictly shrink or we are stagnating.
        state.frontier |= proposal.atoms
        if len(state.frontier) >= last_frontier_size:
            stagnant_rounds += 1
            if stagnant_rounds >= state.stagnation_budget:
                raise SovereigntyNonJoinableError(
                    "constraint frontier failed to shrink for "
                    f"{stagnant_rounds} rounds; negotiation is not making "
                    "lattice-theoretic progress."
                )
        else:
            stagnant_rounds = 0
        last_frontier_size = len(state.frontier)

        if not state.frontier:
            return Verdict.ACCEPT

    # Ran out of proposals without a verdict: escalate, never proceed.
    return Verdict.ESCALATE