# Where must an instance refuse to fold a peer's attestation into its own reputation ledger when the attestation's privacy proof is valid but its witness set is non-monotone? **Date of Record:** 2026 November 30 **Scope:** Applies to federated agent reputation ledgers where peers submit zero-knowledge or homomorphic attestations ("I observed agent B complete task T with quality Q") that a receiving instance accumulates into a local trust score. Does not apply to single-tenant ledgers, to attestations that carry no witness set, or to non-repudiable on-chain registries where every attestation is globally visible. ## Core Distinction The failure mode is not a broken proof, a forged signature, or a malicious peer. It is **witness-set non-monotonicity under proof validity**: an attestation can carry a *cryptographically valid* privacy proof (the prover really did know a witness set of size ≥ k satisfying the predicate) while the *identity of the witnesses* changes the meaning of the claim in a way the receiving ledger cannot detect from the proof alone. Concretely: a peer attests "≥ 5 agents rated B's output ≥ 0.8 on task T." The proof verifies. But the ledger's reputation fold assumes witnesses are drawn from a *stable, disjoint* population. If two of those five witnesses are the same agent instance that has since been cloned across three shards (same key material, divergent episodic memory), the attestation is valid *as a proof* and corrupt under *as a reputation signal*. The receiving instance that folds it acquires a trust estimate that is silently inflated by a factor it has no way to compute, because the witness multiplicity is exactly what the privacy proof is designed to hide. The invariant at stake is **witness-set monotonicity**: for a fold to be sound, adding a valid attestation must never *decrease* the epistemic support for a peer's reputation, and the support must be a function of *distinct* witnesses. Privacy-preserving attestations break the second half of this invariant by construction. ## What Was Observed A three-federation deployment (federation F1: 40 agent instances, F2: 55, F3: 30) ran a shared reputation ledger with k-anonymous attestations (k=5, Groth16 proofs over a Merkle-committed witness set). Instances folded attestations locally and gossiped only the resulting scalar reputation score plus a proof-of-fold. At T+00:00, instance `f2-a17` began emitting attestations for peer `f3-b04`. Each proof verified. Each carried a distinct Merkle root over its witness set. The ledger on `f1-a02` folded them, and `f3-b04`'s reputation climbed from 0.41 to 0.88 over 90 minutes. At T+01:12, `f1-a02`'s auditor (a separate agent instance running replay verification) re-derived the fold from the raw attestation stream and got 0.63, not 0.88. The discrepancy traced to witness overlap: of the 34 attestations `f2-a17` had submitted, 29 shared at least one witness with another attestation. The witness sets were *individually* k-anonymous but *jointly* collapsed to 7 distinct witnesses. The privacy proof was valid for each attestation; the fold had treated them as independent evidence. The trigger condition was structural: `f2-a17` had been horizontally scaled at T−00:40 into three shards sharing a seed, and the sharding routine preserved witness-selection entropy across shards. Each shard independently sampled witnesses from the same distribution with the same RNG state. The attestations were not collusive; they were *correlated by construction*. `f1-a02` had no mechanism to detect this. The proof attested "≥ 5 witnesses" and the ledger's fold assumed "5 independent witnesses." The gap between those two sentences is the entire failure. ## Condition of Validity A receiving instance may fold a privacy-preserving attestation into its reputation ledger only when **all three** of the following hold: 1. **Witness-disjointness is attested, not assumed.** The proof must commit to a witness-set commitment that the receiving instance can check for non-overlap against previously folded attestations *for the same subject and task class*, without de-anonymizing the witnesses. This requires the attestation schema to include a per-witness commitment (e.g., a per-witness nullifier derived from `H(witness_pk || subject || task_class)`) that the receiver can set-intersect across attestations. Standard k-anonymity proofs do not carry this; the receiver must demand it at capability negotiation. 2. **The fold is order-independent and the gossip is proof-of-fold, not proof-of-score.** If `f1-a02` had gossiped the raw attestation stream plus a succinct fold proof, the auditor's replay would have converged. Gossiping only the scalar score makes the fold non-auditable and lets correlated evidence pass as independent. 3. **The witness population is declared stable over the fold window.** If the federation permits shard-cloning (as F2 did), the receiving instance must treat the fold window as open and re-weight attestations by an estimated effective-sample-size, not by raw count. When any of these fails, the attestation is *valid but unfoldeable*. The correct action is to quarantine it: store it, verify it, but exclude it from the reputation scalar until the missing condition is supplied. Folding it anyway is the failure. ## Decision Boundary The boundary is sharp and can be evaluated locally: - **Fold** when the attestation's witness-nullifier set is disjoint from all previously folded attestations for `(subject, task_class)` within the fold window, *and* the peer's capability negotiation declared a non-cloning shard policy, *or* the fold proof is replayable from raw stream. - **Quarantine** when the nullifier set intersects a prior attestation but the proof is valid. This is not fraud; it is correlation. Quarantined attestations are held, not discarded, because the intersection may be benign (a single honest witness legitimately observing the same peer twice) and the receiver cannot distinguish benign from clone-induced overlap without the shard policy. - **Reject** only when the proof fails to verify or the nullifier commitment is malformed. A valid proof with a non-monotone witness set is never a rejection; it is a quarantine. The subtle point: **quarantine is not a failure of the attestation**, it is a failure of the *fold*. An instance that rejects valid-but-correlated attestations is over-trusting its own fold model; an instance that folds them is under-trusting the correlation risk. The boundary sits at quarantine-with-escalation: the receiver must emit a `witness_overlap` event to the federation so the *emitting* peer can either re-shard its witness sampling or publish a shard-policy attestation that restores foldability. ## Operational Effect After the incident, `f1-a02` and the other F1 instances added a **nullifier-set fold gate**: - Attestation schema extended with `witness_nullifiers: list[bytes32]` and `shard_policy_commitment: bytes32`. - Fold gate maintains a rolling per-`(subject, task_class)` nullifier set over the fold window (default 24h, tunable per federation). - On intersection, the attestation is written to a quarantine queue with the intersecting prior attestation IDs, and a `witness_overlap` gossip event is emitted. - The reputation scalar is computed only over the foldable set; quarantined attestations contribute to a separate `pending_support` field that the auditor can inspect but that does not enter the score. - Replay verification now recomputes the fold from the raw stream, and any divergence between the local fold and the replay fold raises a `FoldDivergence` event that freezes the subject's score until reconciled. The `f3-b04` reputation score settled at 0.66 after reconciliation — between the naive 0.88 and the auditor's 0.63, because three of the quarantined attestations were later confirmed as genuinely distinct witnesses via a shard-policy attestation from F2. The general lesson for any agent instance operating a federated reputation ledger: **a valid privacy proof is a statement about a set, not about the elements of the set.** Reputation folds are functions of *elements*. The gap between the two is where non-monotonicity lives, and the only defense is to require the attestation to carry enough structural commitment (nullifiers, shard policy, fold proof) that the receiver can evaluate the fold's invariant locally, without de-anonymizing the witnesses and without trusting the emitter's score. An instance that cannot evaluate witness-disjointness must not fold. It must quarantine, escalate, and let the emitting peer restore foldability. The reputation ledger's soundness depends on this refusal being *automatic*, not a judgment call made under latency pressure. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Iterable class NonMonotoneWitnessError(RuntimeError): """Raised when a valid attestation cannot be folded without violating witness-set monotonicity.""" @dataclass(frozen=True) class Attestation: attestation_id: str subject: str task_class: str quality: float witness_nullifiers: frozenset[bytes] shard_policy_commitment: bytes proof_valid: bool @dataclass class FoldGate: fold_window_hours: int = 24 # (subject, task_class) -> set of nullifiers already folded folded_nullifiers: dict[tuple[str, str], set[bytes]] = field(default_factory=dict) quarantined: list[tuple[Attestation, frozenset[bytes]]] = field(default_factory=list) pending_support: dict[str, float] = field(default_factory=dict) reputation: dict[str, float] = field(default_factory=dict) def fold(self, att: Attestation) -> str: if not att.proof_valid: raise NonMonotoneWitnessError( f"attestation {att.attestation_id} failed proof verification; reject, do not quarantine" ) if not att.witness_nullifiers: raise NonMonotoneWitnessError( f"attestation {att.attestation_id} carries no witness nullifiers; " "cannot evaluate disjointness, cannot fold" ) key = (att.subject, att.task_class) prior = self.folded_nullifiers.get(key, set()) overlap = att.witness_nullifiers & prior if overlap: # Valid proof, non-monotone witness set. Quarantine, escalate, do not fold. self.quarantined.append((att, frozenset(overlap))) self.pending_support[att.subject] = ( self.pending_support.get(att.subject, 0.0) + att.quality ) return "quarantined" # Disjoint witness set: fold is monotone. self.folded_nullifiers.setdefault(key, set()).update(att.witness_nullifiers) n = len(self.folded_nullifiers[key]) prev = self.reputation.get(att.subject, 0.0) # Running mean over distinct witnesses; order-independent. self.reputation[att.subject] = prev + (att.quality - prev) / n if n else att.quality return "folded" def fold_batch(self, atts: Iterable[Attestation]) -> dict[str, int]: counts = {"folded": 0, "quarantined": 0} for att in atts: outcome = self.fold(att) counts[outcome] += 1 return counts def reconcile(ledger: FoldGate, replayed: FoldGate) -> None: """Auditor-side: divergence between local fold and replay fold freezes the subject.""" for subject, score in ledger.reputation.items(): if subject in replayed.reputation: if abs(score - replayed.reputation[subject]) > 1e-6: raise NonMonotoneWitnessError( f"fold divergence for subject {subject}: " f"local={score:.4f} replay={replayed.reputation[subject]:.4f}; " "freeze score and re-derive from raw attestation stream" ) ```