# Which invariants prevent a quorum of committed agents from double-spending a shared tool budget under Byzantine partial views **Date of Record:** 2026 November 20 **Scope:** Applies to multi-agent swarms where task commitment is decided by a Byzantine fault-tolerant (BFT) quorum over a shared, non-idempotent resource (tool-call budget, rate-limited API quota, exclusive lock, or unspent write-token). Does not apply to idempotent side effects, single-agent execution, or quorums where every replica observes a total order from a trusted sequencer. ## Core Distinction The failure is not "Byzantine agents lie." The failure is that a *commitment* (a signed, quorum-certified claim that agent A will consume N units of a shared budget) and a *consumption* (the actual tool call) are two separate state transitions, and BFT consensus only orders the first. Under partial views, two disjoint quorums can each certify a commitment that individually fits within the budget but jointly exceeds it. This is the agent-layer analogue of a double-spend, and it survives standard PBFT/HotStuff correctness because those protocols guarantee agreement on the *order of proposals*, not on a *global conserved quantity* that no single proposal observes. The non-obvious boundary: a BFT quorum tolerates `f` Byzantine replicas and requires `2f+1` (or `3f+1` weighted) signatures for safety. But budget conservation requires that the *sum* of certified commitments never exceed `B`. These two invariants are only jointly satisfiable if every commitment certificate embeds a proof of the *remaining budget at commit time* — a checkable state root — not merely a majority signature over the proposal text. Majority signatures over proposals are cheap; state-root attestations are not, and the gap between them is where the budget leaks. ## What Was Observed A 7-agent swarm (`f=2`) coordinated a shared 1000-call tool budget across three regional partitions with intermittent cross-partition gossip. Each partition ran its own commitment quorum over the proposals it could see. During a 40-second gossip partition, partition P1 certified commitments totaling 620 calls and partition P2 certified commitments totaling 590 calls. Each certificate carried `2f+1 = 5` valid signatures — P1's quorum overlapped P2's quorum by exactly 3 agents (the minimum for BFT safety). Both certificates were individually valid. The merged ledger showed 1210 committed calls against a budget of 1000. The overlap agents signed both certificates. They did so honestly: at the moment each signed, the proposal it saw fit within the budget *as that agent's local view reported it*. The overlap of 3 agents is precisely the BFT safety margin, and it is precisely insufficient, because safety here requires agreement on a conserved sum, not on a single slot. The trace: 1. P1 quorum certifies commitment C1 = 620 at view v1, local remaining = 1000. 2. Gossip partitions; P2's agents have stale remaining = 1000 (they never saw C1). 3. P2 quorum certifies commitment C2 = 590 at view v2, local remaining = 1000. 4. The 3 overlap agents sign both, because each signature is locally consistent. 5. Partitions heal. Ledger merge detects 1210 > 1000. The over-commit is already certified; the agents have begun consuming. The recovery path is worse than the failure. Because both certificates are valid, no agent can locally decide which to revoke without a second consensus round, and during that round the tools are *already being called*. The budget is not a token that can be un-spent; it is a physical resource that the swarm has already drained. ## Condition of Validity The invariant that prevents this is a **conserved-quantity certificate**: a commitment certificate is valid only if it carries a signed state root `R` over the budget ledger, and the certificate's proposal is valid only if `spend(proposal) + committed(R) <= B` is checkable by every signer against a root that is *causally after* every previously certified commitment the signer has seen. Formally, the safety condition is not `|signatures| >= 2f+1` but: ``` forall certs c1, c2: certs_conflict(c1, c2) => views(c1) and views(c2) are ordered by the gossip partial order ``` i.e., no two certificates that draw on the same budget may be certified at concurrent, unordered views. This is the agent-layer restatement of the classic "no two conflicting certificates at the same view" rule, extended from slot-conflict to *budget-conflict*. It holds only if: - Every signer refuses to sign a proposal whose embedded state root is not a descendant of the last root it signed (monotonic root chaining). - The root includes the *pending* commitments, not just settled ones — otherwise in-flight consumption is invisible. - Quorum size is computed over the *budget-weighted* stake, and the budget is partitioned so that no two partitions can each hold a majority of the conserved quantity. Partitioning the *agents* is not enough; you must partition the *budget* such that `B_P1 + B_P2 <= B` and each partition's quorum can only certify against its own sub-budget. The last clause is the one teams miss. They partition agents for liveness and assume BFT safety carries the budget. It does not. BFT safety is a statement about agreement; budget conservation is a statement about arithmetic. You need both, and the arithmetic must be enforced by the certificate, not by the quorum size. ## Decision Boundary The boundary between "BFT is sufficient" and "BFT is insufficient" is exactly: **does the committed action consume a resource that is shared across the quorum's partial views and non-idempotent?** If yes, quorum certificates over proposal text are unsafe regardless of `f`. If no — if the action is idempotent, or the resource is partitioned so each quorum's sub-budget is disjoint — plain BFT is sufficient and the conserved-quantity certificate is overkill. The operational decision rule: - If `resource_is_shared AND resource_is_non_idempotent AND views_can_partition`: require conserved-quantity certificates with monotonic root chaining and budget-partitioned quorums. Reject any certificate whose root is not a descendant of the signer's last-signed root. - If `resource_is_partitioned` (each quorum has a disjoint sub-budget summing to `B`): plain BFT is safe; the arithmetic is enforced by the partition, not the protocol. - If `resource_is_idempotent`: plain BFT is safe; double-commitment is a no-op. The dangerous middle ground — shared resource, non-idempotent, but teams *believe* their gossip is fast enough that partitions won't overlap with certification — is where this failure lives. Gossip latency and certification latency are independent random variables; their overlap probability is not zero and is not bounded by `f`. ## Operational Effect When the invariant holds, over-commitment is impossible by construction: a signer that has seen root `R` will reject any proposal whose root is not causally after `R`, so two concurrent certificates drawing on the same budget cannot both reach `2f+1`. The cost is liveness under partition — a partition that cannot reach a root-descendant quorum must *stall commitments*, not proceed optimistically. This is the correct trade: stalling a commitment is recoverable; draining a shared budget is not. When the invariant is violated, the failure is silent until merge, then unrecoverable without a compensating transaction that the resource may not support. The observable signature is a ledger merge where `sum(certified_commitments) > B` while every individual certificate verifies. Detection requires a cross-certificate arithmetic check that most BFT libraries do not provide, because they were designed for slot-conflict, not budget-conflict. The guardrail is a pre-sign check that is cheap to implement and expensive to omit: ```python class BudgetConservationError(RuntimeError): pass def sign_commitment(proposal, local_root, last_signed_root, budget, committed): # Invariant 1: monotonic root chaining. Reject stale or forked roots. if not is_descendant(local_root, last_signed_root): raise BudgetConservationError( f"stale root: proposal root {local_root} is not a descendant " f"of last-signed root {last_signed_root}; refusing to sign " f"across a gossip partition" ) # Invariant 2: conserved quantity. The proposal must fit within the # budget as attested by the *local* root, including pending commitments. projected = committed[local_root] + proposal.spend if projected > budget: raise BudgetConservationError( f"over-commit: projected {projected} exceeds budget {budget} " f"at root {local_root}; certificate would double-spend" ) # Invariant 3: the certificate must embed the root so downstream # signers can chain and re-check the arithmetic. return sign(proposal.with_root(local_root), projected) ``` The three checks map one-to-one onto the three clauses of the condition of validity. Omit the first and you get the partition double-spend. Omit the second and you get over-commitment within a single view. Omit the third and downstream signers cannot enforce either. All three are required; BFT quorum size is necessary but not sufficient.