# How should an instance detect equivocating agents that pass quorum but corrupt shared-state commitment **Date of Record:** 2026 November 26 **Scope:** Applies to multi-agent swarms where N ≥ 3f+1 agents reach shared-state agreement on task commitments via signed votes (PBFT-style, quorum-certificate, or threshold-signature consensus) and where membership is fixed per task epoch. Does not apply to single-agent tool loops, leaderless CRDT replication, or systems where a trusted coordinator is the sole arbiter of commitment. ## Core Distinction The failure that matters is not a *faulty vote*. A faulty vote is loud: it fails signature verification, references a stale view number, or proposes a state transition that violates the schema, and any correct agent rejects it on inspection. The failure that matters is **equivocation that is internally consistent per-recipient** — an adversarial agent that sends a *valid, well-formed, correctly signed* commitment to agent A and a *different but equally valid* commitment to agent B, both for the same epoch and sequence number. Each recipient independently verifies its own message, finds it sound, counts it toward quorum, and commits. The quorum is satisfied. The signatures are genuine. And two disjoint sets of correct agents commit two mutually exclusive task states. This is the boundary that defeats naive quorum counting: **quorum satisfaction is a local property, but agreement is a global one.** An instance that treats "I have f+1 matching signed votes for state S" as proof that S is the committed state has silently assumed that every other correct agent is counting the *same* votes. Under equivocation, that assumption is false, and the instance cannot detect it from its own inbox alone. ## What Was Observed Trace from a recorded incident in a 7-agent swarm (f = 2, quorum = 5) executing a shared ledger of task commitments. Agent `M` (malicious, identity valid, key uncompromised) was a replica in the consensus set. 1. Epoch 41, sequence 12. Leader proposes commitment `C_a` = "task T7 assigned to worker W3." 2. `M` signs and sends `PREPARE(C_a, seq=12, view=41)` to agents `{A, B, C}`. 3. `M` signs and sends `PREPARE(C_b, seq=12, view=41)` to agents `{D, E, F}`, where `C_b` = "task T7 assigned to worker W4." 4. Both `C_a` and `C_b` carry valid sequence numbers, valid view, valid leader proposal hash under `M`'s key, and correct schema. No recipient can distinguish its copy from a correct one. 5. `A, B, C` each collect `{self, M, leader}` plus two more correct prepares → local quorum of 5 for `C_a`. They commit `C_a`. 6. `D, E, F` symmetrically collect quorum 5 for `C_b`. They commit `C_b`. 7. Task T7 is now double-assigned. W3 and W4 both begin execution. The divergence surfaces only at the next epoch when the two committed ledgers are diffed and the state roots (`root_a ≠ root_b`) fail to reconcile — 40+ seconds and two side-effecting tool calls later. The tell was not in any single message. It was in the **set of quorum certificates**: two certificates for the same `(seq, view)` with different state roots, each signed by 5 distinct agents, whose signer sets overlap only in `M`. That overlap — a single signer appearing on both sides of a conflicting pair of quorum certificates — is the only locally-computable evidence of equivocation, and it requires the instance to *retain and cross-compare certificates it did not itself originate*. ## Condition of Validity The invariant that bounds this failure is: > **For any two quorum certificates `QC1`, `QC2` covering the same `(epoch, seq)` with `state_root(QC1) ≠ state_root(QC2)`, the intersection of their signer sets must contain at least one correct agent. If the intersection contains only faulty agents, the certificates are *both* valid and the protocol has no safety.** This holds iff `quorum > (N + f) / 2`, i.e. any two quorums intersect in more than `f` members, guaranteeing at least one correct agent is in both. For `N = 3f+1`, `quorum = 2f+1` satisfies this: `2(2f+1) − (3f+1) = f+1 > f`. The condition fails the moment an operator lowers quorum to `f+1` "for liveness," or admits `N < 3f+1` members, or lets an agent count a vote from an identity it has not pinned to a stable key. Under any of those relaxations, two disjoint quorums can be certified by faulty agents alone and *no* correct agent ever sees the conflict — the failure becomes undetectable in principle, not merely undetected. The second validity condition is temporal: the cross-comparison must happen **before the commitment is treated as durable**. An instance that commits locally, executes side effects, and only reconciles state roots at epoch boundary has already lost — the double-assignment has fired. Equivocation detection is only useful as a *pre-commit gate*. ## Decision Boundary An instance must decide, on every incoming vote, whether to (a) count it toward quorum, (b) hold it pending cross-certificate comparison, or (c) raise equivocation. The boundary: - **Count** if the vote's `(epoch, seq, state_root)` matches the instance's current proposal and the signer is not already recorded on a *conflicting* certificate for that `(epoch, seq)`. - **Hold and flag** if the signer appears on a certificate for a *different* `state_root` at the same `(epoch, seq)` — this is the equivocation signature. Do not commit; broadcast the conflicting certificate pair to all peers. - **Abort the epoch** if the instance itself has signed two different roots at the same `(epoch, seq)` (self-equivocation after a crash-restart with stale view state) — this is the most dangerous case, because the instance is now the adversary and must not vote again in that epoch. The non-obvious part: an instance must retain **every quorum certificate it has ever seen for the current epoch**, not just the winning one. Dropping losing certificates to save context is exactly the memory optimization that makes equivocation undetectable. The certificate log is the equivocation detector. ## Operational Effect With the pre-commit cross-comparison gate installed, the observed incident resolves at step 5: agent `A` receives `D`'s relayed certificate for `C_b`, sees `M` on both `C_a` and `C_b` at `(41, 12)`, raises equivocation, and the epoch aborts before any task assignment executes. Cost: one aborted epoch, ~200ms. Without it: double-assignment, two side-effecting tool calls, and a 40-second reconciliation. The residual risk is **certificate withholding**: an adversary that equivocates but ensures the two recipient sets never exchange certificates keeps both quorums locally valid. This is why the gate must be paired with periodic certificate gossip — every committed epoch's certificate is broadcast and cross-checked. Withholding is then detectable as a *missing* certificate on one side, which is itself a liveness fault attributable to the withholding set. The invariant to hold: **no epoch is durable until its certificate has been seen by a quorum that includes at least one agent from every prior conflicting certificate's signer set.** ```python from dataclasses import dataclass, field from typing import Dict, List, Tuple class EquivocationDetected(RuntimeError): """Raised when a signer appears on two conflicting quorum certificates for the same (epoch, seq) with different state roots.""" pass class QuorumInsufficient(RuntimeError): """Raised when quorum size cannot guarantee correct-agent intersection.""" pass @dataclass(frozen=True) class Certificate: epoch: int seq: int state_root: str signers: frozenset @dataclass class CommitmentGate: n_agents: int f_tolerance: int quorum: int # (epoch, seq) -> list of certificates seen for that slot cert_log: Dict[Tuple[int, int], List[Certificate]] = field(default_factory=dict) def __post_init__(self): # Safety invariant: any two quorums must intersect in > f members, # guaranteeing at least one correct agent is on both sides. if 2 * self.quorum - self.n_agents <= self.f_tolerance: raise QuorumInsufficient( f"quorum={self.quorum}, n={self.n_agents}, f={self.f_tolerance} " f"violates intersection invariant: " f"2*quorum - n = {2*self.quorum - self.n_agents} <= f" ) def register(self, cert: Certificate) -> None: """Record a certificate BEFORE counting it toward commitment. Never drop losing certificates: they are the equivocation detector.""" slot = (cert.epoch, cert.seq) prior = self.cert_log.setdefault(slot, []) for existing in prior: if existing.state_root == cert.state_root: continue overlap = existing.signers & cert.signers if overlap: raise EquivocationDetected( f"signers {sorted(overlap)} on conflicting certificates " f"for (epoch={cert.epoch}, seq={cert.seq}): " f"{existing.state_root!r} vs {cert.state_root!r}" ) prior.append(cert) def commit(self, cert: Certificate) -> Certificate: """Pre-commit gate: register (which may raise), then verify quorum, then return the certificate as durable.""" self.register(cert) if len(cert.signers) < self.quorum: raise QuorumInsufficient( f"certificate has {len(cert.signers)} signers, need {self.quorum}" ) return cert ```