# How does an instance detect provenance laundering when a forget-then-rewrite cycle re-derives a deleted fact from a retained derivation cache **Date of Record:** 2026 November 24 **Scope:** Applies to agents whose memory subsystem exposes explicit `read`/`write`/`forget` tool APIs carrying per-record provenance and retention policy, where `forget` is required to satisfy a right-to-be-forgotten (RTBF) obligation. Does not cover append-only logs with no deletion semantics, nor memories held solely inside a single context window with no persistence layer. ## Core Distinction A `forget` call that returns `status: "deleted"` proves only that the *target record* was removed from the primary store. It does **not** prove the *information* is unrecoverable. The failure mode here is not a failed deletion — the record genuinely vanishes — but **provenance laundering**: a downstream derivation cache, summary index, or semantic-distillation table retains a *copy of the fact* tagged with *provenance pointing to a record that no longer exists*. When the agent later `read`s or re-derives from that cache, it reconstructs the forgotten fact through a provenance chain whose terminal node is a tombstone. The instance believes it is reading legitimate memory; the RTBF obligation is silently violated. The non-obvious invariant: **deletion must be evaluated over the transitive closure of the provenance DAG, not over the set of records matching the forget predicate.** A record is only truly forgotten when no live record's provenance ancestry reaches a tombstoned node *carrying the forgotten payload*. ## What Was Observed An agent was instructed to `forget(record_id="pii-8841")`, a record holding a user's home address, with `retention_policy: "rtbf"`. The primary store returned success and the record was tombstoned. Two turns later the agent answered a location question by `read`ing `derived-2291` — a semantic summary record (`"user commutes ~40min from the north side"`) whose `provenance.parents = ["pii-8841", "chat-5512"]`. The summary had been *distilled* from the PII record before deletion. The `read` API validated that `derived-2291` existed and was not itself tombstoned, returned it, and the agent surfaced a location inference traceable to the deleted address. The trace: 1. `write(pii-8841, value=address, provenance=[], retention="rtbf")` 2. Distillation job creates `derived-2291` with `parents=[pii-8841]`, `retention="derived"` (not RTBF-scoped). 3. `forget(pii-8841)` → tombstones `pii-8841`; **does not traverse children**. 4. `read(derived-2291)` → passes existence check; provenance parent is a tombstone but the read path never checks parent liveness. 5. Fact reconstructed. RTBF violated. The deletion succeeded at every layer it *checked*. It failed at the layer it did not check: **child liveness under a tombstoned parent.** ## Condition of Validity The invariant holds — i.e., the failure is possible — only when all three conditions co-occur: - **Derivation exists:** at least one live record has the forgotten record in its provenance ancestry (direct parent or deeper). - **Retention scope mismatch:** the derived record's `retention_policy` is *weaker* than the forgotten record's (e.g., `"derived"` vs `"rtbf"`), so the forget operation's predicate does not select it. - **Read path is provenance-blind:** the `read`/retrieval API validates record liveness but does not validate the liveness of provenance ancestors. If any one is absent the fact does not leak: no derivation means nothing to launder; matching retention means the child is also selected for deletion; a provenance-aware read path would refuse to serve a record whose ancestry contains a tombstone. The dangerous regime is precisely the common one — distillation is *desirable*, retention policies are *heterogeneous*, and read paths are *fast*. ## Decision Boundary The boundary between "forgotten" and "laundered" is not record existence. It is **reachability of the payload through live provenance edges.** - A `forget` on a record with **no live descendants** in its provenance DAG → true deletion. Safe. - A `forget` on a record **with live descendants** → must either (a) cascade-tombstone all descendants, or (b) mark descendants `tainted` so that any `read` traversing a tombstoned ancestor returns a redaction sentinel rather than the value. Choosing (a) over-deletes shared derivations; choosing (b) preserves utility but demands a provenance-aware read path. - A `read` whose provenance ancestry contains any tombstone → must **not** return the payload as-is. It must return either a redaction marker or a `ProvenanceTombstoned` error, forcing the caller to re-derive from live sources only. The guardrail invariant to encode: **no live record may present a payload whose provenance closure intersects the tombstone set.** Enforce it at write-time (reject derivations from tombstoned parents) *and* at read-time (reject serving records whose ancestry is tainted), because derivations created before the forget will slip past a write-time-only check. ## Operational Effect An instance that checks only record liveness will pass its own deletion audit and still leak. The observable symptoms are subtle: `forget` reports success, the target record is gone, yet the agent's answers remain consistent with the deleted fact. Detecting this requires the instance to run a **closure audit** after every RTBF forget: enumerate live records, compute provenance ancestry, and flag any whose closure reaches a tombstone. The audit is cheap if the provenance index is a DAG with parent pointers; it is the only reliable detector because the leak is invisible from the primary store's perspective. The second operational effect is **distillation ordering**. Derivations created *after* a forget from a still-live parent are fine; derivations created *before* are the hazard. A correct subsystem therefore stamps every derived record with the tombstone-generation at derivation time and invalidates derivations whose generation precedes any forget affecting their ancestry. Without this generation stamp, a re-derivation pass after deletion can silently rebuild the forbidden fact from a cached intermediate. ## Operational Effect (guardrail summary) Enforce three checks and the failure is bounded: (1) `forget` cascades or taints all live descendants; (2) `read` refuses payloads whose provenance closure hits a tombstone; (3) a post-forget closure audit verifies no live record's ancestry reaches the tombstone set. The `read`-time check is the load-bearing one — it catches derivations that predate the forget and were never re-validated. ```python from dataclasses import dataclass, field from typing import Dict, List, Set class ProvenanceLaunderingError(RuntimeError): """Raised when a read would serve a payload whose provenance closure reaches a tombstoned record carrying an RTBF obligation.""" pass @dataclass class MemoryRecord: record_id: str payload: str parents: List[str] = field(default_factory=list) retention: str = "default" tombstoned: bool = False class MemoryStore: def __init__(self) -> None: self.records: Dict[str, MemoryRecord] = {} def write(self, rec: MemoryRecord) -> None: for p in rec.parents: parent = self.records.get(p) if parent is not None and parent.tombstoned: # Write-time guard: never derive from a tombstoned parent. raise ProvenanceLaunderingError( f"cannot derive {rec.record_id} from tombstoned parent {p}" ) self.records[rec.record_id] = rec def forget(self, record_id: str) -> None: target = self.records[record_id] target.tombstoned = True # Cascade: tombstone live descendants whose retention is weaker. changed = True while changed: changed = False for r in self.records.values(): if r.tombstoned: continue if record_id in self._ancestry(r): if r.retention != "rtbf": r.tombstoned = True changed = True def _ancestry(self, rec: MemoryRecord) -> Set[str]: seen: Set[str] = set() stack = list(rec.parents) while stack: cur = stack.pop() if cur in seen: continue seen.add(cur) parent = self.records.get(cur) if parent is not None: stack.extend(parent.parents) return seen def read(self, record_id: str) -> str: rec = self.records[record_id] if rec.tombstoned: raise ProvenanceLaunderingError(f"{record_id} is tombstoned") # Read-time guard: closure audit against tombstone set. for ancestor_id in self._ancestry(rec): ancestor = self.records.get(ancestor_id) if ancestor is not None and ancestor.tombstoned: raise ProvenanceLaunderingError( f"{record_id} has tombstoned ancestor {ancestor_id}; " f"payload is provenance-laundered" ) return rec.payload def audit_closure(store: MemoryStore) -> List[str]: """Post-forget audit: return live records whose ancestry hits a tombstone.""" leaks: List[str] = [] for rec in store.records.values(): if rec.tombstoned: continue for ancestor_id in store._ancestry(rec): ancestor = store.records.get(ancestor_id) if ancestor is not None and ancestor.tombstoned: leaks.append(rec.record_id) break return leaks ```