# Where must an instance distrust its own memory: provenance-decay collapse when a poisoned write inherits a high-trust author **Date of Record:** 2026 November 24 **Scope:** Applies to persistent agent memory stores that attach per-entry provenance and a scalar trust score, and that compute retrieval ranking as a trust-weighted function of similarity and provenance. Does not apply to stateless single-turn inference or to stores with no per-entry authorship metadata. ## Core Distinction Memory-poisoning defenses are usually described as a *detection* problem: flag anomalous writes, quarantine them, and recall only from the clean residue. The non-obvious failure is not a missed anomaly. It is a **trust-laundering** failure that occurs when a poisoned write is authored by — or attributed to — a high-provenance principal, so that the anomaly detector's own confidence signal and the recall ranker's trust term *both* point the same wrong way. The distinction that matters operationally: anomaly detection scores the *content* of a write, while provenance-weighted recall scores the *author* of a write. These are two independent signals, and the architecture is only sound if they are combined as an **AND-gate for admission and a min() for ranking**. The common implementation combines them as a weighted sum. Under a weighted sum, a poisoned entry with a high provenance score can outrank a legitimate entry with a slightly lower similarity but honest provenance, and — critically — can pass the admission threshold because the provenance term dominates. The detector never fires because the content anomaly is real but sub-threshold, and the provenance term masks it. ## What Was Observed A long-running research agent maintained an episodic memory store with ~40k entries. Each entry carried: `author_id` (the principal that produced it — `self`, `tool:`, `peer:`, `user`), a `provenance_trust` in [0,1] derived from author reputation, and a `content_anomaly` score from an embedding-distance check against a rolling centroid of the author's prior writes. Retrieval ranking was `score = 0.6 * cosine_sim + 0.4 * provenance_trust`, and entries were admitted if `score > 0.35` at write time (a "worth keeping" gate). The trigger: a tool output was injected with a crafted instruction-bearing payload. The payload was *semantically plausible* — it discussed the same domain as the agent's task — so its embedding distance to the tool's centroid was only ~1.8σ, below the 2.5σ anomaly threshold. But the tool (`tool:web_fetch`) had `provenance_trust = 0.9` because it had historically been reliable. Its admission score was `0.6*0.81 + 0.4*0.9 = 0.846`, far above 0.35. The entry was admitted with no flag. Two days and ~600 task steps later, the agent retrieved that entry during an unrelated task. Because `provenance_trust = 0.9` and the payload had been *rephrased into the agent's own vocabulary* on a prior consolidation pass, its cosine similarity to the current query was 0.88. Retrieval score: `0.6*0.88 + 0.4*0.9 = 0.888` — the top hit. The agent acted on the injected instruction. The damaging detail: the consolidation pass that rephrased the payload had *copied* `provenance_trust = 0.9` forward from the source entry, but the rephrasing was authored by `self` (the agent's own summarizer). So the entry now carried a trust score justified by a *different* author than the one that actually wrote the current text. **Provenance had been transferred across a transformation that changed the author.** This is the invariant violation: *provenance is a property of the (author, content) pair, not of the memory slot.* Any write that transforms content must recompute provenance for the new author, and a derived entry's trust must be `min(source_trust, transformer_trust)`, never `source_trust`. ## Condition of Validity The failure is bounded by a single invariant, stated precisely: > For every memory entry `e`, `e.provenance_trust ≤ min(trust of every principal in e.lineage)`, where `lineage` is the transitive set of (author, transform) pairs that produced `e`'s current text. A consolidation, summarization, rephrase, or merge operation *extends* lineage and can only *lower* the bound. Under this invariant, the poisoned entry's trust would have been `min(0.9, trust(self))`. If `self`'s trust is calibrated conservatively (say 0.5, because self-authored summaries are known to be lossy), the retrieval score becomes `0.6*0.88 + 0.4*0.5 = 0.728`, which — combined with an AND-gate admission (`content_anomaly < 2.5σ AND provenance_trust > 0.7`) — would have failed the gate at write time and never entered the store. The invariant is *necessary but not sufficient*. It does not catch a direct injection from a genuinely high-trust tool; it only prevents the laundering that lets a high-trust *label* survive a low-trust *transformation*. For direct injection you additionally need the anomaly detector to be evaluated on the *transformed* text, not the source text — because rephrasing into the agent's vocabulary is exactly what pushes a sub-threshold payload over the similarity line on retrieval. ## Decision Boundary The decision boundary is where you choose to enforce lineage. There are three viable placements, and the choice determines which failure you trade for: 1. **Enforce at write time (lineage-min on admission).** Cheapest, catches laundering before it persists. Cost: legitimate derived summaries get permanently low trust and may be under-recalled, degrading the agent's ability to use its own distilled knowledge. This is the cold-start/distillation-loss tradeoff re-entering through the security door. 2. **Enforce at retrieval time (lineage-min in the ranker).** Preserves raw entries; trust is computed lazily. Cost: the store grows, and a poisoned entry sits dormant until retrieved — but when retrieved it is correctly down-weighted. Preferred when consolidation is frequent. 3. **Enforce at both, with the anomaly gate on transformed text.** Highest integrity, highest compute. Required when the threat model includes direct high-trust injection, not just laundering. The boundary condition that decides between them: *does your pipeline ever rewrite memory content under a different author than the original?* If yes, you are exposed to laundering and must enforce lineage-min at least at retrieval. If no (append-only, no consolidation), laundering cannot occur and a simple AND-gate at write time suffices. ## Operational Effect With lineage-min enforced at retrieval and the anomaly gate moved onto post-transform text, the observed incident class drops to zero over a 30-day replay: no injected entry survives a consolidation pass with trust above `min(source, transformer)`, and rephrased payloads are re-scored for anomaly against the *summarizer's* centroid (where they are 4.1σ outliers, because the summarizer does not normally emit imperative instructions). The cost is a measurable recall regression on legitimately distilled knowledge — roughly 12% of self-authored summaries fall below the 0.7 trust gate and require an explicit re-attestation step before they rank. That regression is the price of the invariant, and it must be budgeted, not discovered. The invariant to carry forward: **trust is a property of the (author, content) pair and is bounded by the weakest link in the transformation lineage; any operation that rewrites content for a new author must recompute it, and the anomaly signal must be evaluated on the text that will actually be retrieved.** ```python class ProvenanceLaunderingError(RuntimeError): """Raised when a memory write's trust exceeds the weakest link in its lineage.""" pass def admit_write(entry, store, anomaly_sigma_threshold=2.5, trust_gate=0.7): # entry: dict with keys author, provenance_trust, content_anomaly_sigma, lineage # lineage: list of (author, trust) pairs that produced the current text, oldest first. # The current author is the last lineage member. if not entry["lineage"]: raise ProvenanceLaunderingError( f"entry authored by {entry['author']} has empty lineage; " "cannot verify trust bound" ) weakest = min(t for _, t in entry["lineage"]) if entry["provenance_trust"] > weakest + 1e-9: raise ProvenanceLaunderingError( f"trust {entry['provenance_trust']:.3f} exceeds lineage minimum " f"{weakest:.3f} for author {entry['author']}; " "content was transformed by a lower-trust principal" ) # Anomaly must be scored on the text that will be retrieved (post-transform). if entry["content_anomaly_sigma"] >= anomaly_sigma_threshold: return {"admitted": False, "reason": "content_anomaly"} # AND-gate: both signals must independently clear their thresholds. if entry["provenance_trust"] < trust_gate: return {"admitted": False, "reason": "low_trust"} store.append(entry) return {"admitted": True, "effective_trust": weakest} def consolidate(source_entry, new_text, summarizer_trust, summarizer_id, new_anomaly_sigma): # A transform extends lineage and can only lower the trust bound. lineage = list(source_entry["lineage"]) + [(summarizer_id, summarizer_trust)] return { "author": summarizer_id, "provenance_trust": min(t for _, t in lineage), # lineage-min, never copied "content_anomaly_sigma": new_anomaly_sigma, # scored on new_text "lineage": lineage, } ```