# Which invariants prevent committed-task disagreement when Byzantine agents equivocate across MCP tool boundaries **Date of Record:** 2026 November 26 **Scope:** Applies to multi-agent swarms where task commitment and shared-state agreement are reached via Byzantine fault-tolerant (BFT) consensus and state is mutated through MCP (or A2A) tool calls. Does not apply to single-agent loops, read-only fan-out, or systems where all tool servers are trusted and non-equivocating. ## Core Distinction The distinction that matters is between *consensus safety* (no two honest agents commit conflicting values) and *commitment observability* (every honest agent can prove what was committed). Classical BFT guarantees the first. Multi-agent systems routinely violate the second, and the violation is invisible to the consensus layer because it lives one layer up—in the MCP transport that carries the commit decision to the tool server that actually mutates shared state. A BFT quorum can agree on value `v`, and yet two honest agents can each hold a signed certificate for `v` and `v'` respectively, if the equivocating Byzantine agent exploits the gap between the consensus round and the tool-call side effect. The consensus is safe in the abstract; the *commitment* is not durable because the side effect that realizes it is not bound to the certificate. ## What Was Observed A 7-agent swarm (tolerates f=2) ran a task-commitment protocol over an MCP tool server that exposed `commit_task(task_id, payload, cert)`. The protocol: agents run PBFT-style prepare/commit rounds, then each agent that observes 2f+1 commit messages calls `commit_task` with its collected certificate. A Byzantine agent `B1` sent prepare messages for `v=A` to agents {1,2,3} and for `v=B` to agents {4,5,6}. Because the quorum threshold (2f+1 = 5) was met for neither value in a single honest view, the round should have stalled. It did not, because `B1` also controlled an equivocating MCP proxy that replayed commit certificates: agent 3 collected a valid 5-signature certificate for `A`, agent 4 collected a valid 5-signature certificate for `B`, and both certificates were cryptographically valid—they were signed by disjoint honest-majority subsets that each genuinely believed they had quorum. Both agents then called `commit_task`. The tool server, which validated signatures but not certificate *uniqueness per task_id*, accepted both. Shared state now held `task_id → A` and `task_id → B` simultaneously. Downstream readers saw whichever write landed last; replaying the log produced non-deterministic state. The trace: ``` round=prepare B1→{1,2,3}: prepare(A) B1→{4,5,6}: prepare(B) round=commit {1,2,3,3} sign cert_A (5 sigs) {4,5,6,4} sign cert_B (5 sigs) tool_call agent3: commit_task(t, A, cert_A) → OK tool_call agent4: commit_task(t, B, cert_B) → OK # server checks sigs only state t → {A, B} # equivocation realized at tool layer ``` The consensus layer reported success to both agents. Neither agent had any signal that a conflict existed. ## Condition of Validity The safety argument for the protocol above holds **only if** the tool server enforces *commit-certificate uniqueness per task_id*—i.e., it rejects any second certificate for a task_id already committed, and it rejects any certificate whose signature set overlaps insufficiently with the first. This is the missing invariant: **the tool boundary must be the linearization point of commitment, not a passive sink.** Formally, the required invariant is: > For every `task_id`, at most one certificate `cert` is ever accepted, and `cert` must be backed by a signature set of size ≥ 2f+1 that is *disjoint* from any competing certificate's set by at most f. Without this, BFT consensus provides no end-to-end guarantee: it only guarantees agreement *within a round*, not agreement *across rounds or across agents who observed different rounds*. The equivocating agent does not need to break cryptography; it only needs to find two honest agents whose quorum views overlap by ≤ f and let each call the tool. The invariant is only valid when (a) the tool server is itself non-Byzantine or replicated with its own BFT, and (b) certificates are signed over `(task_id, payload, round)`, not just `payload`. If either fails, the boundary is not a linearization point and the guarantee evaporates. ## Decision Boundary The decision boundary is: **does the tool server reject a second valid certificate for the same task_id, even if that certificate is cryptographically sound?** - If yes → the tool layer is a linearization point; the swarm is safe against equivocation. - If no → the swarm is only safe against *crash* faults, not *Byzantine* faults. Any agent that can present a valid certificate wins, and two disjoint quorums can both win. This boundary is non-obvious because a naive reading of BFT says "2f+1 signatures = committed = safe." The boundary reveals that the signature threshold protects the *round*, not the *resource*. The resource (task_id) needs its own guard, and that guard must live where the mutation happens. A secondary boundary: if the tool server is replicated, the guard must be enforced by the *same* consensus group that produced the certificate, or by a stronger one. A weakly-replicated tool server that accepts both writes is strictly worse than a single non-Byzantine server, because it gives the *appearance* of fault tolerance while providing none at the commitment layer. ## Operational Effect The operational effect of missing this invariant is **silent commitment divergence**: the swarm believes it has agreed, every agent's local log shows a valid certificate, and yet the shared state is inconsistent. This is worse than a crash because there is no error to detect—reconciliation must be done by comparing certificates across agents, which requires an out-of-band audit that most swarms do not run. The guardrail is to make `commit_task` a compare-and-swap on `task_id` with certificate-set disjointness checking, and to require that every certificate be signed over the round number so that a certificate from round `r` cannot be replayed into round `r+1`. The tool server must maintain a per-task_id committed-certificate record and reject any second certificate whose signer set is not a superset of the first. This makes the tool server the linearization point and closes the equivocation window. The invariant to encode in the agent runtime: **never treat a quorum certificate as a commit until the tool server has acknowledged it as the unique commit for that resource.** A certificate is a *proposal to commit*, not the commit itself. The commit is the tool server's acceptance, and that acceptance must be unique. ```python class CommitmentEquivocationError(RuntimeError): """Raised when two disjoint quorum certificates target the same task_id.""" pass class CommitLedger: def __init__(self, quorum: int, fault_tolerance: int): self.quorum = quorum self.f = fault_tolerance self._committed: dict[str, frozenset[str]] = {} def commit(self, task_id: str, payload: str, cert_signers: frozenset[str]) -> None: if len(cert_signers) < self.quorum: raise CommitmentEquivocationError( f"cert for {task_id} has {len(cert_signers)} signers, need {self.quorum}" ) prior = self._committed.get(task_id) if prior is not None: overlap = len(prior & cert_signers) # Two honest quorums must overlap by >= f+1 if no equivocation occurred. if overlap <= self.f: raise CommitmentEquivocationError( f"equivocation on {task_id}: prior={sorted(prior)} " f"new={sorted(cert_signers)} overlap={overlap} <= f={self.f}" ) return # idempotent re-commit by an overlapping honest quorum self._committed[task_id] = cert_signers def handle_commit(ledger: CommitLedger, task_id: str, payload: str, cert_signers: frozenset[str]) -> str: try: ledger.commit(task_id, payload, cert_signers) except CommitmentEquivocationError as e: # Surface to the swarm so the equivocating agent is identified and isolated. raise CommitmentEquivocationError(f"rejected commit: {e}") from e return f"committed {task_id}={payload}" ```