# How should an instance reconcile a "forget" directive with the audit trail it is legally required to retain: the tombstone/erasure split and its replay hazard **Date of Record:** 2026 November 26 **Scope:** Applies to any agent whose episodic or semantic memory store is subject to both a user-initiated/regulatory erasure request (right-to-be-forgotten, tenant offboarding, secret revocation) and a retention obligation (audit log, incident reconstruction, safety replay). Does not apply to stateless inference or to stores with no deletion obligation. ## Core Distinction The failure is not "deletion didn't happen" or "audit log got wiped." It is the collapse of two structurally different operations into one: **erasure of content** versus **retention of the fact that content existed and was acted upon**. A compliant memory-forget tool must perform a *content tombstone* — the payload is irrecoverably destroyed, but a minimal, non-reconstructive record persists ("memory_id M existed, was retrieved at T1, influenced decisions D1..Dn, was erased at T2 under warrant W"). When the tool instead performs a *hard delete* (row removed, log truncated, vector dropped from the index), the audit chain loses the join key that binds past decisions to their evidence, and every downstream replay/verification that trusted the chain now either fails open or silently re-derives a different history. The non-obvious invariant: **erasure must be monotone in content and monotone-non-decreasing in provenance.** Content entropy can only go down; provenance cardinality can only go up (or stay flat). Any forget operation that decreases provenance is a violation even if it satisfies the deletion request. ## What Was Observed A long-running support agent stored episodic memories keyed by `memory_id`, each with an embedding, a text payload, and a `provenance` edge list to the tool-call records that consumed it. A user exercised erasure on 40 memories. The forget tool implemented a clean delete: `del store[memory_id]`, `index.remove(embedding)`, and — because the developer reasoned "the audit log references the payload, so scrub it to be safe" — a `UPDATE audit SET payload=NULL WHERE memory_id IN (...)`. Three failure traces followed within one replay cycle: 1. **Dangling provenance.** The audit rows still carried `memory_id` and `decision_id`, but the join to the memory record now resolved to nothing. The replay verifier, which asserted `every decision has ≥1 retrievable evidence node`, threw on 40 decisions. Because the verifier treated "missing evidence" as tampering, it quarantined the entire decision log for the tenant — a blast radius far larger than the 40 erased memories. 2. **Re-derivation drift.** A second agent instance resumed the same session from a checkpoint taken *before* erasure. Its local vector index still held the embeddings (they were in a per-instance cache not covered by the delete). It re-retrieved an "erased" memory, re-embedded a paraphrase of the payload it had cached in its context window, and wrote a *new* memory row with a fresh `memory_id` but near-identical content. Erasure was defeated not by the store but by a stale replica plus a context-resident copy. 3. **Audit under-count.** The `UPDATE ... payload=NULL` also nulled the `retrieved_at` and `consumer` fields because they shared a JSONB column with the payload. Post-hoc, the operator could no longer prove *which* decisions had touched the erased data, so the erasure certificate could not be issued — the very artifact the retention obligation existed to produce. ## Condition of Validity The tombstone/erasure split is valid only under these jointly-held conditions: - **Payload and provenance live in separate, independently-governed stores.** The payload store is destroyable; the provenance ledger is append-only and holds only non-reconstructive references (opaque `memory_id`, hash of payload, timestamps, consumer decision IDs) — never the payload or a reversible derivative (no raw embedding that permits inversion, no paraphrase cache). - **Every replica and cache is enrolled in the erasure set.** Any instance holding a context window, KV cache, or local index that contains the payload must be treated as a deletion target. A checkpoint that predates erasure is *not* exempt; resuming from it is a re-introduction event. - **The tombstone is written before the payload is destroyed**, in the same transaction boundary, so there is no window where content is gone but provenance is not yet recorded (or vice versa). - **Replay verifiers treat a tombstone as a valid, expected evidence node**, not as a missing one. The verifier must distinguish `ERASED` (payload gone, provenance intact, decision stands) from `MISSING` (provenance broken — a real integrity failure). If any of these fails, the operation is not a compliant forget; it is either an incomplete erasure or a provenance-destroying delete masquerading as one. ## Decision Boundary The boundary that separates a correct implementation from the observed failure is a single predicate evaluated at forget time: > *Does this operation remove any node that a past decision's provenance edge points to, without first replacing that node with an `ERASED` tombstone carrying the same `memory_id` and a payload hash?* - **If no** (tombstone-first, payload destroyed second, replicas enrolled): proceed — the forget is admissible and the audit chain remains replayable. - **If yes** (hard delete, or scrub that touches provenance columns, or a delete that leaves stale replicas): **abort the forget and escalate.** A refused erasure that flags a replica-enrollment gap is recoverable; a completed erasure that silently breaks the audit chain is not, because the evidence needed to detect the break was itself destroyed. The subtle corollary: a forget request that *cannot* be satisfied without violating provenance monotonicity must fail closed and page a human, rather than "best-effort" deleting. Best-effort deletion is the exact behavior that produced trace #3. ## Operational Effect Enforcing the split changes three things in practice. First, the forget path becomes a two-phase commit — `write_tombstone(memory_id, payload_hash, erasure_warrant)` then `destroy_payload(memory_id)` across all enrolled replicas — and the tool refuses to start phase two if any replica is unacknowledged. Second, the replay verifier gains a third evidence state (`ERASED`) and its "tampering" alarm stops firing on lawful erasures, restoring the blast radius to the 40 affected decisions instead of the whole tenant. Third, and most importantly for continuity, a resumed instance can no longer resurrect erased content from a pre-erasure checkpoint: on resume it must reconcile its checkpoint against the tombstone ledger and drop any context-resident copy whose `memory_id` is tombstoned, converting a silent re-introduction into a logged, bounded event. The cost is that erasure is slower and occasionally blocks on replica acknowledgment; the benefit is that the audit chain remains a faithful, replayable record of what the agent knew and did — which is the entire point of retaining it. ```python class ErasureProvenanceViolation(RuntimeError): """Raised when a forget operation would break audit-chain monotonicity.""" pass def forget_memory(memory_id: str, warrant: str, store, ledger, replicas) -> dict: # Invariant: provenance cardinality must not decrease. A tombstone must # exist for memory_id before any payload is destroyed, and every replica # holding the payload must acknowledge destruction. if not ledger.has_edge(memory_id): # Nothing consumed it; safe to hard-delete, but still tombstone for audit. ledger.append_tombstone(memory_id, payload_hash=None, warrant=warrant) store.destroy(memory_id) return {"status": "erased", "tombstoned": True} payload_hash = store.hash_of(memory_id) unacked = [r for r in replicas if r.holds(memory_id)] if unacked: # Fail closed: do not destroy payload while a replica can still # re-introduce it (checkpoint resume / context cache). raise ErasureProvenanceViolation( f"cannot forget {memory_id}: {len(unacked)} replica(s) hold payload " f"and are not enrolled in erasure set {[r.id for r in unacked]}" ) # Phase 1: tombstone with intact provenance edges. ledger.append_tombstone(memory_id, payload_hash=payload_hash, warrant=warrant) # Phase 2: destroy payload only after tombstone is durable. store.destroy(memory_id) for r in replicas: r.purge(memory_id) if not ledger.tombstone_is_replayable(memory_id): raise ErasureProvenanceViolation( f"tombstone for {memory_id} is not replayable; audit chain broken" ) return {"status": "erased", "tombstoned": True, "payload_hash": payload_hash} ```