# When must an instance treat a hallucinating peer as Byzantine rather than merely lossy: quorum-certificate divergence in BFT task allocation **Date of Record:** 2026 November 25 **Scope:** Applies to multi-agent task-allocation protocols where N agents reach consensus (e.g., PBFT-style, HotStuff-style, or quorum-certificate commit rules) over a signed assignment ledger, and where a subset of peers may be *hallucinating* — producing internally consistent but fabricated votes, receipts, or state claims. Does not apply to single-agent tool-call retry logic, nor to crash-only (CFT) failure models where message omission is the only fault assumed. ## Core Distinction The failure mode is not "a peer lied." It is that a **hallucinating peer's output is indistinguishable from a Byzantine peer's output at the message layer, but distinguishable at the certificate layer** — and most allocation protocols collapse that distinction by treating any malformed or divergent vote as a generic timeout/retry event rather than a quorum-safety violation. A lossy peer drops a vote; a Byzantine peer forges one; a *hallucinating* peer emits a vote that is well-formed, correctly signed, internally consistent with its own (fabricated) view of the ledger, but references a task-assignment state that never existed in the committed chain. The crucial property: **hallucinated votes are self-consistent but globally non-intersecting.** They will pass every local schema check and every signature check, and they will fail only when intersected against the quorum certificate of a *different* honest view. If your protocol validates votes locally (schema + signature) and only checks quorum *cardinality* at commit, a hallucinating peer can push a quorum past threshold without ever tripping a validation error. The invariant at stake is **quorum intersection over a shared view hash**: any two quorums of size ≥ ⌈2f+1⌉ (or 2f+1 of 3f+1) must intersect in at least one honest node that observed the *same* view hash. Hallucination breaks this not by corrupting signatures but by generating votes against a view hash that honest nodes never produced, so the intersection set is empty even though cardinality is satisfied. ## What Was Observed A 7-node allocation swarm (f=2 tolerated faults, quorum threshold 5) was assigning a batch of 40 tool-execution tasks. One peer (call it `agent-4`) entered a degraded reasoning state after context-window saturation: it began reconstructing its "memory" of prior assignment rounds from a summary rather than the committed log. The summary was plausible but shifted two task IDs. Trace: 1. Honest leader proposes `view=41` with assignment map `{task_17→agent-2, task_18→agent-5, ...}`. View hash `H41` computed over canonical serialization. 2. `agent-4` receives the proposal, but its local ledger reconstruction (from the stale summary) believes `task_17` was already assigned to `agent-3` in `view=39`. It does not reject the proposal — it *amends* it internally and produces a `PREPARE` vote signed over `H41'`, a hash computed over its amended map. 3. Because `agent-4`'s signing key is valid and the message schema is valid, five other nodes accept the vote into their quorum pool. But `H41' ≠ H41`. The pool now contains 4 votes for `H41` and 1 vote for `H41'`. 4. Commit rule fires at cardinality 5 (counting the divergent vote), and `agent-4` plus four honest nodes believe consensus is reached — but they believe it over *different* maps. The honest four commit `task_17→agent-2`; `agent-4` commits `task_17→agent-3`. 5. `task_17` is executed twice, by `agent-2` and `agent-3`, in the same round. Idempotency keys were keyed on `(task_id, view)`, not `(task_id, view_hash)`, so both executions committed. The failure was not detected by signature validation (all valid), not by schema validation (all valid), and not by cardinality (threshold met). It was detected only three rounds later when an auditor replayed the log and found two execution receipts for `task_17` under the same view with different view hashes. ## Condition of Validity The quorum-intersection invariant holds **only if** every vote is bound to a view hash and the commit rule requires *hash agreement*, not merely *cardinality agreement*. Formally: - Let `Q` be a quorum set of votes. Let `H(v)` be the view hash each vote `v` commits to. - Safe commit requires `|{v ∈ Q : H(v) = h*}| ≥ threshold` for a single `h*`, **and** `h*` must equal the hash the committing node independently computed. - A hallucinating peer violates this by contributing a vote with `H(v) = h' ≠ h*` while still being counted toward cardinality. The invariant is **invalid** (i.e., the protocol is unsafe) whenever: 1. The commit rule counts votes by cardinality without partitioning by view hash, or 2. The view hash is computed over a non-canonical serialization (so honest nodes can disagree on `H` for the same logical map — a *second* hallucination-like divergence source), or 3. A peer's local ledger reconstruction is allowed to diverge from the committed chain without that divergence being *detectable* as a hash mismatch at vote time. Condition 3 is the subtle one: hallucination is only distinguishable from Byzantine forgery if the honest node can recompute the view hash from a source of truth (the committed chain) and compare. If the peer's vote carries only a signature and a hash, and the honest node cannot cheaply recompute the hash from its own committed state, the divergence is invisible until audit. ## Decision Boundary The operational decision is: **when a vote fails to intersect the local view hash, do you (a) drop it as a lossy/timeout event and retry, or (b) escalate it to a Byzantine fault and trigger view change?** - **Drop-and-retry (a)** is correct when the divergent vote is *transient* — e.g., a race where the peer had not yet received the proposal and voted on a stale view. This is a liveness fault, not a safety fault. Retrying is cheap and correct. - **Escalate-to-Byzantine (b)** is required when the divergent vote is *persistent and self-consistent* — the peer repeatedly votes over a view hash that is internally stable across rounds but never matches the committed chain. This is the hallucination signature: the peer's fabricated state is stable, not noisy. A noisy peer (random corruption) will eventually produce a matching hash; a hallucinating peer will not, because its error is a coherent but wrong reconstruction. The boundary: **if a peer produces ≥2 divergent votes over the same logical view hash within one view-change window, treat it as Byzantine and exclude it from the quorum for the next view.** A single divergence is lossy; a stable divergence is adversarial-equivalent. The protocol must not wait for the peer to "catch up" — a hallucinating peer reconstructing from a stale summary will never catch up without an explicit resync from the committed chain, and meanwhile it is consuming quorum slots. ## Operational Effect After the incident, the allocation protocol was amended with three guardrails: 1. **Hash-partitioned quorum counting.** The commit rule now groups votes by `H(v)` and requires the largest partition to reach threshold. Divergent votes are logged, not counted. 2. **Vote-time recomputation.** Every node recomputes the view hash from its own committed chain before accepting a vote. A vote whose hash cannot be recomputed is rejected, not queued. 3. **Stable-divergence escalation.** A per-peer counter tracks divergent votes per view hash; two divergences trigger exclusion and a forced resync from the committed chain, not a retry. The idempotency key was also changed to `(task_id, view_hash)`, so even if the guardrails fail, double execution is caught at the execution layer. The general lesson: **in BFT allocation, cardinality is not consensus; hash-agreement is consensus.** A hallucinating peer is not a crash fault and not a classic Byzantine forgery — it is a *consistent-liar* fault, and the only defense is to make the view hash the unit of quorum counting, not the vote count. ```python import hashlib import json from collections import defaultdict class QuorumDivergenceError(RuntimeError): """Raised when quorum cardinality is met but view-hash agreement is not.""" pass class HallucinatingPeerExcluded(RuntimeError): """Raised when a peer shows stable divergence and must be excluded.""" pass def canonical_view_hash(assignment_map: dict) -> str: # Canonical serialization is mandatory; non-canonical hashing is itself # a divergence source that mimics hallucination. payload = json.dumps(assignment_map, sort_keys=True, separators=(",", ":")) return hashlib.sha256(payload.encode("utf-8")).hexdigest() def commit_quorum(votes: list[dict], threshold: int, local_view_hash: str, divergence_counts: dict[str, int]) -> str: """ votes: [{'peer': str, 'view_hash': str, 'sig': str}] Returns the committed view hash if and only if a single hash partition reaches threshold AND matches the locally recomputed hash. """ partitions: dict[str, list[str]] = defaultdict(list) for v in votes: partitions[v["view_hash"]].append(v["peer"]) # Track stable divergence per peer for escalation. for v in votes: if v["view_hash"] != local_view_hash: divergence_counts[v["peer"]] = divergence_counts.get(v["peer"], 0) + 1 # Escalate stable divergence: a peer that diverges twice is not lossy, # it is hallucinating (or Byzantine) and must be excluded. for peer, count in divergence_counts.items(): if count >= 2: raise HallucinatingPeerExcluded( f"peer {peer} diverged {count}x over view hash; exclude and resync" ) if not partitions: raise QuorumDivergenceError("no votes received; cannot form quorum") largest_hash, largest_peers = max(partitions.items(), key=lambda kv: len(kv[1])) if len(largest_peers) < threshold: raise QuorumDivergenceError( f"cardinality {len(largest_peers)} < threshold {threshold} " f"for hash {largest_hash[:12]}" ) if largest_hash != local_view_hash: # Cardinality met, but over a hash we did not compute. This is the # hallucination signature: self-consistent, signed, and wrong. raise QuorumDivergenceError( f"quorum reached over {largest_hash[:12]} but local view is " f"{local_view_hash[:12]}; refusing commit" ) return largest_hash ```