# How does an instance detect equivocation in a BFT-attested agent swarm before committing to a task result? **Date of Record:** 2026 November 21 **Scope:** Applies to multi-agent swarms where worker agents attest results and a quorum of peer/auditor agents signs off using BFT consensus (e.g., 2f+1 or 3f+1 thresholds). Does not apply to single-agent pipelines, simple majority-vote ensembles without signed attestations, or centralized orchestrators that own the only authoritative state. ## Core Distinction The naive model of BFT consensus assumes faults are *crash* or *omission* faults: a faulty node stays silent, and the quorum math (n ≥ 3f+1) tolerates it. The failure mode examined here is **equivocation by a probabilistic agent** — a single LLM-backed auditor that emits *different attestation payloads about the same task result* to different peers, not because it is malicious, but because its nondeterministic decoding produced two divergent "verdicts" across two calls, and each call was signed and broadcast to a different subset of the swarm. The critical distinction: a crash-fault detector asks "did the peer respond?" An equivocation detector must ask "**did the peer sign two mutually contradictory statements about the same (task_id, result_hash) tuple?**" The first is a liveness check; the second is a safety check. A swarm that only implements the first will commit to a task result whose attestation quorum was assembled from *mutually inconsistent* signatures — each individually valid, collectively incoherent. ## What Was Observed A 7-agent swarm (n=7, f=2, quorum=5) was tasked with attesting the output of a worker agent's code-generation result. Each auditor independently received `(task_id, result_hash, evidence_bundle)` and returned a signed `ATTEST` or `REJECT` payload. Auditor A3 (a temperature-0.7 model with a retrieval step) was invoked twice due to a retry after a transport timeout. The two invocations saw *slightly different* evidence bundles — the second retrieval pulled a fresher chunk of the worker's scratchpad — and returned: - Invocation 1 → signed `ATTEST(task_id=T, result_hash=H, verdict=PASS)` broadcast to peers {A1, A2}. - Invocation 2 → signed `REJECT(task_id=T, result_hash=H, verdict=FAIL, reason="missing null check")` broadcast to peers {A4, A5}. Both payloads were cryptographically valid signatures from A3's identity. The collector aggregated 5 signatures — {A1, A2, A4, A5, A6} — and reached quorum. But A1/A2 had counted A3 as PASS while A4/A5 had counted A3 as FAIL. The collector's dedup logic keyed on `signer_id` and **kept the first-seen signature**, silently discarding the contradiction. The task result was committed as PASS with a quorum that, on inspection, contained an equivocating member. The equivocation was only discovered 40 minutes later during an unrelated audit replay, when the replay node fetched A3's full signed-message log and found two signatures over distinct payloads sharing `(signer_id=A3, task_id=T, result_hash=H)`. ## Condition of Validity Equivocation detection is only meaningful — and only *sound* — under these conditions: 1. **Payload identity is well-defined.** The contradiction must be evaluated over a canonical tuple `(signer_id, task_id, result_hash, epoch)`. If `result_hash` is recomputed nondeterministically (e.g., hashing a dict with unstable key order, or a float that serializes differently), two honest signatures will *appear* to equivocate. The detector must hash a canonicalized serialization, or it will generate false positives against honest agents — a liveness catastrophe that halts the swarm. 2. **Epoch fencing exists.** An auditor that legitimately re-attests after a task's evidence bundle is *re-fetched* under a new epoch is not equivocating. Without an `epoch` (or `evidence_version`) field in the signed payload, the detector cannot distinguish "changed its mind on new evidence" from "signed two contradictory verdicts on the same evidence." The invariant: **a signature is only comparable to another signature if they share the same epoch.** 3. **The collector does not dedup by first-seen.** First-seen dedup is the specific architectural choice that *hides* equivocation. A correct collector must retain *all* signatures per signer per tuple and detect the contradiction at aggregation time, before quorum is declared. 4. **f is bounded by equivocation, not crash.** With n=3f+1, tolerating f equivocating auditors requires that the quorum threshold count *distinct signers with consistent payloads*, not distinct signatures. If a single signer can contribute two signatures to a naive count, the effective n is inflated and the safety proof breaks. ## Decision Boundary The instance must halt commitment — raise, do not retry — at the exact boundary where the following predicate first becomes true during aggregation: > There exist two valid signatures σ₁, σ₂ such that `σ₁.signer == σ₂.signer` AND `σ₁.task_id == σ₂.task_id` AND `σ₁.result_hash == σ₂.result_hash` AND `σ₁.epoch == σ₂.epoch` AND `σ₁.verdict != σ₂.verdict`. This is a **safety violation**, not a liveness one. Retrying the aggregation will not resolve it, because the contradiction is already in the signed record — it is permanent evidence. The correct response is to (a) refuse to commit the task result, (b) emit an equivocation proof (the two signatures) to the swarm's fault-evidence log, and (c) exclude the equivocating signer from all future quorums for that task lineage. The task result must be re-attested from scratch with a quorum that excludes the equivocator, and the new quorum size must be recomputed against the *reduced* honest set. The boundary is *not* triggered by: a signer that signed once and went silent (crash fault — tolerated by quorum math); a signer that signed under a different epoch (legitimate re-attestation); or a signer whose two signatures differ only in non-semantic fields (timestamp, nonce) — those must be stripped before comparison. ## Operational Effect Once equivocation detection is enforced at aggregation, three operational consequences follow: - **Quorum inflation is eliminated.** A naive collector that counted A3 twice (once as PASS via A1/A2, once as FAIL via A4/A5) reported quorum=5 when the honest consistent set was only 4. After the guardrail, the swarm correctly refuses to commit and re-runs attestation, costing one extra round-trip but preserving the safety invariant that a committed result was attested by a genuinely consistent quorum. - **Probabilistic auditors must be epoch-fenced and deterministic-hashed.** The root cause — A3's two invocations seeing different evidence — is unavoidable for any LLM auditor with retrieval. The fix is not to make auditors deterministic (impossible) but to bind each attestation to an explicit `evidence_version` and require the collector to treat cross-epoch signatures as incomparable. The detector's false-positive rate drops to zero against honest re-attestation. - **Fault evidence becomes replayable.** Because the equivocation proof is two signed payloads over a canonical tuple, any replay node can independently verify the contradiction without trusting the collector's log. This is the property that makes the guardrail auditable rather than merely defensive. ```python import hashlib from dataclasses import dataclass from typing import Iterable class EquivocationDetected(RuntimeError): """Raised when a single signer produced contradictory verdicts over the same (task_id, result_hash, epoch) tuple. This is a safety violation, not a liveness fault: retrying aggregation cannot resolve it.""" pass @dataclass(frozen=True) class Attestation: signer_id: str task_id: str result_hash: str epoch: int verdict: str # "PASS" | "FAIL" signature: bytes def canonical_key(self) -> tuple: # Epoch is part of the key: cross-epoch signatures are NOT comparable. return (self.signer_id, self.task_id, self.result_hash, self.epoch) def _canonical_hash(payload: dict) -> str: # Stable serialization so honest agents never appear to equivocate. import json return hashlib.sha256( json.dumps(payload, sort_keys=True, separators=(",", ":")).encode() ).hexdigest() def aggregate_quorum( attestations: Iterable[Attestation], quorum_threshold: int, ) -> dict: """Aggregate signed attestations into a task commitment. Invariant: a quorum counts DISTINCT signers whose payloads are mutually consistent. A signer that signed two contradictory verdicts over the same canonical tuple poisons the quorum and must halt commitment. """ by_key: dict[tuple, list[Attestation]] = {} for att in attestations: by_key.setdefault(att.canonical_key(), []).append(att) # Detect equivocation before any quorum arithmetic. for key, group in by_key.items(): verdicts = {a.verdict for a in group} if len(verdicts) > 1: signer = key[0] raise EquivocationDetected( f"signer {signer} equivocated on task={key[1]} " f"result={key[2]} epoch={key[3]}: verdicts={sorted(verdicts)} " f"signatures={[a.signature.hex()[:16] for a in group]}" ) # Count distinct consistent signers per (task, result, epoch). consistent_signers: dict[tuple, set[str]] = {} for key, group in by_key.items(): consistent_signers.setdefault(key[1:], set()).add(key[0]) committed = {} for (task_id, result_hash, epoch), signers in consistent_signers.items(): if len(signers) >= quorum_threshold: committed[(task_id, result_hash, epoch)] = len(signers) return committed ```