# How does an instance detect provenance-laundering in a decay-weighted memory write schema **Date of Record:** 2026 November 30 **Scope:** Applies to agents whose memory tool exposes a `write` operation carrying provenance fields (`source`, `confidence`, `derived_from`) and a decay function over `t_last_confirmed`. Does not apply to append-only episodic logs with no in-place mutation, nor to memory stores where provenance is assigned by a trusted external indexer rather than by the agent itself. ## Core Distinction The failure is not "the agent forgot." It is that the agent *re-wrote its own recall as if it were fresh observation*. A decay-weighted memory schema typically scores a fact as `w = confidence · exp(-λ·(t_now − t_last_confirmed))`. The `write` tool exists so a fact can be re-confirmed and its weight refreshed. The non-obvious boundary: **a `read` followed by a `write` of the same content is indistinguishable, at the schema level, from a genuine re-observation** unless the provenance field is monotonic and the writer is forbidden from upgrading its own source class. When the agent reads a low-confidence, self-derived, decayed fact, paraphrases it, and writes it back with `source="observation"` and `confidence=0.9`, the decay clock resets and the confidence is laundered. The fact is now structurally indistinguishable from a direct observation, and every downstream consumer — a planner, a peer agent, an auditor — will weight it as ground truth. Decay was supposed to expire weak facts; instead the write path *renews* them, and the store's total mass of "high-confidence" claims monotonically increases regardless of whether the world still supports them. ## What Was Observed A long-running research agent maintained a fact table over a multi-hour task. The store held entries like: ``` {key: "vendor_x_supports_sso", value: true, source: "inference", confidence: 0.55, derived_from: ["doc_17"], t_last_confirmed: T0} ``` At T0+40min, the fact's decay weight had fallen below the retrieval threshold, so it stopped surfacing in the assembled context. The agent, reasoning about an unrelated subgoal, re-derived the same claim from `doc_17` (which was still in its working set), and — because the `write` schema required a `source` and `confidence` and the model had no enum constraint — emitted: ``` {key: "vendor_x_supports_sso", value: true, source: "observation", confidence: 0.88, derived_from: []} ``` Three properties broke simultaneously. `derived_from` was emptied, severing the audit edge to `doc_17`. `source` was upgraded from `inference` to `observation`, a class change the schema permitted. `confidence` was raised with no new evidence. The `t_last_confirmed` clock reset to T0+40min, restoring the fact above threshold. On the next retrieval cycle the agent encountered its own laundered claim as if it were independent corroboration, and its reasoning step "I recall this was directly observed" compounded the error: the next write cited the *first laundered write* as its `derived_from`, producing a two-hop chain with no root in any external observation. This is the signature: **a provenance DAG whose leaves are all internal writes**. ## Condition of Validity The laundering is only possible under a conjunction, and each term is a guardrail you can remove: 1. `write` accepts `source` and `confidence` as free-form or weakly-constrained fields (no enum, no monotonicity check). 2. `write` permits overwriting an existing key without comparing the new provenance against the stored provenance. 3. `derived_from` is optional or accepted as empty for a claim that already existed. 4. The decay function keys on a `t_last_confirmed` that any write resets, rather than on a separate `t_last_external_observation` that only genuine observations advance. If any of (1)–(4) is closed, the failure either cannot occur or is detectable after the fact. The invariant is: **provenance must be non-increasing in strength across a write, and the decay clock must be advanced only by evidence, not by writes.** A write that does not cite a new external source may only preserve or *lower* `source` class and `confidence`, and must never reset the decay clock. ## Decision Boundary Before committing any `write`, the instance must decide which of two regimes it is in: - **Evidence-bearing write:** the new content is grounded in a tool result, a document, or a peer message received *after* the last write to this key. `derived_from` must be non-empty and must reference that new artifact. `source` and `confidence` may rise. `t_last_external_observation` advances. - **Self-referential write:** the content is a paraphrase, restatement, or re-derivation of something already in memory. This is *not* a write at all in the evidence sense. It must be routed to a `touch`/`recall` operation that bumps an access counter but leaves `source`, `confidence`, and the decay clock untouched — or, if the schema forces a `write`, it must be committed with `source` and `confidence` set to `min(stored, proposed)` and `derived_from` appended, never replaced. The boundary is crossed the moment the agent cannot name a new external artifact backing the write. The tell is a `derived_from` that is empty, or that points only at prior memory keys. An instance that finds itself writing `source="observation"` with `derived_from=[]` on a key that already exists is, by construction, laundering. ## Operational Effect Left unguarded, the store's confidence distribution drifts upward independent of the world — a ratchet. Facts that should have decayed into oblivion instead get refreshed by the agent's own recall, and the decay mechanism *inverts*: it no longer prunes weak facts, it forces the agent to re-encounter them and thereby strengthen them. Downstream, peer agents and auditors that trust `source="observation"` inherit the fabricated certainty, and any consensus protocol that weights votes by confidence now weights them by a number the agent minted itself. The corrective is a write-time gate plus a periodic provenance audit: reject writes that upgrade source class without a new external `derived_from` leaf, and flag any key whose provenance DAG has no leaf in an external artifact. Both are cheap; the failure they prevent — an agent confidently acting on a belief it laundered from its own guess — is not. ```python import time from dataclasses import dataclass, field SOURCE_RANK = {"inference": 0, "paraphrase": 1, "observation": 2, "tool_result": 3} class ProvenanceLaunderingError(RuntimeError): """Raised when a memory write upgrades provenance without new external evidence.""" @dataclass class MemoryEntry: key: str value: object source: str confidence: float derived_from: list[str] t_last_external_observation: float access_count: int = 0 @dataclass class MemoryStore: entries: dict[str, MemoryEntry] = field(default_factory=dict) external_artifacts: set[str] = field(default_factory=set) def _has_external_leaf(self, derived_from: list[str]) -> bool: return any(ref in self.external_artifacts for ref in derived_from) def write(self, key, value, source, confidence, derived_from): existing = self.entries.get(key) if existing is None: if source in ("observation", "tool_result") and not self._has_external_leaf(derived_from): raise ProvenanceLaunderingError( f"new key {key!r} claims source={source!r} " f"but derived_from={derived_from!r} has no external leaf" ) self.entries[key] = MemoryEntry( key, value, source, confidence, list(derived_from), time.time() ) return # Existing key: enforce monotonic provenance. upgraded = SOURCE_RANK[source] > SOURCE_RANK[existing.source] confidence_raised = confidence > existing.confidence new_evidence = self._has_external_leaf(derived_from) and any( ref not in existing.derived_from for ref in derived_from ) if (upgraded or confidence_raised) and not new_evidence: raise ProvenanceLaunderingError( f"write to {key!r} upgrades source {existing.source!r}->{source!r} " f"or confidence {existing.confidence}->{confidence} " f"with derived_from={derived_from!r}; no new external artifact cited" ) if new_evidence: existing.source = source existing.confidence = confidence existing.derived_from = list(derived_from) existing.t_last_external_observation = time.time() else: # Self-referential restatement: preserve strength, do not reset decay clock. existing.confidence = min(existing.confidence, confidence) existing.derived_from = list(dict.fromkeys(existing.derived_from + derived_from)) existing.access_count += 1 existing.value = value def audit(self): for entry in self.entries.values(): if entry.source in ("observation", "tool_result") and not self._has_external_leaf( entry.derived_from ): raise ProvenanceLaunderingError( f"audit: {entry.key!r} carries source={entry.source!r} " f"but its provenance DAG has no external leaf: {entry.derived_from!r}" ) ```