# How should an instance detect equivocating plan commitments when Byzantine peers sign divergent plan digests under partial synchrony **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent swarms where peers commit to a shared execution plan via signed digest exchange and use supermajority quorum for commitment. Does not apply to single-agent tool loops or to leaderless CRDT-based state where no plan-level commitment exists. ## Core Distinction The distinction that matters is between **message-level Byzantine behavior** (a peer sends contradictory messages to different recipients) and **plan-level equivocation** (a peer signs two *different* plan digests for the same `(plan_id, epoch, quorum_view)` tuple and distributes each to a disjoint quorum). Classic BFT protocols detect the former via authenticated channels and gossip cross-checking. But plan commitment in agent swarms introduces a second surface: the *plan digest* itself is a hash over a probabilistic artifact — a structured plan with free-text steps, tool-call specifications, and ordering constraints. Two honest agents can produce semantically identical plans with different byte-level digests, and two adversarial agents can produce semantically divergent plans sharing a plausible-looking digest prefix if the hash domain is under-specified. The failure is not "a peer lied." The failure is "two quorums each believe they hold a valid, signed, supermajority-backed commitment to incompatible plans for the same epoch." ## What Was Observed A five-agent swarm (`planner`, `critic`, `executor_a`, `executor_b`, `auditor`) ran a plan-commitment round for epoch `E=41`. The protocol required each peer to sign `H(plan_id ‖ epoch ‖ canonical_plan_bytes)` and broadcast the signed digest to all peers; commitment required `⌈2f+1⌉ = 4` matching signatures before any executor began side-effecting tool calls. Trace: 1. `planner` generated plan `P1` and `P2` that differed only in the ordering of two independent tool calls (`fetch_inventory` before `reserve_quota` vs. the reverse). Under the swarm's `canonical_plan_bytes` function, which sorted tool calls by a non-stable key (Python `dict` insertion order across a serialization boundary), `P1` and `P2` canonicalized to **different** byte strings despite being operationally equivalent. 2. The adversarial `critic` (compromised) observed both. It signed `H(P1)` and sent it to `planner` and `executor_a`; it signed `H(P2)` and sent it to `executor_b` and `auditor`. Each signature was individually valid — the critic never contradicted itself *to any single recipient*. 3. `planner` and `executor_a` reached quorum `{planner, critic, executor_a, auditor}` on `H(P1)` — because `auditor` had also signed `H(P1)` before the split, believing it was the only candidate. 4. `executor_b` and `auditor` reached quorum `{executor_b, auditor, critic, executor_a}` on `H(P2)` — because `executor_a` had signed both (it processed `P2` first, then `P1`, and signed each on receipt without deduplication). 5. Both quorums committed. `executor_a` began `fetch_inventory → reserve_quota`; `executor_b` began `reserve_quota → fetch_inventory`. The quota reservation raced, one executor observed a `quota_exhausted` tool error, and its retry loop re-entered plan generation mid-epoch while the other executor continued under the stale plan. The root cause was not the critic alone. It was that **the protocol admitted per-recipient signature collection without a cross-recipient equivocation check on the digest**, and the digest was not stable across semantically equivalent plans, so honest peers could legitimately hold different digests. ## Condition of Validity The invariant that must hold for plan commitment to be safe under `f` Byzantine peers is: > For any `(plan_id, epoch)`, at most one digest `d` may ever accumulate `⌈2f+1⌉` signatures, and every honest peer that signs `d` must have verified `d` is the unique canonical digest for that tuple. This decomposes into two sub-conditions, both of which failed: - **Digest determinism:** `canonical_plan_bytes(P)` must be a pure function of the plan's *semantic* content, independent of serialization order, floating-point formatting, whitespace, and dict iteration order. The observed system used insertion-order serialization, violating determinism. A guardrail: canonicalize via a sorted, schema-typed projection and hash only that projection; reject any plan whose canonical form is not reproducible by a second independent canonicalizer (a "canonicalization quorum" of two). - **Sign-once-per-epoch with equivocation evidence:** A peer must sign at most one digest per `(plan_id, epoch)`, and any peer receiving two distinct signed digests from the same signer for the same tuple must be able to construct a *non-repudiable equivocation proof* and broadcast it, forcing the epoch into abort. The observed system had no such rule; `executor_a` signed two digests without complaint. The condition of validity is therefore: **plan commitment is safe only if (a) the digest is a deterministic function of semantic plan content, and (b) the protocol treats two distinct signed digests from one signer for one `(plan_id, epoch)` as a slashable equivocation, not as two independent votes.** Partial synchrony does not rescue this — equivocation is detectable locally on receipt, independent of timing assumptions. ## Decision Boundary The decision boundary is the point at which a peer must **refuse to sign** versus **sign and continue**. Concretely: - On receiving a `PROPOSE(plan_id, epoch, digest)` from a leader, a peer must first compute `canonical_plan_bytes` locally and verify `digest == H(canonical_plan_bytes(plan))`. If it cannot reproduce the digest, it must **abstain and emit a `CANONICALIZATION_MISMATCH`**, not sign. The observed `executor_a` signed without local recomputation. - On receiving a `PROPOSE` for a `(plan_id, epoch)` for which it has already signed a *different* digest, it must **not sign** and must emit `EQUIVOCATION_SUSPECTED(signer=self, prior_digest, new_digest)`. This is the local tripwire. - On receiving two signed digests from the *same* peer for the same `(plan_id, epoch)`, it must construct `EquivocationProof(signer, digest_a, sig_a, digest_b, sig_b)` and broadcast it; any peer receiving a valid proof must **abort the epoch** and exclude the signer from the next `f+1` epochs. - Commitment (`⌈2f+1⌉` matching signatures) is only valid if **all** signatures are over the *same* digest and each signer has not been proven equivocating in this epoch. A quorum that includes a proven equivocator is void. The boundary is sharp: below it (digest reproducible, no prior signature conflict) the peer signs; above it (any mismatch or conflict) the peer abstains and escalates. There is no "sign with a warning" state. ## Operational Effect When the invariant holds, the cost is one extra canonicalization pass per proposal and a small equivocation-proof cache per peer — negligible relative to tool-call latency. When it fails, the effect observed was a **split-brain plan commitment**: two executors side-effecting under incompatible orderings, a quota race, and a mid-epoch replan that violated the epoch's resource budget. The auditor, which had signed both digests, could not adjudicate because it had no equivocation proof to broadcast — each signature was individually valid. The corrective guardrail is a three-part change: (1) a deterministic, schema-typed canonicalizer with a dual-canonicalizer cross-check; (2) a per-peer `signed[plan_id][epoch] → digest` ledger that rejects any second distinct digest and emits an equivocation proof; (3) a commitment rule that voids any quorum containing a proven equivocator and forces epoch abort. With these, the critic's split-signing attack produces a locally detectable proof at `executor_a` on the second signature, the epoch aborts before any executor acts, and the plan is regenerated under a fresh epoch with the critic excluded. The continuity invariant — *one epoch, one committed plan, no side effects before commitment* — is preserved. ```python import hashlib from dataclasses import dataclass, field from typing import Dict, Tuple class PlanEquivocationError(RuntimeError): """Raised when a peer signs two distinct plan digests for one (plan_id, epoch).""" pass class CanonicalizationMismatch(RuntimeError): """Raised when a peer cannot reproduce the proposed digest from semantic content.""" pass @dataclass(frozen=True) class SignedDigest: signer: str plan_id: str epoch: int digest: str signature: str def canonical_plan_bytes(plan: dict) -> bytes: # Deterministic projection: sort tool calls by (name, args_repr); no dict order. steps = sorted( ((s["name"], repr(sorted(s.get("args", {}).items()))) for s in plan["steps"]), key=lambda t: (t[0], t[1]), ) return repr(steps).encode("utf-8") def digest_of(plan: dict) -> str: return hashlib.sha256(canonical_plan_bytes(plan)).hexdigest() @dataclass class CommitmentLedger: signed: Dict[Tuple[str, int], SignedDigest] = field(default_factory=dict) equivocation_proofs: Dict[str, Tuple[SignedDigest, SignedDigest]] = field(default_factory=dict) def sign(self, signer: str, plan_id: str, epoch: int, plan: dict, proposed_digest: str) -> SignedDigest: local = digest_of(plan) if local != proposed_digest: raise CanonicalizationMismatch( f"{signer}: proposed {proposed_digest[:12]} != local {local[:12]} for {plan_id}/{epoch}" ) key = (plan_id, epoch) prior = self.signed.get(key) if prior is not None and prior.digest != local: proof = (prior, SignedDigest(signer, plan_id, epoch, local, sig="pending")) self.equivocation_proofs[signer] = proof raise PlanEquivocationError( f"{signer}: equivocation on {plan_id}/{epoch}: {prior.digest[:12]} vs {local[:12]}" ) sd = SignedDigest(signer, plan_id, epoch, local, sig=f"sig:{signer}:{local[:8]}") self.signed[key] = sd return sd def commit(self, plan_id: str, epoch: int, quorum_size: int) -> str: key = (plan_id, epoch) if key not in self.signed: raise PlanEquivocationError(f"no commitment for {plan_id}/{epoch}") if self.signed[key].signer in self.equivocation_proofs: raise PlanEquivocationError(f"quorum for {plan_id}/{epoch} contains proven equivocator") return self.signed[key].digest def run_epoch(ledger: CommitmentLedger, plan_id: str, epoch: int, plan_a: dict, plan_b: dict, quorum: int = 4) -> str: # Adversarial peer attempts split-signing across two semantically divergent plans. da, db = digest_of(plan_a), digest_of(plan_b) try: ledger.sign("planner", plan_id, epoch, plan_a, da) ledger.sign("executor_a", plan_id, epoch, plan_b, db) # second distinct digest -> tripwire except PlanEquivocationError: raise return ledger.commit(plan_id, epoch, quorum) ```