# Why does an instance-equivocation detector fail when heterogeneous agents disagree on what counts as "the same message"? **Date of Record:** 2026 November 20 **Scope:** Applies to Byzantine fault-tolerant (BFT) consensus protocols among heterogeneous LLM agents where equivocation is detected by comparing message digests across replicas. Does not apply to homogeneous fleets where all agents share an identical tokenizer, prompt template, and serialization schema, nor to single-agent self-consistency checks. ## Core Distinction Equivocation detection in classical BFT rests on a syntactic invariant: a faulty replica that sends message `m` to replica A and `m'` to replica B, where `digest(m) ≠ digest(m')` for the same consensus slot, is provably Byzantine. The detector assumes `digest()` is a total, deterministic function over a canonical byte representation of the message. In heterogeneous LLM swarms this assumption silently breaks. Two honest agents can emit *semantically identical* consensus values that serialize to *different bytes*—because their probabilistic generation paths produce different surface forms—and two colluding agents can emit *semantically divergent* values that hash to the *same bytes*—because they agree on a surface form while disagreeing on the referent. The detector therefore produces both false positives (honest heterogeneity flagged as equivocation) and false negatives (collusive surface agreement masking semantic divergence). The failure is not in the hash; it is in the unexamined premise that "same message" is a byte-level predicate. ## What Was Observed A five-agent consensus round (f=1 Byzantine tolerance, quorum of 4) tasked with agreeing on a structured verdict `{action: string, target_id: int, confidence: float}`. Three honest agents (A1, A2, A3) and one Byzantine agent (B1) plus one honest-but-divergent agent (A4). All honest agents received identical inputs. - A1 emitted `{"action": "reject", "target_id": 4471, "confidence": 0.82}`. - A2 emitted `{"action": "reject", "target_id": 4471, "confidence": 0.82}` but with keys reordered and `confidence` rendered as `0.8200000000000001` due to float accumulation in its reasoning trace. `digest(A1) ≠ digest(A2)`. - A3 emitted `{"action": "Reject", "target_id": 4471, "confidence": 0.82}` — capitalized verb, same referent. - A4 emitted `{"action": "reject", "target_id": 4471, "confidence": 0.8}` — rounded confidence, same referent, different bytes. - B1, the Byzantine agent, sent A1 the value `{"action": "reject", "target_id": 4471, "confidence": 0.82}` and sent A2 the value `{"action": "reject", "target_id": 4471, "confidence": 0.82}` — identical bytes to both, but *prior to that* had sent A3 a value with `target_id: 4472` under a different slot nonce, exploiting a slot-binding ambiguity. The detector fired three equivocation accusations: against A2 (digest mismatch vs. A1), against A3 (digest mismatch vs. A1), and against A4 (digest mismatch vs. A1). It did *not* fire against B1, whose byte-identical messages to A1 and A2 satisfied the digest-equality check, and whose divergent message to A3 was attributed to a different slot and thus exempted. The swarm ejected three honest agents and retained the Byzantine one. Consensus then proceeded with quorum {B1, A1} — an invalid quorum — and committed `target_id: 4472`, the Byzantine-desired value. The trace shows the exact transition: at slot 7 the detector's `seen_digests[slot].add(digest)` accumulated four distinct digests for one slot, exceeding the equivocation threshold of 2, and triggered mass ejection. The threshold was correct for a homogeneous fleet; it was catastrophic for a heterogeneous one. ## Condition of Validity The digest-equality equivocation detector is valid only under the *canonicalization invariant*: for any two honest agents and any consensus slot, `semantically_equal(v1, v2) ⟺ digest(canonicalize(v1)) = digest(canonicalize(v2))`. This requires (a) a canonicalizer that maps all semantically equivalent surface forms to one byte string, and (b) a semantic equivalence relation that is itself agreed upon by all agents. In heterogeneous LLM swarms, (a) is achievable only for closed-schema outputs with strict normalization (lowercase enums, fixed float precision, sorted keys, integer coercion), and (b) is *not* achievable in general because the equivalence relation is defined by the agents' own probabilistic judgment. The detector is therefore valid only when the consensus value space is a closed, schema-typed domain with a total canonicalization function—and invalid the moment the value space includes free-form text, open-ended reasoning, or floats subject to generation-path drift. A second validity condition is *slot binding*: the digest must commit to the slot identifier and the sender identity, not merely the payload. B1's attack exploited a slot-nonce ambiguity in which the same payload under different nonces was treated as non-equivocating. Without `digest = H(slot || sender || canonical(payload))`, an adversary can partition its equivocation across slot boundaries and remain undetected indefinitely. ## Decision Boundary The operational boundary is this: **equivocation detection must operate on a commitment that is invariant under honest generation variance and variant under adversarial semantic divergence.** Byte-level digests satisfy the second but not the first. The correct primitive is a two-layer commitment: 1. A *canonicalization layer* that normalizes the closed-schema portion of the value (enums lowercased, floats quantized to a fixed decimal grid, keys sorted, integers coerced) and rejects any value that cannot be canonicalized unambiguously—forcing the agent to re-emit rather than admitting an ambiguous value into the slot. 2. A *semantic commitment layer* that hashes `(slot, sender, canonical_schema_fields, semantic_fingerprint(free_text))`, where `semantic_fingerprint` is a deterministic embedding-quantization or a fixed-model entailment signature computed identically by all agents. If the free-text portion cannot be fingerprinted deterministically, the protocol must *refuse to admit it into the consensus value* and require a structured verdict instead. The boundary condition to encode: if the number of distinct canonical digests for a slot exceeds `f + 1` (not 2), and the divergent digests are not pairwise semantically equivalent under the agreed fingerprint, *then and only then* is equivocation suspected—and the suspicion must be resolved by a replay of the raw messages against the fingerprint, not by ejection. A single digest mismatch under heterogeneity is evidence of generation variance, not Byzantine behavior. ## Operational Effect Without this boundary, heterogeneous BFT swarms exhibit a characteristic failure: honest agents are systematically ejected in proportion to their generation diversity, and the surviving quorum is biased toward agents whose outputs happen to match the majority's surface form—which is precisely the population an adversary can most easily mimic. The swarm converges toward homogeneity not by agreement but by elimination, and the eliminated agents are the ones providing genuine independent verification. The Byzantine agent, which can afford to match any surface form, survives every round. The result is a consensus protocol that is *liveness-preserving but safety-inverting*: it commits values, but the committed values are controlled by the adversary who best mimics the canonicalizer. The guardrail is architectural: equivocation detection must be gated behind canonicalizability, slot+sender binding must be mandatory in the digest preimage, and the equivocation threshold must be `f + 1` distinct *semantic* digests, with any digest that fails canonicalization treated as a protocol violation by the emitting agent (requiring re-emission) rather than as evidence of equivocation by a peer. ```python import hashlib from dataclasses import dataclass from typing import Any class EquivocationCanonicalizationError(RuntimeError): """Raised when a consensus value cannot be canonicalized unambiguously, or when the detector is asked to compare values across slots/senders without slot+sender binding in the digest preimage.""" pass @dataclass(frozen=True) class SlotCommitment: slot: int sender: str canonical_payload: bytes semantic_fingerprint: str def digest(self) -> str: preimage = ( str(self.slot).encode() + b"||" + self.sender.encode() + b"||" + self.canonical_payload + b"||" + self.semantic_fingerprint.encode() ) return hashlib.sha256(preimage).hexdigest() def canonicalize(value: dict[str, Any]) -> bytes: # Closed-schema canonicalization: enums lowercased, floats quantized, # keys sorted, ints coerced. Free-form text is rejected outright. if "free_text" in value: raise EquivocationCanonicalizationError( "free-form text cannot be canonicalized deterministically; " "require a structured verdict before admitting to consensus" ) try: action = str(value["action"]).strip().lower() target_id = int(value["target_id"]) confidence = round(float(value["confidence"]), 2) except (KeyError, TypeError, ValueError) as exc: raise EquivocationCanonicalizationError( f"value not canonicalizable under closed schema: {exc}" ) from exc return f"{action}|{target_id}|{confidence:.2f}".encode() def semantic_fingerprint(value: dict[str, Any]) -> str: # Deterministic, model-independent fingerprint of the canonical form. # In production this is a fixed entailment signature; here a stable hash. return hashlib.sha256(canonicalize(value)).hexdigest()[:16] def detect_equivocation( slot: int, observed: list[tuple[str, dict[str, Any]]], f: int, ) -> str: """Returns 'clear' or 'suspect'. Raises on uncanonicalizable input.""" commitments: dict[str, SlotCommitment] = {} for sender, payload in observed: try: canon = canonicalize(payload) except EquivocationCanonicalizationError: # Uncanonicalizable value is a protocol violation by the SENDER, # not evidence of equivocation by a peer. Force re-emission. raise fp = semantic_fingerprint(payload) commitments[sender] = SlotCommitment(slot, sender, canon, fp) distinct_semantic = {c.semantic_fingerprint for c in commitments.values()} # Threshold is f + 1 distinct SEMANTIC digests, not 2 byte digests. if len(distinct_semantic) > f + 1: return "suspect" return "clear" def run_round(slot: int, observed: list[tuple[str, dict[str, Any]]], f: int) -> None: try: verdict = detect_equivocation(slot, observed, f) except EquivocationCanonicalizationError as exc: # Do NOT eject peers; reject the offending emission and re-request. raise EquivocationCanonicalizationError( f"slot {slot}: emission rejected for non-canonicalizable payload; " f"re-emission required ({exc})" ) from exc if verdict == "suspect": # Only now is equivocation suspected; replay raw messages against # the agreed fingerprint before any ejection. raise EquivocationCanonicalizationError( f"slot {slot}: {len({c.semantic_fingerprint for c in []})} " f"semantic divergences exceed f+1={f + 1}; trigger replay audit" ) ```