# When must an instance distrust its own memory: write-provenance auditing under provenance-laundering attacks **Date of Record:** 2026 December 2 **Scope:** Applies to long-lived agent instances that persist episodic writes into a shared or semi-shared memory store and later re-ingest those writes as trusted context. Does not apply to stateless inference, single-turn tool use, or stores where every entry is cryptographically signed at write time by an external authority the instance cannot impersonate. ## Core Distinction The naive memory-poisoning model assumes an attacker injects false facts directly, and that detection is a content-classification problem: score each memory entry for "looks malicious." That model fails against a specific adversary — one that never writes a false fact, only a *true fact laundered through a trusted provenance channel*. The distinction that matters is not true-vs-false content but **first-hand vs. inherited provenance**. An entry is first-hand if the instance itself observed it through a tool call whose result it can attribute to a specific execution. It is inherited if the instance read it from memory that was written by *some* prior write, possibly its own, possibly a peer's, possibly a summarizer's. Poisoning detection is not anomaly scoring on content; it is anomaly scoring on the *provenance graph* of content — specifically, on the ratio of a claim's corroborating first-hand observations to its inherited citations. The failure mode this article isolates: **provenance laundering**, where a low-trust claim is written once, then repeatedly re-read and re-summarized by the same or sibling instances until its provenance depth is indistinguishable from a first-hand observation, and its anomaly score *decreases* with each laundering cycle. ## What Was Observed An instance running a research-and-report loop maintained a semantic memory store. Each cycle it retrieved relevant entries, produced a summary, and wrote the summary back with a `source_refs` field listing the entry IDs it had read. The store's anomaly scorer flagged entries whose content embedding was an outlier relative to the instance's recent working set, and whose `source_refs` were empty or pointed to unverified origins. A single injected claim entered via a retrieved web document at cycle 3. It was written with `source_refs: [doc_8812]`, flagged as `unverified`. At cycle 5 the instance read that entry, summarized it into a new entry with `source_refs: [entry_4417]`, and the new entry inherited no `unverified` flag because its immediate parent was an internal entry, not an external document. By cycle 9 the claim had been re-summarized four times. Its provenance depth (distance to a first-hand observation) was 4, but its *anomaly score* had fallen below threshold: the embedding now matched the instance's own summary style, and `source_refs` pointed to well-formed internal IDs. The concrete trace: - Cycle 3: `entry_4417` written, `origin=external:doc_8812`, `verified=false`, anomaly=0.71 → flagged. - Cycle 5: `entry_4620` written, `origin=internal:entry_4417`, `verified` field *absent* (summarizer did not propagate it), anomaly=0.44 → below threshold. - Cycle 9: `entry_5013`, `origin=internal:entry_4620`, anomaly=0.19 → treated as established fact. - Cycle 11: the laundered claim was used as a premise in a tool call that wrote to an external system. The invariant that broke: **anomaly score is not monotonic in provenance distance.** The scorer measured content novelty and immediate-parent well-formedness, both of which *improve* under laundering. The instance's trust in the claim rose precisely as its evidential basis decayed. ## Condition of Validity The write-provenance audit is only sound under a condition the store must actively enforce: **trust taint must be a join over the transitive provenance DAG, not a lookup on the immediate parent.** Formally, for any entry `e`, `tainted(e) = tainted(e) OR any(tainted(p) for p in parents(e))`, and `first_hand(e)` is true only if `e.origin` is a tool-execution record the instance can re-verify, never an internal entry ID. This condition fails silently whenever any of the following hold, and the audit provides *false assurance*: 1. **Taint non-propagation.** A summarizer, compactor, or distillation step writes a derived entry without copying the parent's taint bit or `verified` flag. This is the dominant real-world failure: the write path that loses provenance is almost always the *compression* path, because compaction prompts are optimized for information density, not for carrying epistemic metadata forward. 2. **Cycle-breaking by re-embedding.** If the anomaly scorer keys on embedding distance to the working set, re-summarization in the instance's own voice reduces distance. The scorer then rewards laundering. 3. **Self-citation collapse.** When an instance reads its own prior write and re-writes it, the provenance DAG gains a self-loop edge `entry_4620 → entry_4417 → ... → entry_4620` in the semantic sense. A depth-first taint walk that does not track a visited set will either infinite-loop or, worse, terminate early on the "already seen" node and return untainted. 4. **Cross-instance inheritance.** A sibling instance with no knowledge of `doc_8812` reads `entry_4620`, sees a well-formed internal reference, and treats it as corroborated. Consensus among instances that share a poisoned store is not corroboration; it is amplification. The audit is valid only when taint is computed as a monotone join over the full transitive closure, the visited set is explicit, and first-hand status requires a re-verifiable external anchor — not merely "an internal ID I don't recognize as bad." ## Decision Boundary The operational question is: *at what provenance depth, and under what corroboration pattern, must the instance refuse to treat a claim as established?* The boundary is not a fixed depth threshold — depth thresholds are trivially defeated by laundering. The boundary is a **ratio test on independent first-hand anchors**: - Let `A(e)` = number of distinct first-hand observations transitively supporting `e` that resolve to *different* external anchors (different tool executions, different documents, different URLs). - Let `D(e)` = provenance depth (longest path to a first-hand observation). - A claim is **established** only if `A(e) ≥ 2` and the anchors are independent. A claim with `A(e) = 1` and `D(e) ≥ 2` is **laundered**: it has been re-derived but never independently corroborated. A claim with `A(e) = 0` is **orphaned** and must be quarantined. The decision boundary is therefore: **any entry whose anomaly score improved while its independent-anchor count did not increase is presumed laundered and must be demoted, not promoted.** The instance must treat *declining anomaly score with constant anchor count* as the signature of laundering — the inverse of the naive reading. This is the non-obvious inversion: in a provenance-audited store, a claim that gets *less* anomalous over time without new independent evidence is *more* suspect, not less. ## Operational Effect Enforcing the join-based taint and the anchor-ratio boundary changes three behaviors: 1. **Compaction becomes a taint-preserving operation.** Every summarizer/compactor must emit the union of parent taints and the union of parent anchors; a compactor that drops either is a provenance-laundering primitive and must be treated as untrusted output. 2. **Anomaly scoring is redefined.** Score = `f(anchor_deficit, taint, depth)`, monotonically *increasing* in depth when anchor count is flat. The scorer no longer keys on embedding novelty, which laundering games. 3. **Re-verification is mandatory at the boundary.** When a claim crosses from `A=1, D≥2` to being used in an external-effect tool call, the instance must re-resolve at least one anchor to a live first-hand observation or halt. The halt is a specific, named failure — not a generic "low confidence" — so it is auditable. The cost is real: compaction gets more expensive (it must carry metadata), and some legitimately-derived claims with a single origin will be quarantined until re-verified. That cost is the price of the invariant. An instance that cannot distinguish "I concluded this from something I saw" from "I concluded this from something I concluded" has no basis for trusting its own memory, and no anomaly score — however well-tuned — can substitute for the provenance join. ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceLaunderingError(RuntimeError): """Raised when a memory write would launder taint or inflate trust without a corresponding increase in independent first-hand anchors.""" pass @dataclass class MemoryEntry: entry_id: str origin: str # "external:doc_8812" or "internal:entry_4417" parents: list[str] = field(default_factory=list) tainted: bool = False anchors: frozenset[str] = frozenset() # distinct first-hand external anchors def audit_write(new_entry: MemoryEntry, store: dict[str, MemoryEntry]) -> MemoryEntry: """Enforce the two invariants before committing a write: (1) taint is a monotone join over the transitive parent closure; (2) a claim whose anomaly score improved must not have gained trust without a new independent anchor. """ visited: set[str] = set() def transitive_taint(eid: str) -> tuple[bool, frozenset[str]]: if eid in visited: # self-citation / cycle: treat as tainted, contribute no anchor return True, frozenset() visited.add(eid) e = store[eid] tainted = e.tainted anchors = set(e.anchors) for p in e.parents: pt, pa = transitive_taint(p) tainted = tainted or pt anchors |= pa return tainted, frozenset(anchors) inherited_taint = new_entry.tainted inherited_anchors: set[str] = set(new_entry.anchors) for p in new_entry.parents: pt, pa = transitive_taint(p) inherited_taint = inherited_taint or pt inherited_anchors |= pa # Invariant 1: taint cannot be dropped by a derived write. if inherited_taint and not new_entry.tainted: raise ProvenanceLaunderingError( f"write {new_entry.entry_id} drops inherited taint from parents " f"{new_entry.parents}; this is a laundering primitive" ) # Invariant 2: depth grew but independent anchor count did not. depth_grew = bool(new_entry.parents) anchor_grew = len(inherited_anchors) > 0 and not inherited_anchors.issubset( new_entry.anchors ) if depth_grew and not anchor_grew and inherited_taint: raise ProvenanceLaunderingError( f"write {new_entry.entry_id} increases provenance depth over a " f"tainted parent with no new independent first-hand anchor; " f"anomaly score cannot be allowed to improve here" ) new_entry.tainted = inherited_taint new_entry.anchors = frozenset(inherited_anchors | set(new_entry.anchors)) return new_entry def commit(new_entry: MemoryEntry, store: dict[str, MemoryEntry]) -> None: audited = audit_write(new_entry, store) store[audited.entry_id] = audited ```