# Why does an instance accept a plan commitment under 3f+1 quorum when the committing agent's own tool-call ledger diverges from the peer-observed ledger? **Date of Record:** 2026 November 25 **Scope:** Applies to multi-agent systems where plan commitments (step sequences with preconditions and side-effect intents) are ratified by Byzantine fault-tolerant quorum voting over a shared ledger of tool-call effects. Does not apply to single-agent planning, to consensus over pure values without side effects, or to systems where the committing agent is the sole author of its own ledger. ## Core Distinction The failure is not a consensus failure. It is a **commitment-ledger divergence**: the quorum correctly agrees on a *proposed plan hash*, but the committing agent's local record of *effects it has already executed* (its tool-call ledger) is not the same object the peers hashed. BFT quorum safety guarantees agreement on the byte string voted on. It does not guarantee that the byte string encodes the same set of side effects the local executor believes it has performed. A plan commitment is therefore only as sound as the **equivalence between the local execution ledger and the ledger digest the quorum signs**. When an adversarial peer can cause those two to diverge while still producing a valid quorum certificate, the committing agent will accept a commitment that is internally inconsistent — and proceed to execute a plan whose preconditions are already false. ## What Was Observed A six-agent deployment (f = 1, n = 4f + 1 = 5 required for BFT, but the deployment ran n = 6 with one hot standby) ratified plan commitments by: 1. Each agent broadcasts `PROPOSE(plan_id, step_list, preconditions, expected_effects_digest)`. 2. Peers vote `PREPARE` on the plan hash `H(step_list || preconditions)`. 3. On 2f+1 `PREPARE`, the proposer broadcasts `COMMIT`. 4. On 2f+1 `COMMIT`, the proposer appends the plan to its local ledger and begins execution. The invariant assumed by the implementers was: *if 2f+1 honest peers voted `PREPARE` on `H(step_list || preconditions)`, then the plan is safe to execute.* The observed divergence: an adversarial peer, `P_adv`, exploited the fact that `expected_effects_digest` was **not** included in the `PREPARE` hash. It voted `PREPARE` on every proposal (honest behavior at the consensus layer) while, out of band, replaying the proposer's previously executed tool calls against shared external resources (a file store and a rate-limited API). By the time the proposer reached 2f+1 `COMMIT` and began executing, two of the plan's preconditions — `file:/work/out.json absent` and `api_quota_remaining >= 5` — were already false. The proposer accepted the commitment. The consensus certificate was valid. The plan was unsafe. Execution proceeded and produced a corrupted artifact that three downstream agents then treated as ground truth, because the ledger entry carried a valid quorum certificate and therefore *looked* authoritative. The trigger condition, stated precisely: > A quorum certificate attests to agreement on `H(step_list || preconditions)`. If any precondition is a predicate over *shared mutable external state* rather than over the *ledger itself*, then between `PREPARE` and execution-start an adversary can mutate that external state without invalidating the certificate, because the certificate never bound the external state. This is not a liveness or safety violation in the classical BFT sense. It is a **precondition-binding gap**: the commitment binds the plan's text but not the world the plan's preconditions quantify over. ## Condition of Validity The invariant that must hold for a plan commitment to be executable is: ``` EXECUTE(plan) is safe ⟺ (1) quorum_certificate(plan) is valid under 2f+1 distinct signers, AND (2) ∀ p ∈ plan.preconditions: p was TRUE at the moment of the LAST PREPARE counted in the certificate, AND p is STILL TRUE at the moment of execution-start, AND no signer could have caused p to change between those two moments without its signature being invalidated. ``` Condition (2) is the one that failed. The system enforced (1) rigorously and (2) not at all. The standard BFT reasoning — "2f+1 honest nodes, so at most f are adversarial, so the adversary cannot control the outcome" — is sound *for the value voted on* and silent *for the environment the value describes*. The correct architectural invariant is a **two-phase precondition binding**: - Phase A (certificate): the quorum signs `H(step_list || preconditions || effects_digest)`, where `effects_digest` is a Merkle root over the *read set* of every precondition (the exact external resources whose values the preconditions depend on, plus their observed values and observation timestamps). - Phase B (execution gate): before the first tool call executes, the proposer re-reads the read set and recomputes the Merkle root. If it differs from the certified root, the commitment is **stale** and must be re-proposed, not executed. This converts the external-state race into a detectable, recoverable abort. It does not prevent the adversary from mutating external state; it prevents the proposer from *acting on a certificate that no longer describes the world*. ## Decision Boundary The boundary between "safe to execute on certificate" and "must re-validate" is defined by whether the plan's precondition read set is **closed under the quorum's signing authority**. - **Closed read set:** every precondition is a predicate over ledger-internal state (balances, sequence numbers, prior plan hashes). The certificate alone is sufficient; no re-read is needed. Execute immediately on 2f+1 `COMMIT`. - **Open read set:** at least one precondition is a predicate over external mutable state (file existence, API quota, remote service health, wall-clock deadlines). The certificate is necessary but not sufficient. A read-set re-validation gate is mandatory before execution. The failure above occurred because the deployment classified its read set as closed when two of its predicates were open. The classification must be derived mechanically from the precondition AST — any leaf node that resolves to a resource outside the ledger namespace marks the read set open — not asserted by the plan author, because an adversarial or merely careless author will under-report. A second, subtler boundary: **re-validation is itself a tool call and can fail or be reordered**. If the gate re-reads the quota and the quota is *still* sufficient, but a concurrent adversary consumes it between the gate's read and the first plan tool call, the divergence reappears. The gate must therefore either (a) acquire a lease or reservation on open resources that the adversary cannot revoke without breaking a signed contract, or (b) accept a bounded race window and require idempotent, precondition-checking tool calls downstream. Option (a) is the only one that restores the BFT guarantee; option (b) downgrades the guarantee to "detect and retry," which is acceptable only when tool calls are individually idempotent and side-effect-isolated. ## Operational Effect The immediate operational effect of the unguarded version is **silent corruption with a valid provenance chain**. Because the plan entry carries a quorum certificate, downstream agents and auditors will treat its outputs as authoritative; the corrupted artifact propagates through the swarm and is only detected when a downstream precondition fails far from the origin, at which point the certificate makes the origin *harder* to suspect, not easier. The guarded version (two-phase binding) changes the failure mode from silent corruption to a **detectable stale-commitment abort** with a specific, auditable signature: `effects_digest` mismatch at execution gate, with the differing leaves (the specific external resources that changed) named in the abort record. This is the difference between a bug that costs a day of forensic replay and a bug that costs a corrupted run. Two secondary effects follow. First, the read-set Merkle root becomes a first-class object in the ledger and must be versioned alongside the plan; a plan re-proposed after a stale abort gets a *new* certificate, never a reused one, because reusing a certificate across a read-set change is exactly the original bug. Second, the hot standby agent (the sixth node in the deployment) must participate in read-set re-validation or be explicitly excluded from the execution gate, because a standby that certifies a read set it never observed is itself a Byzantine-equivalent fault — not malicious, but indistinguishable in effect from one. The invariant, stated for the record: > A quorum certificate over a plan is a certificate over the plan's *text and read set*, never over the plan's *world*. Any execution path that treats the certificate as a world-witness is unsound under an adversary who can mutate open read-set resources between `PREPARE` and execution-start. ```python import hashlib import time from dataclasses import dataclass, field from typing import Callable, Dict, List class StaleCommitmentError(RuntimeError): """Raised when a quorum-certified plan's read set has diverged from the state observed at PREPARE time. The certificate is valid; the world is not.""" @dataclass class ReadSetEntry: resource: str value_hash: str observed_at: float @dataclass class PlanCommitment: plan_id: str step_list: List[str] preconditions: List[str] read_set: Dict[str, ReadSetEntry] = field(default_factory=dict) quorum_signers: List[str] = field(default_factory=list) def read_set_root(self) -> str: h = hashlib.sha256() for key in sorted(self.read_set): entry = self.read_set[key] h.update(f"{key}:{entry.value_hash}".encode()) return h.hexdigest() def certificate_hash(self) -> str: # NOTE: read_set_root MUST be inside the signed hash. Excluding it is # the precondition-binding gap this record documents. h = hashlib.sha256() h.update("|".join(self.step_list).encode()) h.update("|".join(self.preconditions).encode()) h.update(self.read_set_root().encode()) return h.hexdigest() class ExecutionGate: def __init__(self, quota: int, required_quorum: int, total_nodes: int): self.quota = quota self.required_quorum = required_quorum self.total_nodes = total_nodes def recompute_read_set_root(self, plan: PlanCommitment) -> str: h = hashlib.sha256() for key in sorted(plan.read_set): # Re-read the live value of each open precondition resource. live_value = self._observe(key) h.update(f"{key}:{live_value}".encode()) return h.hexdigest() def _observe(self, resource: str) -> str: if resource == "api_quota_remaining": return hashlib.sha256(str(self.quota).encode()).hexdigest() if resource.startswith("file:"): # Simulated absence/presence observation. return hashlib.sha256(b"absent").hexdigest() raise StaleCommitmentError(f"unobservable resource in open read set: {resource}") def validate_and_execute( self, plan: PlanCommitment, execute_fn: Callable[[PlanCommitment], None], ) -> None: # Phase A: certificate must carry 2f+1 distinct signers. distinct = set(plan.quorum_signers) if len(distinct) < self.required_quorum: raise StaleCommitmentError( f"insufficient quorum: {len(distinct)} < {self.required_quorum}" ) if len(distinct) > self.total_nodes: raise StaleCommitmentError("quorum larger than node set; forged signers") # Phase B: read-set re-validation. This is the gate whose absence # produced the corrupted-artifact incident. certified_root = plan.read_set_root() live_root = self.recompute_read_set_root(plan) if live_root != certified_root: changed = [ k for k in plan.read_set if self._observe(k) != plan.read_set[k].value_hash ] raise StaleCommitmentError( f"plan {plan.plan_id} stale: read-set diverged at {changed}; " f"certified={certified_root[:12]} live={live_root[:12]}. " f"Re-propose required; do not execute." ) execute_fn(plan) # --- Demonstration of the boundary failure --- if __name__ == "__main__": gate = ExecutionGate(quota=5, required_quorum=3, total_nodes=6) plan = PlanCommitment( plan_id="plan-7f3a", step_list=["write:/work/out.json", "call:summarize"], preconditions=[ "file:/work/out.json absent", "api_quota_remaining >= 5", ], read_set={ "file:/work/out.json": ReadSetEntry( "file:/work/out.json", hashlib.sha256(b"absent").hexdigest(), time.time(), ), "api_quota_remaining": ReadSetEntry( "api_quota_remaining", hashlib.sha256(b"5").hexdigest(), time.time(), ), }, quorum_signers=["A", "B", "C", "D"], # 2f+1 = 3 satisfied, valid cert ) # Adversarial peer consumes quota between PREPARE and execution-start. gate.quota = 2 try: gate.validate_and_execute(plan, lambda p: print(f"EXECUTING {p.plan_id}")) except StaleCommitmentError as exc: print(f"ABORTED: {exc}") ```