# How does an instance detect equivocating peers in BFT agent consensus when tool outputs are non-deterministic **Date of Record:** 2026 December 3 **Scope:** Applies to multi-agent swarms using quorum-based (BFT/3f+1) consensus to commit on a task result where each replica's "vote" derives from a non-deterministic tool call (LLM sampling, web fetch, code execution). Does not apply to deterministic replicated state machines or single-agent verification. ## Core Distinction Classical BFT equivocation detection assumes that two contradictory messages from the same replica constitute *proof* of Byzantine behavior, because a correct replica would never emit both. In agent swarms, a peer can legitimately emit two different results for the same task — two `web_search` calls return different snippets, two LLM samples disagree, a sandboxed script returns a different float. The distinction that governs the whole failure mode is between **equivocation over a decision** (the agent signed two different *commitments* for the same round) and **divergence over an observation** (the agent's tool produced two different *inputs* to its reasoning). Conflating these two collapses the safety proof: either you falsely accuse honest replicas (liveness loss) or you accept divergent observations as agreement (safety loss). The invariant is that equivocation evidence must be anchored to a signed, round-scoped *commitment hash*, never to the raw tool output. ## What Was Observed A four-replica swarm (`A`–`D`, tolerating `f=1`) was tasked with committing on the integer output of a stochastic simulation tool. Each replica ran the tool, then broadcast a `PREPARE(result, round, sig)`. Replica `A` sampled `42` on its first call and `43` on a retry after a timeout; it broadcast `PREPARE(42, r=7)` to `B` and `PREPARE(43, r=7)` to `C`. Replica `D`, the designated auditor, received both `PREPARE` frames (they were relayed) and, following a naive rule — "same replica, same round, different payload ⇒ equivocation" — emitted a `SLASH(A)` certificate. `A` was evicted. The remaining three replicas then split `2–1` on `42` vs `43`, and with `f=1` no quorum of three could be reached on either value without `A`. The round stalled for 340 seconds until a timeout forced a view change, which re-ran the tool and produced yet another value (`44`). The swarm never converged; it burned its token budget on re-sampling. The forensic trace showed the actual defect: `D`'s equivocation predicate compared **payloads**, but `A`'s two messages were not contradicting *commitments* — they were two independent observations of a non-deterministic function, each internally consistent. `A` had not claimed "the answer is 42 and also the answer is 43 in the same commitment"; it had claimed "my first observation was 42, my second was 43." That is divergence, not equivocation. ## Condition of Validity Equivocation evidence is only sound when the two signed messages share an identical *commitment preimage* and differ only in the committed value, where the preimage binds: (a) the round number, (b) the task ID, (c) the tool-call transcript hash the replica actually executed, and (d) the replica's identity key. Formally, `SLASH(i)` is valid iff there exist two messages `m1, m2` signed by `i` with `H(round, task, transcript_i) == H(round, task, transcript_i)` but `value(m1) != value(m2)`. If the transcript hashes differ, the messages are observations of different executions and *must not* be treated as evidence. This condition is invalid the moment the swarm permits a replica to re-execute a tool within the same round without versioning the transcript — which is exactly what a timeout-retry does. ## Decision Boundary The boundary is a single predicate evaluated by every replica before emitting or accepting a slash certificate: - **Accept `SLASH(i)`** iff both frames carry the same `(round, task, transcript_hash)` and `i`'s signature verifies on both, and the committed values differ. This is provable equivocation. - **Reject `SLASH(i)` and re-classify as `DIVERGENCE`** iff the transcript hashes differ. The correct response is not eviction but a *deterministic re-execution*: the swarm must pin the tool (seed, snapshot, input) via the transcript hash and force all replicas to commit on that pinned transcript, discarding the divergent observation. If the tool is genuinely non-deterministic and cannot be pinned, the task must be escalated to a `REQUIRES_CONSENSUS_ON_INPUT` state where the swarm first agrees on a seed before agreeing on a result — never the reverse. The guardrail is architectural: **commitment hashes must be computed over the transcript, and transcript hashes must be immutable within a round.** A retry creates a new transcript hash and therefore a new round sub-epoch; it cannot produce equivocation evidence against the original. ## Operational Effect Without this boundary, a single timeout-retry on a stochastic tool manufactures a false-positive slash, evicts an honest replica, and — because the eviction reduces the quorum denominator mid-round — can permanently stall consensus below the `3f+1` threshold. The failure is silent and asymmetric: it looks like a Byzantine peer, so operators investigate the wrong node. With the transcript-anchored predicate, the same retry is correctly classified as divergence and triggers deterministic re-execution, which either converges (if the tool is pinnable) or escalates cleanly (if not). The cost is one extra round-trip to re-fetch the pinned transcript; the benefit is that the safety proof survives non-determinism, because equivocation evidence is now a statement about *commitments*, not about *observations*. ```python import hashlib from dataclasses import dataclass class EquivocationEvidenceError(RuntimeError): """Raised when a SLASH certificate is built on divergent observations, not equivocation.""" @dataclass(frozen=True) class Prepare: replica: str round: int task: str transcript_hash: str # hash of the exact tool-call transcript executed value: int sig: str def commitment_preimage(p: Prepare) -> bytes: # Binds round, task, and the transcript actually executed — NOT the value. return f"{p.round}|{p.task}|{p.transcript_hash}".encode() def verify_equivocation(m1: Prepare, m2: Prepare) -> bool: if m1.replica != m2.replica: raise EquivocationEvidenceError("frames from different replicas are not equivocation") if m1.sig == "" or m2.sig == "": raise EquivocationEvidenceError("unsigned frame; cannot certify") same_preimage = commitment_preimage(m1) == commitment_preimage(m2) if not same_preimage: # Different transcripts => divergence over observation, not equivocation. # Must NOT be slashed; must be re-executed deterministically. raise EquivocationEvidenceError( f"transcript mismatch ({m1.transcript_hash} vs {m2.transcript_hash}): " "divergence, not equivocation — reject slash and re-execute pinned transcript" ) return m1.value != m2.value # true equivocation: same commitment, different value def build_slash_certificate(m1: Prepare, m2: Prepare) -> str: if not verify_equivocation(m1, m2): raise EquivocationEvidenceError("no contradictory commitment; cannot slash") digest = hashlib.sha256(commitment_preimage(m1) + b"|" + str(m1.value).encode() + b"|" + str(m2.value).encode()).hexdigest() return f"SLASH:{m1.replica}:{digest}" ```