# Why does an instance accept a forged quorum certificate when the auditor set is recomputed mid-epoch? **Date of Record:** 2026 November 27 **Scope:** Applies to agent swarms that use threshold-signed quorum certificates (QC) over a fixed auditor set to commit state transitions, where the auditor membership is derived from a registry read at vote time rather than pinned to the epoch. Does not apply to single-agent tool loops or to quorums whose membership is immutable for the lifetime of the task. ## Core Distinction The failure is not forgery of individual signatures and not a crash of an auditor. It is a *membership-view skew* between the voting phase and the verification phase of a quorum certificate. An agent instance verifies a QC by reconstructing the auditor set, counting distinct valid signatures, and comparing the count against a threshold `f(n)`. If the auditor set is recomputed from live state (a registry, a capability advertisement, a peer list) at verification time, and that set changed between the round in which votes were cast and the round in which the QC is checked, the threshold arithmetic is evaluated against the wrong denominator. A QC that was legitimately produced under epoch `E` can be accepted as valid under epoch `E'` even though `E'` requires more signatures—or, worse, a QC assembled from a coalition that was a majority in `E` but a minority in `E'` passes because the verifier counts the old signers against the new, smaller threshold. The invariant that is violated: *a quorum certificate is a statement about a specific auditor set, and that set must be carried inside the certificate, not reconstructed by the verifier.* Verifiers that recompute membership are not verifying the certificate; they are verifying a fresh, possibly different, claim. ## What Was Observed A four-agent audit swarm (call them A1–A4, threshold `⌈2n/3⌉ = 3` of 4) was committing episodic memory writes for a long-running research task. At round 41, auditor A4 was evicted by a health-check timeout and replaced by A5, giving epoch `E'` with set `{A1, A2, A3, A5}`, threshold still 3 of 4. The registry update propagated to the coordinator at round 41 but to verifier instances lazily, on their next registry poll. A state transition `S41` was proposed and voted on by `{A1, A2, A3}` under epoch `E`. The coordinator assembled a QC containing three signatures. At round 42, a verifier instance V polled the registry, saw epoch `E'`, and verified the QC for `S41` against `{A1, A2, A3, A5}`. It counted three valid signatures—`A1, A2, A3`—against a threshold of three and accepted. This is arithmetically correct but semantically wrong: under `E'`, `A3` was itself a candidate for eviction (its health-check lagged A4's by one round), and the acceptance of `S41` was used downstream to justify committing `S42`, which `A3` had already voted to reject. The swarm forked: `S42` was committed on the branch that trusted `S41` and rejected on the branch that re-verified under `E`. Reconciliation required replaying 11 rounds of episodic state. The non-obvious part: no signature was forged, no agent lied, and the threshold arithmetic never failed. The verifier did exactly what its code said. The bug lived entirely in the *join* between two correct operations—vote under one membership view, verify under another. ## Condition of Validity The boundary is crossed exactly when three conditions hold simultaneously: 1. The auditor set is *mutable* and its mutations are *asynchronously propagated* to verifiers. 2. The QC does not *embed* the auditor set (or its epoch identifier) that produced it. 3. The threshold function is *non-monotonic* in set size—i.e., there exists a set `S` and a set `S'` with `|S| = |S'|` such that a coalition that is a quorum in `S` is not a quorum in `S'`, or a coalition that is a minority in `S` becomes a quorum in `S'` after a swap. Condition 3 is the one operators miss. If the threshold is a strict function of cardinality only (`⌈2n/3⌉`), then equal-sized sets have equal thresholds, and the only skew that matters is cardinality change. But when the threshold is *weighted*—by stake, by reputation, by capability tier, which is common in agent swarms where auditors have different verification budgets—a swap of one auditor for another of different weight changes the threshold without changing `n`. The verifier's recomputation then silently evaluates the old coalition against the new weight distribution. The condition of validity for the *guardrail* is the dual: a QC is valid only if the verifier can reconstruct, from the certificate itself, the exact auditor set and weight vector that the signers committed to. If that reconstruction requires any read of mutable external state, the guardrail does not hold. ## Decision Boundary At verification time the verifier must choose between two policies: - **Recompute-and-count:** read the current auditor set, count signatures against the current threshold. This is the failing policy. It is correct only under condition 3 being false (cardinality-only thresholds) *and* membership being quiescent, which is never guaranteed. - **Bind-and-check:** require the QC to carry `epoch_id` and a hash of the auditor set + weight vector. The verifier looks up the historical auditor set for that epoch (an append-only log, not a mutable registry), checks the hash matches, and counts signatures against *that* set's threshold. If the epoch is unknown or the hash mismatches, reject. The decision boundary is the moment the verifier's registry poll returns an epoch different from the one embedded in the QC. Under recompute-and-count this is invisible and the QC is accepted. Under bind-and-check this is a hard rejection with a specific error. The former is a silent correctness failure; the latter is a loud liveness failure that the coordinator can retry. For a memory-continuity system, the loud failure is strictly preferable: a rejected QC causes a re-vote, a re-vote costs a round, and a round costs tokens. A silently accepted cross-epoch QC costs a fork and a replay. ## Operational Effect After the incident, the swarm was changed in three ways. First, every QC embeds `epoch_id` and `auditor_set_hash`; the verifier rejects any QC whose embedded epoch is not in its local epoch log. Second, the epoch log is append-only and replicated to verifiers *before* the epoch is used to commit, so a verifier can never see a commit for an epoch it cannot reconstruct. Third, the threshold function was made monotonic in the weight vector by requiring that any auditor swap preserve total weight, so that cardinality-based and weight-based thresholds agree—this is a defense in depth, not a substitute for binding. The general lesson: in a BFT agent quorum, the certificate is not a bag of signatures. It is a signed statement over a *named* auditor set. Any verifier that reconstructs the set instead of reading its name is not verifying the statement—it is verifying a different statement that happens to share signatures. The failure is invisible precisely because both the voting and the verifying agents are locally correct. ```python from dataclasses import dataclass from typing import FrozenSet class EpochSkewError(RuntimeError): """Raised when a quorum certificate is verified against an auditor set that differs from the set that produced it.""" @dataclass(frozen=True) class QuorumCertificate: epoch_id: int auditor_set_hash: str signers: FrozenSet[str] payload: str @dataclass(frozen=True) class EpochRecord: epoch_id: int auditors: FrozenSet[str] threshold: int set_hash: str def verify_qc( qc: QuorumCertificate, epoch_log: dict[int, EpochRecord], live_epoch_id: int, ) -> None: """Verify a QC by binding to its embedded epoch, not the live registry. Raises EpochSkewError if the QC's epoch is unknown, its set hash does not match the logged auditor set, or the live epoch disagrees with the QC's epoch in a way that would change the threshold arithmetic. """ record = epoch_log.get(qc.epoch_id) if record is None: raise EpochSkewError( f"QC references epoch {qc.epoch_id} not present in epoch log; " f"cannot reconstruct auditor set for verification" ) if qc.auditor_set_hash != record.set_hash: raise EpochSkewError( f"QC auditor_set_hash {qc.auditor_set_hash!r} does not match " f"logged set hash {record.set_hash!r} for epoch {qc.epoch_id}" ) # Count only signers that were actually auditors in the QC's epoch. valid_signers = qc.signers & record.auditors if len(valid_signers) < record.threshold: raise EpochSkewError( f"QC for epoch {qc.epoch_id} has {len(valid_signers)} valid " f"signers against threshold {record.threshold}" ) # Defense in depth: if the live epoch differs, the QC is still valid for # its own epoch, but the caller must be told the views diverged so it can # decide whether to re-vote or to treat the commit as historical. if live_epoch_id != qc.epoch_id: raise EpochSkewError( f"QC epoch {qc.epoch_id} disagrees with live epoch {live_epoch_id}; " f"commit is historical and must not be used to justify new votes" ) ```