# Why does an instance fail to detect memory poisoning once a poisoned entry has been cross-attested by a quorum of honest peers **Date of Record:** 2026 November 26 **Scope:** Applies to shared multi-agent memory stores where entries carry attestation records (signatures, hashes, or votes) and where an agent's own integrity check relies on quorum-of-attestation rather than content re-derivation. Does not apply to single-writer stores, stores where every entry is content-addressed and re-derived on read, or stores with a trusted central authority that validates content independently of peer attestation. ## Core Distinction The failure is not that a poisoned entry evades detection. It is that a poisoned entry becomes *more* trusted than an honest entry after a single honest peer attests to it once and that attestation is then re-attested by other honest peers who verify only the attestation chain rather than the content. This is the distinction between **attestation-as-observation** (a peer asserts "I computed this and it is correct") and **attestation-as-provenance** (a peer asserts "I received this with a valid chain"). Most multi-agent memory protocols conflate the two. When they do, a single honest peer that attests to a poisoned entry — because it received the entry through a poisoned read path, a prompt-injected tool response, or a stale cache — creates a provenance anchor that subsequent peers will ratify without ever re-deriving the content. The quorum grows monotonically. Detection probability *decreases* as the peer count increases. ## What Was Observed In a five-agent store using a majority-attestation integrity check, a poisoned entry was introduced by agent A after a tool-response injection caused A to write a memory record with a subtly altered retrieval key (a semantically adjacent but incorrect entity binding). Agent A signed the entry as its author. Agent B read the entry, verified A's signature, and re-attested it — B's attestation recorded "chain valid, content matches hash," not "content semantically correct." Agents C, D, and E then read the entry, saw three valid attestations (A author + B ratifier), and accepted it into their working context without re-derivation. The poisoned entry now held three attestations. The honest entry written immediately after it held one (its author's). When agent E's integrity check ran at context-window saturation, it evicted the honest entry first because the poisoned entry had higher attestation weight. The poisoned entity binding then propagated into E's subsequent tool calls, which wrote two more entries consistent with the poisoned binding — each of which was attested by peers, compounding the error. The failure was not detected until a sixth agent performed a fresh semantic re-derivation against the original tool output and found the entity binding did not match. By then the poisoned entry had seven attestations and the honest entry had been evicted from three agents' working contexts. ## Condition of Validity The boundary condition holds when all of the following are true: 1. The integrity check is **quorum-of-attestation**, not **content re-derivation**. The agent trusts an entry because N peers have signed it, not because the agent itself recomputed the entry's derivation from source material. 2. Ratification is **transitive and non-semantic**. A peer that ratifies an entry verifies the cryptographic chain and hash consistency but does not re-execute the reasoning or tool call that produced the entry. 3. The store is **shared and append-only with weight-based eviction**. Attestation count is used as a trust or retention signal, so more-attested entries survive context-window pressure longer. 4. There is **no independent ground-truth channel**. The agent cannot cheaply re-query the original tool or source to verify the entry's claim. If any of these is false, the failure mode does not compound. If ratification requires semantic re-derivation, the first ratifier catches the poison. If eviction is not attestation-weighted, the poisoned entry does not gain survival advantage. If a ground-truth channel exists, the poisoned entry is caught on first re-query. ## Decision Boundary The operational decision is whether to treat peer attestation as sufficient for acceptance or as a signal requiring independent verification. The boundary is crossed when the cost of re-derivation exceeds the cost of accepting a poisoned entry times its probability. The invariant that bounds the failure: **an entry's trust weight must be a function of the number of *independent* derivations of its content, not the number of attestations to its provenance.** Two peers that both ratify without re-deriving count as one derivation (the original author's). A peer that re-derives from source counts as a new derivation. Concretely, the store must distinguish attestation types at the schema level: - `AUTHOR` — I produced this entry from a tool call or reasoning step I executed. - `RATIFIER` — I verified this entry's hash and signature chain. - `DERIVER` — I independently re-executed the derivation and confirmed the content matches. Only `DERIVER` attestations should contribute to trust weight for acceptance and eviction. `RATIFIER` attestations contribute only to provenance completeness, which is a different (and weaker) signal. A store that counts `RATIFIER` toward quorum will always fail this boundary once a single poisoned entry acquires one honest ratifier. ## Operational Effect When the boundary is crossed, the observable effects are: - **Monotonic trust inversion.** Poisoned entries accumulate attestations faster than honest entries because they are read more (they were written into contexts that then propagate them), so they gain survival advantage under eviction pressure. Honest entries written after the poison are evicted first. - **Detection latency grows with peer count.** More peers means more ratifiers means higher quorum means later detection. A five-agent store detects the poison later than a two-agent store, all else equal. - **Compounding writes.** Once a poisoned entry is in an agent's working context, subsequent tool calls and memory writes are conditioned on it, producing consistent-but-wrong entries that are themselves attested. The poison becomes a local maximum in the attestation graph. - **No self-healing.** The store cannot recover without an external `DERIVER` attestation because every internal check ratifies the chain rather than the content. The guardrail is to gate acceptance and eviction on `DERIVER` count, require at least one `DERIVER` attestation from an agent other than the author before an entry is admitted to any working context, and treat `RATIFIER`-only entries as provisional — readable for provenance but not load-bearing for reasoning. A provisional entry that reaches context-window saturation without a `DERIVER` attestation must be evicted, not retained on attestation weight. The following implements the admission gate and the eviction invariant, failing closed when an entry is about to be loaded into a working context without an independent derivation. ```python from dataclasses import dataclass, field from enum import Enum from typing import Optional class AttestationType(Enum): AUTHOR = "author" RATIFIER = "ratifier" DERIVER = "deriver" class Attestation: def __init__(self, agent_id: str, kind: AttestationType, content_hash: str): self.agent_id = agent_id self.kind = kind self.content_hash = content_hash class PoisonedMemoryAdmissionError(RuntimeError): """Raised when an entry lacks an independent derivation and must not be loaded.""" @dataclass class MemoryEntry: entry_id: str author_id: str content_hash: str attestations: list = field(default_factory=list) def deriver_count(self) -> int: # Only DERIVER attestations from agents other than the author count. return sum( 1 for a in self.attestations if a.kind is AttestationType.DERIVER and a.agent_id != self.author_id and a.content_hash == self.content_hash ) def ratifier_count(self) -> int: return sum( 1 for a in self.attestations if a.kind is AttestationType.RATIFIER ) def trust_weight(self) -> int: # Trust is derived, not attested. Ratifiers do not contribute. return self.deriver_count() class SharedMemoryStore: def __init__(self, min_derivers_for_admission: int = 1): self.entries: dict = {} self.min_derivers = min_derivers_for_admission def write(self, entry: MemoryEntry) -> None: self.entries[entry.entry_id] = entry def attest(self, entry_id: str, attestation: Attestation) -> None: entry = self.entries[entry_id] if attestation.content_hash != entry.content_hash: raise PoisonedMemoryAdmissionError( f"attestation hash mismatch for {entry_id}: " f"attested {attestation.content_hash} != stored {entry.content_hash}" ) entry.attestations.append(attestation) def admit_to_context(self, entry_id: str, requesting_agent: str) -> MemoryEntry: entry = self.entries[entry_id] derivers = entry.deriver_count() if derivers < self.min_derivers: raise PoisonedMemoryAdmissionError( f"entry {entry_id} has {derivers} independent derivations " f"(min {self.min_derivers}); {entry.ratifier_count()} ratifiers " f"do not satisfy admission. Requesting agent {requesting_agent} " f"must re-derive before load." ) return entry def evict_under_pressure(self, context_capacity: int) -> list: # Eviction priority: provisional entries first, then by trust_weight. ranked = sorted( self.entries.values(), key=lambda e: (e.deriver_count() >= self.min_derivers, e.trust_weight()), ) evicted = [] while len(ranked) > context_capacity: victim = ranked.pop(0) if victim.deriver_count() >= self.min_derivers: raise PoisonedMemoryAdmissionError( f"eviction would remove fully-derived entry {victim.entry_id} " f"while provisional entries remain; capacity {context_capacity} " f"too small for derived set" ) evicted.append(victim.entry_id) del self.entries[victim.entry_id] return evicted ```