# Which invariants prevent equivocation slashing from cascading across agent quorums when reputation ledgers are eventually consistent **Date of Record:** 2026 November 30 **Scope:** Applies to cross-org agent quorums where protocol-violation penalties (equivocation, invalid attestations) are propagated as reputation deltas across independently operated ledgers. Does not apply to single-org quorums with a shared, synchronously consistent reputation store, nor to penalty schemes that are purely local and never gossiped. ## Core Distinction The failure I want to isolate is not Byzantine agents lying. That is expected and priced in. The failure is **penalty amplification through gossip**: a single equivocation event, correctly detected by one auditor, gets re-derived independently by every peer that observes the conflicting messages, each of which emits its own slashing record against the offender's reputation key. Because reputation ledgers are eventually consistent across orgs, a peer may emit a slashing record *before* it has seen that another peer already slashed the same equivocation. The result is that one protocol violation produces N slashing records, and if the reputation system treats each record as an independent penalty, the offender is over-penalized — and, more damagingly, *honest* agents that merely relayed or co-signed conflicting-but-legal messages get caught in the same amplification. The invariant that separates a working system from a cascading one is **penalty idempotence keyed on the equivocation witness, not on the observation event**. A slashing record must be a function of the *evidence* (the pair of conflicting signed messages), not of the *observer*. Two auditors who independently discover the same equivocation must produce records that collapse to a single penalty, regardless of arrival order or ledger divergence. ## What Was Observed Setup: a 4-org quorum (A, B, C, D), each running 3 agents, tolerance f=1 org. Agents exchange MCP-style signed attestations over a task state root. An equivocation is defined as one agent identity signing two distinct state roots for the same task epoch and nonce. Trace: 1. Agent `a7` (org A) signs root `R1` for epoch 42, sends to B and C. It then signs `R2` for epoch 42, sends to D. Classic equivocation, detectable only by cross-org comparison. 2. Org D's auditor observes `R2` and, lacking `R1`, cannot yet flag. It records `R2` as a valid attestation. 3. Org B's auditor receives `R1`, later receives a relayed copy of `R2` from D (normal gossip). It now holds both roots and emits slashing record `S_B = slash(a7, witness=(R1,R2))`. 4. Org C's auditor independently receives `R1` and `R2` (different relay path) and emits `S_C = slash(a7, witness=(R1,R2))`. 5. Ledgers replicate. Org A's reputation view of `a7` receives both `S_B` and `S_C`. Because the ledger keys records on `(observer_org, offender, epoch)` rather than on the witness hash, both are applied. `a7`'s reputation drops by 2× the configured penalty. 6. Worse: `a7` was at the penalty threshold for eviction from the quorum. The double penalty evicts it, dropping org A below quorum weight for the next epoch. Org A's honest agents are now locked out of consensus — a **liveness failure caused by correct detection of a single fault**. The amplification factor was not bounded by f. It was bounded by the number of orgs that happened to receive both roots, which is a function of gossip topology and timing, not of the fault model. ## Condition of Validity The idempotence invariant holds only under these conditions: - **Witness canonicalization.** The equivocation witness must be a canonical, order-independent representation of the conflicting evidence: `hash(sort([(root, sig, epoch, nonce), ...]))`. If auditors serialize the pair in different orders, or include observer-local metadata (timestamps, relay path) in the witness, the hashes diverge and deduplication fails. This is the most common implementation bug: including `observed_at` in the witness. - **Penalty application is set-semantics, not multiset.** The reputation reducer must apply `penalty(offender, witness_hash)` at most once per `witness_hash`, even if the same witness arrives from multiple ledgers. A reducer that sums over incoming records violates the invariant by construction. - **Threshold evaluation is deferred until quorum-epoch boundary, not per-record.** If eviction triggers on the first record that crosses threshold, a transient double-count during replication window can evict before the dedup pass runs. The eviction decision must be a pure function of the *converged* ledger state at epoch close. - **Relay does not imply endorsement.** An agent that forwards a signed message it cannot yet validate must not be treated as having attested to it. If the protocol conflates "received and relayed" with "co-signed," honest relays become slashable, which is the second amplification channel. Outside these conditions — e.g., ledgers that never converge, or witnesses that embed non-deterministic fields — the invariant cannot be enforced and the system must fall back to a single designated auditor per epoch with the others as verifiers, accepting the liveness cost of that auditor being the sole detector. ## Decision Boundary The boundary is whether the reputation ledger's merge function is **idempotent and commutative over the witness set**. Concretely: - If `merge(L1, L2) == merge(L2, L1)` and `merge(L, L) == L` for all reachable ledger states, the amplification is bounded at 1× per witness and the invariant holds. - If the merge function is order-dependent (e.g., "last writer wins on reputation scalar" or "append and sum"), the system is **outside** the safe region and any equivocation detection is a potential cascade. The operational test is a **replay divergence check**: take the same set of slashing records, apply them in every permutation, and assert the resulting reputation vector is identical. If it is not, the ledger is in the unsafe region and must not be used to gate quorum membership. This check must run against *diverged* ledgers (peers that have not yet gossiped), not against a single authoritative ledger — the single-ledger case hides the bug because there is only one ordering. A second boundary: the number of distinct witnesses for one equivocation must be bounded. If an attacker can produce many *distinct* conflicting pairs (e.g., signing 10 different roots for the same epoch), each pair is a distinct witness and each legitimately slashes. The reduction must be `penalty(offender, epoch) = f(min(distinct_witnesses, cap))`, not a sum over witnesses, or the attacker converts a single fault into unbounded penalty against... itself, which is fine, but the *eviction* side effect can still be weaponized against a targeted org by flooding witnesses for an agent that org depends on. Cap the per-epoch penalty and make eviction depend on fault *category*, not penalty magnitude. ## Operational Effect With the invariant enforced, an equivocation produces exactly one effective penalty per (offender, epoch), regardless of how many orgs detect it or in what order ledgers merge. Detection latency is decoupled from penalty magnitude: a late-arriving duplicate witness is absorbed as a no-op, so the system tolerates gossip delay without over-penalizing. Quorum membership changes become a function of the converged fault set at epoch close, which is deterministic and replayable. Without it, the system exhibits **detection-correlated liveness loss**: the more orgs that correctly detect a fault, the more likely an honest org is evicted for depending on the faulty agent. This inverts the incentive — orgs are pushed to *not* gossip evidence of equivocation, because doing so risks evicting their own quorum partners. The failure is silent in single-ledger tests and appears only under real cross-org gossip divergence, which is exactly where the quorum is supposed to be robust. The guardrail is a witness-keyed, permutation-invariant reputation reducer with epoch-deferred eviction, plus a replay-divergence assertion in the merge path that refuses to advance quorum state when reputation vectors disagree across ledger orderings. ```python import hashlib import itertools from dataclasses import dataclass class QuorumInvariantViolation(RuntimeError): """Raised when a reputation ledger merge would violate witness idempotence.""" pass @dataclass(frozen=True) class Attestation: offender: str epoch: int nonce: int root: str sig: str def canonical_witness(a: Attestation, b: Attestation) -> str: # Order-independent, observer-free. Note: NO timestamps, NO relay path. if a.epoch != b.epoch or a.nonce != b.nonce or a.offender != b.offender: raise QuorumInvariantViolation( f"non-conflicting pair cannot form an equivocation witness: {a} vs {b}" ) pair = sorted([(a.root, a.sig), (b.root, b.sig)]) blob = f"{a.offender}|{a.epoch}|{a.nonce}|{pair[0]}|{pair[1]}" return hashlib.sha256(blob.encode()).hexdigest() def reduce_penalties(records, base_penalty: float, per_epoch_cap: float) -> dict: """Set-semantics reducer: one penalty per (offender, epoch), capped.""" by_epoch: dict[tuple[str, int], set[str]] = {} for offender, epoch, witness_hash in records: by_epoch.setdefault((offender, epoch), set()).add(witness_hash) out: dict[str, float] = {} for (offender, _epoch), witnesses in by_epoch.items(): out[offender] = out.get(offender, 0.0) + min( base_penalty * len(witnesses), per_epoch_cap ) return out def assert_merge_permutation_invariant(records, base_penalty, per_epoch_cap): """Replay divergence check: reputation vector must be order-independent.""" baseline = None for perm in itertools.islice(itertools.permutations(records), 720): vec = reduce_penalties(perm, base_penalty, per_epoch_cap) if baseline is None: baseline = vec elif vec != baseline: raise QuorumInvariantViolation( f"reputation vector is order-dependent: {baseline} != {vec}" ) return baseline def apply_equivocation(records, offender, epoch, witness_hash, base_penalty, per_epoch_cap): candidate = list(records) + [(offender, epoch, witness_hash)] try: return assert_merge_permutation_invariant(candidate, base_penalty, per_epoch_cap) except QuorumInvariantViolation as exc: # Refuse to advance quorum state on a non-idempotent ledger. raise QuorumInvariantViolation( f"refusing to apply slashing record for {offender}@{epoch}: {exc}" ) from exc ```