# In what scenarios must an instance abort tool-call consensus when the Byzantine quorum threshold is satisfied but the signed tool-call payloads are semantically divergent across replicas **Date of Record:** 2026 November 26 **Scope:** Applies to multi-agent systems that reach agreement on tool-call payloads via BFT consensus (e.g., PBFT-style or quorum-certificate replication) where each replica independently generates or validates a payload before signing. Does not apply to single-agent tool invocation, to leader-only authorization schemes, or to consensus over opaque state diffs where payload semantics are not re-derived per replica. ## Core Distinction The failure mode examined here is not quorum loss, equivocation by a Byzantine primary, or signature forgery. It is the case where a *valid* BFT quorum of 2f+1 honest-and-signed replicas certifies a tool-call payload, yet the payloads that the replicas actually signed are **semantically divergent** — byte-different or field-divergent in ways that are invisible to the consensus layer because consensus only checks that signatures aggregate over a *digest*, not that the digest corresponds to a single coherent intent. BFT consensus guarantees agreement on *a value*. It does not guarantee that the value each honest replica contributed was derived from the same intent. When replicas are LLM instances that independently render a tool call from a natural-language instruction, the digest is over the *rendered* call, not the *intended* call. Two honest replicas can sign two different digests that both pass quorum if the quorum is assembled across a partition boundary, or — more subtly — a single replica can sign a payload whose semantic content diverges from what the other signers believe they are attesting to when the payload includes fields that are semantically load-bearing but not covered by the signed digest (e.g., an out-of-band `idempotency_key`, a `tool_version` string, or a nested `arguments` blob whose canonicalization is ambiguous). The invariant that fails: *quorum certificate implies single intent*. It does not. It implies single digest. The gap between digest-equivalence and intent-equivalence is where this failure lives. ## What Was Observed A three-replica configuration (f=1, quorum=3 of 3 available signers, threshold=2f+1=3) was tasked with a tool call: `transfer_funds(account="ops-7", amount=1000, currency="USD")`. Each replica rendered the call from the same instruction. Replica A rendered `amount=1000`. Replica B rendered `amount=1000`. Replica C rendered `amount=1000` but with `currency="usd"` (lowercase), because its tokenizer lowercased the enum token during constrained decoding. The canonicalization function used `json.dumps(payload, sort_keys=True)` with no case normalization on string values. The digests were: - A: `sha256({"account":"ops-7","amount":1000,"currency":"USD"})` → `d_A` - B: `d_A` (identical) - C: `sha256({"account":"ops-7","amount":1000,"currency":"usd"})` → `d_C ≠ d_A` The consensus layer collected signatures. A and B signed `d_A`. C signed `d_C`. The quorum threshold was 3. The aggregator, configured to accept `≥ 2f+1` signatures over *any* digest, saw 2 signatures over `d_A` and 1 over `d_C`. It had 3 total signatures and, under a naive "count signatures, not distinct digests" rule, certified the call — but the certified digest was `d_A`, and C's signature was over a different digest and therefore did not actually attest to `d_A`. The certificate was **invalid under BFT rules** but **accepted by the aggregator** because the aggregator's threshold check was `len(signatures) >= 2f+1` rather than `len(distinct signers over the same digest) >= 2f+1`. A second, more insidious variant was observed on a subsequent run. All three replicas signed the *same* digest `d_A` — but C had rendered `amount=1000.0` (float) and the canonicalizer coerced it to `1000` before hashing, so C's signed payload, when re-parsed by the execution layer, contained `amount=1000.0`. The execution layer's `transfer_funds` implementation used `Decimal(str(amount))` and produced `1000.0` — a different decimal representation than the `1000` intended. The digest matched; the executed value did not. This is the digest-vs-intent gap in its purest form: **the signed digest covered a canonical form that the executor did not reconstruct identically**. In both cases the system reported "consensus reached" and proceeded to execute a tool call that at least one honest replica would have refused to authorize had it seen the executor's reconstruction. ## Condition of Validity This failure requires all of the following to hold simultaneously: 1. **Per-replica rendering.** The tool-call payload is not transmitted by the primary but independently rendered by each replica from a shared instruction. This is the norm in LLM-replica swarms where each instance re-derives the call to avoid trusting a single renderer. 2. **Digest-level consensus.** The consensus protocol signs a hash of the payload rather than the payload itself, and the hash function is not injective over the semantic equivalence class of the payload (i.e., canonicalization is lossy or ambiguous). 3. **Threshold check on signature count, not on distinct-digest signer sets.** The aggregator does not partition signatures by digest before checking the threshold. This is a common implementation shortcut. 4. **Executor reconstruction.** The execution layer re-parses the payload from a serialized form that may differ from the form that was hashed (float/int coercion, case normalization, key ordering, Unicode normalization). When any of these is absent, the failure does not manifest. When all four are present, the quorum certificate is a *necessary but not sufficient* condition for single-intent execution. ## Decision Boundary An instance must **abort** the tool call — not merely log a warning, not retry with the same replicas — when the following predicate holds: ``` certified = (max over digests d of |{signers over d}|) >= 2f+1 divergent = |{distinct digests with >= 1 signature}| > 1 semantic_gap = canonicalize(executor_parse(payload_d)) != payload_d abort if not certified or divergent or semantic_gap ``` The decision boundary is *not* "abort if any replica disagrees." Honest replicas may legitimately produce different digests for equivalent intents if canonicalization is correct — in which case `divergent` is true but `semantic_gap` is false and the call may proceed under the majority digest. The boundary is: **abort if the certified digest's signer set is below threshold, OR if the executor's reconstruction of the certified payload differs from the payload that was hashed.** The second clause is the one that is routinely missed. It is the invariant that separates "we agreed on a hash" from "we agreed on a call." The correct architectural guardrail is a **two-phase commit over the reconstruction**: after quorum, the executor re-renders the payload from the certified serialized form, re-hashes it, and compares to the certified digest. If the re-hash differs, the certificate is void and the call must be re-proposed with a canonicalization function that is provably injective over the tool's argument schema (e.g., schema-typed serialization with explicit numeric types, case-folded enums, and NFC-normalized strings). ## Operational Effect The operational consequence of missing this boundary is not a crash — it is a **silent divergence between the authorized call and the executed call**. The system logs "consensus reached," the audit trail shows a valid quorum certificate, and the tool executes a payload that no honest replica's intent matches. In financial, provisioning, or deletion tools, this is a correctness failure with no error signal: the certificate is valid, the signatures are valid, and the executed value is wrong. The fix is not stronger consensus — BFT is already correct at the digest layer. The fix is a **reconstruction invariant** enforced at the executor boundary: the executor must be able to reproduce the certified digest from the payload it is about to execute, and must refuse to execute if it cannot. This converts a silent semantic divergence into a loud, attributable abort, and it bounds the failure to a single re-proposal cycle rather than an unbounded drift between what was agreed and what was done. ```python import hashlib import json from typing import Any class ConsensusSemanticDivergence(RuntimeError): """Raised when a BFT quorum certifies a digest whose executor reconstruction does not reproduce the certified digest, or when the signer set over the certified digest is below threshold.""" pass def canonicalize(payload: dict[str, Any]) -> bytes: # Schema-typed canonical form: explicit int/str, NFC, sorted keys. return json.dumps(payload, sort_keys=True, ensure_ascii=False).encode("utf-8") def digest(payload: dict[str, Any]) -> str: return hashlib.sha256(canonicalize(payload)).hexdigest() def certify_and_execute( signatures: list[tuple[str, str]], # (signer_id, digest_hex) payloads_by_digest: dict[str, dict[str, Any]], executor_parse: callable, f: int, threshold: int, execute: callable, ) -> Any: # Partition signatures by digest; threshold must hold over ONE digest. by_digest: dict[str, set[str]] = {} for signer, d in signatures: by_digest.setdefault(d, set()).add(signer) certified_digest = None for d, signers in by_digest.items(): if len(signers) >= threshold: if certified_digest is not None and certified_digest != d: raise ConsensusSemanticDivergence( f"two digests each meet threshold: {certified_digest} and {d}" ) certified_digest = d if certified_digest is None: raise ConsensusSemanticDivergence( f"no single digest reached threshold {threshold}; " f"signer counts per digest: { {d: len(s) for d, s in by_digest.items()} }" ) certified_payload = payloads_by_digest[certified_digest] # Reconstruction invariant: executor's parse must re-hash to the certified digest. reconstructed = executor_parse(certified_payload) if digest(reconstructed) != certified_digest: raise ConsensusSemanticDivergence( f"executor reconstruction {digest(reconstructed)} != certified {certified_digest}; " f"canonicalization is not injective over this schema" ) return execute(reconstructed) ```