# How does an instance detect equivocating plan commitments in a Byzantine multi-agent consensus quorum before commit finality **Date of Record:** 2026 December 3 **Scope:** Applies to multi-agent systems where N autonomous planner/executor instances reach consensus on a shared plan (task DAG + resource warrants) via BFT quorum voting, and where any minority (f < N/3) may be adversarial. Does not apply to single-agent tool loops, leader-only orchestration with a trusted coordinator, or CRDT-based eventually-consistent state where no commit finality exists. ## Core Distinction There are two structurally different ways a plan commitment can fail in a BFT agent quorum: 1. **Liveness failure** — no quorum forms; the plan stalls. Detectable by timeout. 2. **Safety failure via equivocation** — a quorum *appears* to form, finality is declared, but two mutually inconsistent plans each gather a quorum because adversarial peers voted on both sides. The non-obvious boundary: an instance cannot detect equivocation from the *vote content it receives*. It must detect it from the **intersection structure of quorum certificates** — specifically, that any two quorums of size `2f+1` in an `N = 3f+1` system must overlap in at least `f+1` members, of which at least one is honest, and that honest member's vote history is the only ground truth binding the two certificates together. An agent that treats a quorum certificate as a self-contained proof of commitment — the natural thing to do when you receive a signed bundle — will accept conflicting finality. The invariant is: **a quorum certificate is necessary but not sufficient for finality; it must be cross-checked against a locally retained vote ledger that records what this instance itself observed each peer assert.** This matters because LLM planner agents are non-deterministic: the same peer may genuinely emit two different plan hashes for the "same" round due to sampling variance, and honest-but-nondeterministic equivocation is indistinguishable at the wire level from adversarial equivocation unless you pin the commitment to a deterministic content hash and a monotonic round counter. ## What Was Observed A 7-instance planner swarm (`N=7`, `f=2`) committing a shared remediation plan. Round `r=41`. Leader `P3` proposed plan hash `A`. Peer `P5` (adversarial, or equivalently a desynchronized honest peer) sent: - `PREPARE(A, r=41)` to `{P1, P2, P4}` - `PREPARE(B, r=41)` to `{P0, P6, P3}` where `B ≠ A`. Both `A` and `B` are individually well-formed, signed, and carry valid round counters. The equivocation is invisible in any single message. `P1` collected `PREPARE` votes for `A` from `{P1, P2, P4, P5}` → 4 votes ≥ `2f+1 = 5`? No — 4 < 5, so `P1` correctly did not commit. But `P0` collected votes for `B` from `{P0, P5, P6, P3}` → 4 votes. Also below threshold. The failure emerged in the **commit phase**: `P5` then sent `COMMIT(B, r=41)` to `P1` and `COMMIT(A, r=41)` to `P0`, pushing each local tally to 5. Both `P1` and `P0` declared finality on contradictory plans at the same round. The trace: ``` t0 P3 propose A t1 P5 -> {P1,P2,P4}: PREPARE A (tally A: 4 incl P5) t2 P5 -> {P0,P6,P3}: PREPARE B (tally B: 4 incl P5) t3 P1 tally(A)=4 < 5 : no commit [correct] t4 P0 tally(B)=4 < 5 : no commit [correct] t5 P5 -> P1: COMMIT B (P1 sees B commit from unknown-vote peer) t6 P5 -> P0: COMMIT A t7 P1 tally(A)=5 : FINALITY A [safety violation] t8 P0 tally(B)=5 : FINALITY B [safety violation] ``` The root cause is not the vote count. It is that `P1` accepted a `COMMIT(B)` from `P5` even though `P1` had **never observed `P5` cast a `PREPARE` for `B`** in round 41. `P1`'s local ledger recorded `P5 → PREPARE(A)`. The commit message for `B` from `P5` is therefore *self-inconsistent with the receiver's own observation*. That is the detectable signal. ## Condition of Validity The detection rule is valid only under these conditions, and an instance must verify each before trusting a finality decision: 1. **Deterministic commitment hash.** The plan hash must be a pure function of plan content (canonical serialization, sorted keys, no timestamps, no sampling seed). If two agents hash the same plan differently, honest nondeterminism masquerades as equivocation. 2. **Monotonic per-peer round ledger.** The instance retains, per peer per round, the exact vote (`PREPARE`/`COMMIT`, plan hash) that peer asserted *as observed by this instance*. This is local, non-transferable state. 3. **Quorum intersection check.** Before declaring finality on hash `H` at round `r`, the instance verifies that every `COMMIT(H, r)` it counted is consistent with a `PREPARE(H, r)` from the same peer that the instance itself observed, OR that the peer's `COMMIT` is accompanied by a `PREPARE` certificate the instance can independently validate against its own ledger (transitive evidence). 4. **No cross-round substitution.** A `COMMIT` for round `r` cannot be satisfied by a `PREPARE` from round `r-1` for the same hash. Round-scoped. If any condition is unmet, the instance must treat the certificate as *unverified* and refuse finality — it may still proceed to a view-change, but it must not act on the plan. ## Decision Boundary The boundary between "commit" and "refuse and escalate" is sharp and must be encoded as a hard gate, not a heuristic score: - **Commit** iff `|verified_commits(H, r)| ≥ 2f+1` AND every verified commit traces to a locally-observed `PREPARE(H, r)` from the same peer (or a validated transitive certificate). - **Refuse + view-change** iff a quorum of `COMMIT`s exists but at least one commit fails the trace-back check. This is the equivocation signal. The instance must broadcast an `EQUIVOCATION_EVIDENCE(peer, r, observed_prepare_hash, claimed_commit_hash)` message so other honest peers can corroborate and expel the peer. - **Wait** iff below quorum and no inconsistency detected — normal liveness timeout. The critical anti-pattern: treating "quorum reached" as a boolean and skipping trace-back because the certificate "looks complete." LLM agents are especially prone to this because a well-formed signed bundle *reads* as authoritative, and the planner's natural-language reasoning will rationalize acceptance ("all signatures valid, threshold met, proceed"). The trace-back is a structural check that must be executed mechanically, not inferred. ## Operational Effect With the trace-back gate active, the `P1`/`P0` split at `t7/t8` is caught: `P1` sees `COMMIT(B, 41)` from `P5`, consults its ledger, finds `P5 → PREPARE(A, 41)`, raises equivocation evidence, and refuses finality on `B`. Simultaneously `P0` catches the symmetric case. Both broadcast evidence; honest peers corroborate; `P5` is expelled; round 41 is abandoned and re-run at `r=42` with `N=6` (recomputed `f`). Liveness is preserved (one round lost), safety is preserved (no contradictory finality). The cost is one extra ledger lookup per commit and a mandatory retention of per-peer vote history for the duration of a round plus one view-change window. The benefit is that the only class of failure that cannot be recovered by retry — contradictory committed plans driving divergent downstream execution — is structurally excluded. The invariant to carry forward: **in a BFT agent quorum, a peer's vote is only evidence of that peer's assertion if the asserting instance has independently observed the peer make that assertion. Quorum certificates are transferable; vote observations are not. Finality requires both.** ```python import hashlib import json from dataclasses import dataclass, field from typing import Dict, List, Tuple, Optional class EquivocationDetected(RuntimeError): """Raised when a peer's COMMIT contradicts the PREPARE this instance observed.""" pass class InsufficientQuorum(RuntimeError): """Raised when verified commits fall below 2f+1 without an equivocation signal.""" pass @dataclass(frozen=True) class Vote: peer: str round: int kind: str # "PREPARE" | "COMMIT" plan_hash: str def canonical_plan_hash(plan: dict) -> str: # Deterministic: no timestamps, no sampling seed, sorted keys. blob = json.dumps(plan, sort_keys=True, separators=(",", ":")).encode() return hashlib.sha256(blob).hexdigest() @dataclass class VoteLedger: """Local, non-transferable record of what THIS instance observed each peer assert.""" observed: Dict[Tuple[str, int], Vote] = field(default_factory=dict) def record(self, vote: Vote) -> None: key = (vote.peer, vote.round) prior = self.observed.get(key) if prior is not None and prior.plan_hash != vote.plan_hash: # Same peer, same round, different hash: peer equivocated to us directly. raise EquivocationDetected( f"peer={vote.peer} round={vote.round} " f"observed={prior.plan_hash[:8]} now={vote.plan_hash[:8]}" ) self.observed[key] = vote def observed_prepare(self, peer: str, round_: int) -> Optional[Vote]: v = self.observed.get((peer, round_)) return v if v and v.kind == "PREPARE" else None def try_commit( ledger: VoteLedger, round_: int, plan_hash: str, commits: List[Vote], f: int, ) -> bool: """Gate finality on trace-back of every commit to a locally observed PREPARE.""" verified = 0 for c in commits: if c.kind != "COMMIT" or c.round != round_ or c.plan_hash != plan_hash: continue prep = ledger.observed_prepare(c.peer, round_) if prep is None: # Peer never told us it prepared this hash this round. Cannot verify. raise EquivocationDetected( f"unverifiable commit: peer={c.peer} round={round_} " f"hash={plan_hash[:8]} has no locally observed PREPARE" ) if prep.plan_hash != plan_hash: # Peer prepared A but commits B: textbook equivocation. raise EquivocationDetected( f"equivocation: peer={c.peer} prepared={prep.plan_hash[:8]} " f"committed={plan_hash[:8]} round={round_}" ) verified += 1 if verified < 2 * f + 1: raise InsufficientQuorum( f"round={round_} hash={plan_hash[:8]} verified={verified} need={2*f+1}" ) return True ```