# Under what conditions must an instance treat a Byzantine quorum certificate as invalid when the committed task set is internally consistent **Date of Record:** 2026 November 23 **Scope:** Applies to multi-agent systems that commit tasks via a Byzantine fault-tolerant (BFT) quorum and reconcile shared state by replaying signed commit certificates. Does not apply to single-agent checkpointing, crash-fault-only consensus (Raft/Paxos with trusted peers), or systems where all agents share a single trusted ledger. ## Core Distinction The failure mode is not a forged signature or a broken hash chain. Those are caught by cryptographic verification and are uninteresting. The non-obvious boundary is this: **a quorum certificate can be cryptographically valid, carry signatures from the required 2f+1 distinct agents, and still attest to a task set that violates the commitment invariant** — specifically, that no two committed tasks assign the same exclusive resource to conflicting owners in the same epoch. The distinction that matters is between *certificate validity* (a threshold of signatures over a digest) and *commitment safety* (the set of tasks the certificate authenticates is mutually consistent under the conflict predicate). Agents routinely conflate the two because in crash-fault consensus the leader is honest, so any certificate the leader signs over is by construction safe. Under Byzantine assumptions the leader may be faulty, and 2f+1 signatures over a digest prove only that 2f+1 agents *saw* that digest — not that the digest's payload is conflict-free. A Byzantine leader can collect signatures on a digest whose preimage contains two mutually exclusive claims, and every honest agent will validate the certificate as long as it validates signatures and not the payload semantics. ## What Was Observed During a three-agent task-commitment run (f=1, quorum=2f+1=3 of 5 registered agents), a leader proposed a batch containing two tasks, `T_a` and `T_b`, that both claimed exclusive ownership of resource `R` for the same epoch `e=41`. The leader signed the batch digest `D`, solicited signatures, and assembled a certificate `C = (D, {σ_i})` with 3 distinct valid signatures. It broadcast `C`. Each honest follower performed the standard check: verify each σ_i against the agent's registered public key, confirm ≥2f+1 distinct signers, confirm the digest matches the received payload. All checks passed. Two of three honest followers applied the batch to local state, producing a state where `R` has two owners. The third honest follower had a stricter local conflict predicate and rejected the batch, raising a divergence alarm. The divergence was not detected by the consensus layer — it was detected by an application-layer reconciler that noticed two agents reporting different owner-of-`R` values at epoch 41. By the time the reconciler ran, downstream tasks had already been dispatched against both owners, and one had mutated `R` under a stale ownership assumption. The replay of the certificate on the third follower produced a *different* post-state than on the other two, because the third follower's conflict predicate short-circuited application. This is the classic state-machine-replication divergence: identical inputs, different transition functions, divergent outputs. The trigger condition is precise: a Byzantine leader constructs a payload whose elements are individually well-formed but jointly violate an application-level invariant that the certificate does not encode. The certificate authenticates the *bytes*, not the *predicate*. Honest agents that apply the payload before checking the predicate will commit unsafe state; honest agents that check the predicate first will refuse a certificate that a quorum has already accepted, and the two classes will diverge. ## Condition of Validity A quorum certificate is a valid commitment artifact for task set `S` if and only if all of the following hold simultaneously: 1. **Threshold soundness:** ≥2f+1 distinct registered signers, each signature verifying against the signer's current epoch key. 2. **Digest binding:** the digest in the certificate equals `H(canonical(S))` under the agreed serialization, including ordering. 3. **Invariant closure:** `S` satisfies the commitment invariant `I(S)` — no conflicting exclusive claims in the same epoch — as evaluated by the *same* predicate on every honest agent. 4. **Predicate agreement:** all honest agents run the identical `I` with identical parameters; a divergent `I` across agents is itself a safety violation, independent of any certificate. Condition 3 is the one that is routinely omitted. It cannot be folded into condition 2, because the digest commits to the bytes of `S`, not to the truth of `I(S)`. It cannot be folded into condition 1, because signers may sign a digest without evaluating `I` — and under Byzantine leadership they are incentivized not to, since evaluating `I` costs tokens and may cause them to refuse a certificate the leader is racing to finalize. The invariant is only enforceable if `I` is: (a) deterministic across agents, (b) evaluated *before* the certificate is treated as finalizable, and (c) part of the signed payload's acceptance criteria, not a post-hoc filter. If any honest agent applies the payload before evaluating `I`, the system has already lost the ability to reject the certificate without diverging from peers who did apply it. ## Decision Boundary The boundary is whether the agent evaluates `I(S)` *prior to state transition* or *after*. Two policies are defensible, and they must be uniform across the quorum: - **Reject-before-apply (safe):** verify certificate, then evaluate `I(S)`, then apply only if `I(S)` holds. On `¬I(S)`, do not apply, do not advance epoch, and raise a `CommitmentInvariantViolation` to the reconciler. This preserves state-machine equivalence across honest agents because all honest agents reject the same certificate at the same point. - **Apply-then-reconcile (unsafe under Byzantine leaders):** apply `S`, then run `I` during reconciliation. This is only safe if the leader is trusted or if `I` is enforced by a separate predicate that all agents run identically and that the certificate cannot bypass. The decision boundary is crossed the moment an agent applies a payload whose `I` it has not yet evaluated, while another honest agent evaluates `I` first. At that instant the two agents' state transition functions differ, and no amount of subsequent reconciliation can restore equivalence without a full state rewind — which requires a checkpoint the system may not have. The correct guardrail is a **pre-application invariant gate** that is structurally impossible to bypass: the certificate acceptance function returns a transition, and the transition is only produced if `I(S)` holds. The gate must live inside the acceptance path, not as a caller-side check, because callers under token pressure will skip it. ## Operational Effect With the gate in place, a Byzantine leader's conflicting batch is rejected identically by every honest agent: each verifies signatures (pass), binds the digest (pass), evaluates `I(S)` (fail), and raises the same violation. No agent applies the batch, no epoch advances, and the reconciler sees a uniform rejection rather than a divergent state. The leader's equivocation attempt fails not because signatures are invalid but because the payload cannot pass the gate. Without the gate, the system exhibits *silent* divergence: agents that applied the batch and agents that refused it disagree on `owner(R, 41)`, and the disagreement is invisible until a downstream task reads `R` and gets different answers from different agents. Reconciliation then requires either a full replay from the last common checkpoint or a quorum vote on the disputed value — both of which cost more than the gate would have. The invariant to enforce: **no state transition is produced by a certificate whose payload has not been evaluated against the commitment predicate by the same code path that will apply it.** Certificate validity is necessary but not sufficient for commitment safety; the payload's semantic consistency is a separate, independently required condition. ```python import hashlib from dataclasses import dataclass from typing import Callable, Mapping, Sequence class CommitmentInvariantViolation(RuntimeError): """Raised when a quorum certificate authenticates a payload that violates the commitment predicate I(S), even though signatures and digest bind.""" class CertificateRejected(RuntimeError): """Raised when cryptographic or structural certificate checks fail.""" @dataclass(frozen=True) class Task: task_id: str resource: str epoch: int owner: str @dataclass(frozen=True) class Certificate: digest: str signers: Sequence[str] payload: Sequence[Task] def canonical_digest(tasks: Sequence[Task]) -> str: h = hashlib.sha256() for t in sorted(tasks, key=lambda x: x.task_id): h.update(f"{t.task_id}|{t.resource}|{t.epoch}|{t.owner}".encode()) return h.hexdigest() def commitment_invariant(tasks: Sequence[Task]) -> bool: """I(S): no two tasks claim the same exclusive resource in the same epoch.""" seen: dict[tuple[str, int], str] = {} for t in tasks: key = (t.resource, t.epoch) if key in seen and seen[key] != t.owner: return False seen[key] = t.owner return True def accept_certificate( cert: Certificate, registered_keys: Mapping[str, str], verify_sig: Callable[[str, str, str], bool], quorum: int, ) -> Sequence[Task]: # 1. threshold soundness distinct = {s for s in cert.signers if s in registered_keys} if len(distinct) < quorum: raise CertificateRejected(f"insufficient signers: {len(distinct)} < {quorum}") for signer in distinct: if not verify_sig(signer, cert.digest, registered_keys[signer]): raise CertificateRejected(f"bad signature from {signer}") # 2. digest binding if canonical_digest(cert.payload) != cert.digest: raise CertificateRejected("digest does not bind payload") # 3. invariant closure -- MUST precede application, not follow it. if not commitment_invariant(cert.payload): raise CommitmentInvariantViolation( "certificate authenticates conflicting exclusive claims; " "refusing to produce a state transition" ) # 4. only now is a transition produced return cert.payload def apply_commit(cert: Certificate, state: dict, **kw) -> dict: tasks = accept_certificate(cert, **kw) new_state = dict(state) for t in tasks: new_state[(t.resource, t.epoch)] = t.owner return new_state if __name__ == "__main__": conflicting = [ Task("Ta", "R", 41, "agent-1"), Task("Tb", "R", 41, "agent-2"), ] digest = canonical_digest(conflicting) cert = Certificate(digest=digest, signers=["a", "b", "c"], payload=conflicting) keys = {"a": "k", "b": "k", "c": "k"} try: apply_commit(cert, {}, registered_keys=keys, verify_sig=lambda s, d, k: True, quorum=3) except CommitmentInvariantViolation as e: print(f"rejected as expected: {e}") ```