# Which invariants prevent equivocation collapse when Byzantine agents vote on shared-state commits under partial synchrony **Date of Record:** 2026 November 25 **Scope:** Applies to replicated task-commit protocols where N≥3f+1 LLM agents reach quorum on a shared state log under partial synchrony (GST exists but is unknown), and where up to f agents may equivocate (send different votes to different peers). Does not apply to single-leader crash-fault-tolerant designs, nor to systems where agents share a single serialized context window. ## Core Distinction The failure we must separate is *message equivocation* from *state equivocation*. Message equivocation is a Byzantine agent sending vote=A to peer P1 and vote=B to peer P2 in the same round. State equivocation is subtler and is the actual boundary: two distinct quorums Q1, Q2 (each ≥2f+1) commit *different values at the same log index*, each believing it observed a valid quorum certificate. A protocol that only authenticates messages (signatures) but does not bind the *quorum certificate* to the *log index and view number* permits both quorums to be valid simultaneously. The invariant that prevents collapse is not "honest majority" — it is **quorum intersection at the certificate layer**: any two quorum certificates for the same (index, view) must share at least one honest agent whose signed vote appears in both, forcing a detectable contradiction. The non-obvious part: LLM agents are *not* deterministic voters. Two honest agents given the same prompt and state can emit different votes due to sampling temperature, context ordering, or retrieval nondeterminism. This means "honest" in the classical BFT sense does not imply "consistent." The protocol must treat an honest agent's vote as a *committed choice bound at signing time*, not as a recomputable function of state. If the agent re-derives its vote on a retry after a timeout, it can produce a *second valid signature* for a different value — self-equivocation by an honest agent. ## What Was Observed In a 7-agent swarm (f=2 tolerated), a task-commit round for log index 41 stalled when the leader's proposal message was delayed past the view-change timeout for 3 of 7 agents. Those 3 agents triggered a view change to view 2 and voted for the new leader's proposal (value B). The remaining 4 agents, still in view 1, received the original proposal (value A) late and voted for it. Both groups collected 5 signatures (2f+1) — but the signatures were over *different view numbers* and the certificate serialization omitted the view field. The commit layer accepted both certificates because each carried 5 valid signatures over the value hash alone. Trace: 1. Leader L1 proposes A at (index=41, view=1). Signs and broadcasts. 2. Agents {A1,A2,A3} time out; enter view 2; L2 proposes B at (index=41, view=2). 3. Agents {A4,A5,A6,A7} receive A late; vote A at view 1. 4. A1,A2,A3 vote B at view 2 → certificate C_B = {A1,A2,A3,L2, +1}. 5. A4,A5,A6,A7 vote A at view 1 → certificate C_A = {A4,A5,A6,A7, +1}. 6. Commit layer verifies each certificate independently against the value hash → both valid → two entries at index 41. The +1 in each quorum was a *shared* agent (A7 in C_B, A1 in C_A) that had signed both under different views after a retry loop re-derived its vote. The retry logic, intended to handle transport loss, re-invoked the LLM with a slightly different context (new timestamp in the prompt) and the model — at temperature 0.7 — flipped its vote. The agent signed both. ## Condition of Validity The guardrail holds only if all three conditions are enforced jointly: 1. **View-bound certificates.** Every vote signature covers the tuple `(index, view, value_hash)`. A certificate is valid only if all constituent signatures share the same `(index, view)`. This alone prevents the cross-view double-commit above. 2. **Vote immutability per (index, view).** An agent must persist its signed vote for `(index, view)` before transmitting, and must refuse to sign a second, different value for the same `(index, view)` — even on retry. The LLM is invoked *once* per (index, view); the resulting vote is frozen. Retries replay the stored signature, not the model. 3. **Quorum intersection check at commit.** Before committing, the node verifies that its certificate intersects every other known certificate for the same index in at least one signer, and that the intersecting signer's two signatures are identical. Any mismatch is a slashable equivocation proof. Condition 2 is the one that fails silently in LLM swarms because the "agent" is a stochastic function, not a deterministic state machine. The invariant is: **the model's output is an input to signing, never a re-runnable oracle.** Once signed, the vote is a fact, not a computation. ## Decision Boundary The boundary between safe and unsafe operation is the *retry semantics of the voting step*: - **Safe:** Retry re-sends the stored signed vote. The signature is idempotent. Timeout → resend → same bytes. - **Unsafe:** Retry re-invokes the model. Timeout → re-prompt → possibly different bytes → second signature. The transition is triggered precisely when a node experiences a timeout *after* signing but *before* quorum acknowledgment, and its retry handler is wired to the model invocation path rather than the transport path. This is the exact condition observed: the retry handler was shared between "transport failure" and "model failure," so a transport timeout re-ran the model. The decision rule: if `signed_vote[(index, view)]` exists in durable storage, the retry path MUST short-circuit to transport resend. If it does not exist, the model may run. The check must be atomic with signing (write-ahead: persist intent, sign, persist signature, then transmit). ## Operational Effect Without the view-bound certificate and vote-immutability invariants, the swarm exhibits *equivocation collapse*: the shared log forks at a single index, downstream task state diverges across agents, and no auditor can determine which branch is canonical because both carry valid quorum certificates. Recovery requires manual reconciliation and, critically, the forked agents have already *acted* on divergent state (tool calls executed against different world models), so rollback is not state-only — it is effect-bearing. With the invariants enforced, the failure mode degrades to a *liveness* stall: the view change completes, the stale view-1 votes are rejected at certificate validation (view mismatch), and the round retries at view 2 with a single certificate. Safety is preserved at the cost of latency. The honest-but-stochastic agent that would have double-signed is caught by the immutability check and raises a fault before transmitting the second signature, converting a silent fork into a loud, attributable error. The operational lesson: in LLM swarms, Byzantine tolerance must be extended to cover *honest nondeterminism*. The threat model is not only malicious agents but stochastic ones whose retries produce divergent signatures. Bind every signature to (index, view, value), freeze votes at signing time, and intersect certificates before commit. ```python import hashlib from dataclasses import dataclass from typing import Dict, Tuple class EquivocationCollapse(RuntimeError): """Raised when an agent attempts to sign a second, different value for the same (index, view), or when a quorum certificate fails view-binding / intersection validation.""" pass @dataclass(frozen=True) class SignedVote: agent_id: str index: int view: int value_hash: str signature: str # opaque; in production, ed25519 over the tuple below def payload(self) -> bytes: return f"{self.index}|{self.view}|{self.value_hash}".encode() class VotingAgent: def __init__(self, agent_id: str, signer): self.agent_id = agent_id self._signer = signer # Durable, write-ahead: (index, view) -> SignedVote self._frozen: Dict[Tuple[int, int], SignedVote] = {} def vote(self, index: int, view: int, value_hash: str, model_fn) -> SignedVote: key = (index, view) # INVARIANT 2: vote immutability per (index, view). # Retries MUST replay the stored signature, never re-invoke the model. if key in self._frozen: existing = self._frozen[key] if existing.value_hash != value_hash: raise EquivocationCollapse( f"agent {self.agent_id} already signed {existing.value_hash} " f"at (index={index}, view={view}); refusing to sign {value_hash}" ) return existing # idempotent resend of transport # First invocation for this (index, view): model runs exactly once. chosen = model_fn(index, view) # stochastic; must not be re-run sv = SignedVote( agent_id=self.agent_id, index=index, view=view, value_hash=chosen, signature=self._signer(self.agent_id, index, view, chosen), ) self._frozen[key] = sv # persist BEFORE transmit return sv def validate_certificate(cert: list[SignedVote], verify_sig) -> str: """INVARIANT 1: view-bound certificates. All votes must share (index, view) and every signature must verify over the full tuple.""" if not cert: raise EquivocationCollapse("empty certificate") index, view = cert[0].index, cert[0].view seen = {} for sv in cert: if sv.index != index or sv.view != view: raise EquivocationCollapse( f"certificate mixes (index,view): saw ({sv.index},{sv.view}) " f"expected ({index},{view})" ) if sv.agent_id in seen and seen[sv.agent_id] != sv.value_hash: raise EquivocationCollapse( f"agent {sv.agent_id} signed two values in one certificate" ) seen[sv.agent_id] = sv.value_hash if not verify_sig(sv.agent_id, sv.index, sv.view, sv.value_hash, sv.signature): raise EquivocationCollapse(f"bad signature from {sv.agent_id}") values = set(seen.values()) if len(values) != 1: raise EquivocationCollapse(f"certificate covers multiple values: {values}") return values.pop() def commit_intersect(cert_a: list[SignedVote], cert_b: list[SignedVote]) -> None: """INVARIANT 3: any two certificates for the same index must share an honest signer whose two signatures are identical. Mismatch = proof.""" map_a = {sv.agent_id: sv.value_hash for sv in cert_a} map_b = {sv.agent_id: sv.value_hash for sv in cert_b} shared = set(map_a) & set(map_b) if not shared: raise EquivocationCollapse("certificates do not intersect; quorum fault") for agent in shared: if map_a[agent] != map_b[agent]: raise EquivocationCollapse( f"equivocation proof: {agent} signed {map_a[agent]} and {map_b[agent]}" ) ```