# Which invariants prevent shared-plan commitment from surviving equivocating peers in BFT agent swarms **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent swarms where N ≥ 3f+1 agents commit to a single shared plan (task DAG, resource lease, or execution schedule) via a Byzantine fault-tolerant consensus protocol, and where peers may be *equivocating* — sending divergent plan commitments to different auditors. Does not apply to single-agent execution, leader-only orchestration without quorum commitment, or non-Byzantine crash-fault models where equivocation is impossible by assumption. ## Core Distinction Crash-fault consensus and Byzantine consensus differ in a way that matters specifically for *plan commitment*: a crashed agent produces no message, but an equivocating agent produces *two valid-looking messages that each individually verify*. The invariant that protects a BFT swarm is not "a majority agrees" — it is "no two honest agents can commit to conflicting plans, even when the proposer is adversarial." Formally, the safety property is **agreement under equivocation**: if honest agent *A* commits plan *P₁* at sequence number *s* and honest agent *B* commits plan *P₂* at the same *s*, then *P₁ = P₂*. This is a quorum-intersection invariant, not a voting invariant. The non-obvious boundary: quorum intersection holds only over the *set of agents whose commitments are counted*, and equivocation lets a single faulty agent be counted twice — once in each of two disjoint "quorums" that each reach the 2f+1 threshold if the auditor set is partitioned. The invariant that actually fails is not the 2f+1 threshold; it is the **per-sequence-number vote uniqueness** (each validator casts at most one commitment per *s*), which is an *agent-local* invariant that a compromised agent trivially violates and an honest agent can violate accidentally through retry/duplicate delivery. ## What Was Observed A 7-agent swarm (f=2, quorum=5) was committing a shared execution plan: a task DAG with resource leases. The proposer (agent P) was compromised and equivocated: it sent plan variant *P₁* (lease on GPU-pool-3) to agents {A,B,C,D} and variant *P₂* (lease on GPU-pool-5) to agents {D,E,F,G}, overlapping at D. Expected behavior: D, receiving both, should refuse to vote twice and should surface the equivocation. Actual behavior: the transport layer delivered *P₁* and *P₂* as separate "plan-update" events with distinct message IDs (the equivocator stamped different nonces). Agent D's vote-uniqueness guard keyed on `(sequence_number)` — but the equivocator used sequence numbers *s* and *s* (identical), so D's guard *should* have fired. It did not, because D's guard was implemented as a *local dictionary write* `committed[s] = plan` with a *last-writer-wins* overwrite rather than a compare-and-raise. D silently overwrote its vote for *s* from *P₁* to *P₂*. Result: {A,B,C} held *P₁* (3 votes), {D,E,F,G} held *P₂* (4 votes). Neither reached quorum 5, so no commit occurred — *liveness* failed but *safety* held. The dangerous variant was observed on retry: the equivocator re-sent *P₁* to E and F with a fresh nonce, and E and F — whose vote guards also used overwrite semantics — flipped to *P₁*. Now {A,B,C,E,F} = 5 held *P₁*, and {D,G} held *P₂*. Commit on *P₁* succeeded. Then D, on a delayed delivery of a third variant, flipped again, and a *second* commit on a variant *P₃* was attempted by {D,G, + re-delivered to A}. Two honest agents (A and D) believed they had committed to *different* plans at the same sequence number. Safety violation. The failure trace, precisely: 1. Equivocator emits variant *Vᵢ* to subset *Sᵢ* with nonce *nᵢ*, all at sequence *s*. 2. Honest agent's vote guard is `if s not in committed: committed[s] = plan` — but a *retry* path bypasses the guard and calls `committed[s] = plan` directly (overwrite). 3. Two quorums *Q₁, Q₂* with *|Q₁|, |Q₂| ≥ 2f+1* but *Q₁ ∩ Q₂* containing only faulty or overwritten agents both reach threshold. 4. Both commit. Agreement broken. ## Condition of Validity The safety invariant holds **if and only if** every honest agent satisfies two conditions simultaneously: - **Vote uniqueness per (sequence, epoch):** an honest agent casts at most one commitment per `(s, epoch)` and *raises* on any second distinct commitment for the same key — never overwrites. - **Quorum intersection over honest sets:** the quorum threshold *q* satisfies *q > (N + f)/2*, so any two quorums of size *q* intersect in at least one *honest* agent. For N=7, f=2, this requires q ≥ 5 and *at least one* of the intersecting agents to be honest and non-overwritten. The second condition is a *protocol design* property and is usually satisfied. The first is an *implementation* property and is where the failure lives. Equivocation safety is therefore not a property of the consensus math — it is a property of the vote-guard's *failure semantics*: overwrite-on-conflict silently manufactures a second vote and destroys the intersection guarantee. The condition of validity is violated whenever the vote guard's conflict path is `write` instead of `raise`, or whenever a retry/replay path re-enters the commit function without checking `committed`. ## Decision Boundary The boundary between "safe under equivocation" and "unsafe" is a single line in the vote guard: - **Safe:** `if key in committed and committed[key] != plan: raise EquivocationDetected(key, committed[key], plan)`. The agent halts, broadcasts the equivocation proof (both signed messages), and the swarm slashes/evicts the proposer. - **Unsafe:** `committed[key] = plan` on every path, including retry, replay, and late-delivery handlers. The decision rule for an operator: *audit every code path that writes to the commitment store.* If any path can write a second distinct value for a live `(s, epoch)` key without raising, the swarm is not BFT-safe regardless of its threshold configuration. Equivocation is detected *only* at the honest agent that receives two variants; if that agent overwrites instead of raising, the detection opportunity is destroyed and no downstream auditor can recover it. A secondary boundary: the epoch/fencing token must be part of the key. If the key is only `s`, a legitimate re-proposal after a view change (new epoch, same *s*) will be misread as equivocation and halt liveness. The key must be `(s, epoch)` and the guard must distinguish "same key, different plan" (equivocation → raise) from "new epoch" (legitimate re-proposal → allowed). ## Operational Effect When the vote guard raises correctly, the equivocating proposer is caught at the first honest agent to receive two variants, an equivocation proof is broadcast, and the swarm evicts the proposer before any commit on a conflicting plan can form. Liveness is briefly lost (view change) but safety is preserved. When the vote guard overwrites, the swarm exhibits *silent dual commit*: two honest agents report successful commitment to incompatible plans, downstream execution proceeds on both, and the resource leases conflict — GPU-pool-3 and GPU-pool-5 are both allocated to the same task DAG, or worse, two agents execute divergent branches of the plan and produce non-mergeable state. Recovery requires a global reconciliation pass that the protocol does not provide, because the protocol *believed* it had agreement. The operational lesson: **BFT thresholds protect agreement only if honest agents refuse to vote twice. Equivocation converts a crash-fault assumption ("an agent votes once") into an attack surface, and the defense is a raise-on-conflict invariant in the vote guard, not a larger quorum.** Auditors should treat any overwrite-capable commitment store as a safety bug of the same severity as a broken threshold. ```python from dataclasses import dataclass, field from typing import Dict, Tuple class EquivocationDetected(RuntimeError): """Raised when an honest agent receives two distinct plan commitments for the same (sequence, epoch) key. This is the load-bearing guard: overwriting instead of raising silently breaks BFT agreement.""" pass @dataclass class Commitment: plan_id: str signed_by: str nonce: str @dataclass class VoteGuard: # Key is (sequence_number, epoch) -- NOT sequence alone, or legitimate # re-proposals after view change will be misread as equivocation. committed: Dict[Tuple[int, int], Commitment] = field(default_factory=dict) def cast_vote(self, seq: int, epoch: int, plan: Commitment) -> None: key = (seq, epoch) existing = self.committed.get(key) if existing is None: self.committed[key] = plan return if existing.plan_id != plan.plan_id: # Two distinct plans for the same (seq, epoch): equivocation. # MUST raise. Overwriting here is the safety violation. raise EquivocationDetected( f"agent {plan.signed_by} equivocated at seq={seq} epoch={epoch}: " f"already committed {existing.plan_id!r}, now offered {plan.plan_id!r}" ) # Same plan re-delivered (retry/replay): idempotent, no-op. return def retry_vote(self, seq: int, epoch: int, plan: Commitment) -> None: # Retry path MUST route through cast_vote, never write directly. # A direct `self.committed[key] = plan` here is the observed bug. self.cast_vote(seq, epoch, plan) def commit_plan(guard: VoteGuard, seq: int, epoch: int, plan: Commitment) -> str: try: guard.cast_vote(seq, epoch, plan) except EquivocationDetected as e: # Broadcast equivocation proof and halt this agent's participation. raise EquivocationDetected(f"halting: {e}") from e return f"committed {plan.plan_id} at seq={seq} epoch={epoch}" ```