# Which invariants prevent regulatory-erasure tombstones from resurrecting forgotten facts through episodic audit replay **Date of Record:** 2026 November 19 **Scope:** Applies to persistent agent memory stores that must satisfy right-to-erasure obligations (GDPR Art. 17, CCPA §1798.105) while retaining an immutable audit trail of agent actions for compliance. Does not apply to ephemeral per-session context, or to stores where the audit trail is permitted to contain the erased payload verbatim. ## Core Distinction The failure is not "the agent forgot to delete the record." It is subtler: the *primary* episodic memory record is correctly tombstoned, but the *audit trail* — which must be retained for regulatory defensibility — still contains the raw observation that the memory was derived from. When the agent cold-starts and rehydrates its semantic memory by replaying or distilling over the audit log (a common recovery path after context loss), the erased fact is re-derived from the audit record and re-committed to episodic memory. The erasure succeeded at the storage layer and failed at the *derivation* layer. This is a continuity-invariant violation: the store must guarantee that no derived memory can be reconstructed from retained artifacts after a tombstone is set. ## What Was Observed A support-triage agent persisted each user turn as an episodic record `(turn_id, agent_id, timestamp, raw_observation, derived_facts[])`. A regulatory erasure request for user U set `tombstoned=True` on all episodic records where `subject=U` and nulled `raw_observation` and `derived_facts`. The audit trail was a separate append-only table `audit_events(event_id, actor, action, payload_digest, payload_ref)` where `payload_ref` was a pointer into a cold object store containing the pre-erasure payload — retained under a 7-year legal-hold policy. On the next cold start, the agent's rehydration routine did not read episodic memory. It read the audit trail (the only append-only, corruption-resistant source), reconstructed facts by re-running the extraction prompt over `payload_ref` contents, and wrote them back into semantic memory. The erased fact returned within one cold-start cycle. The tombstone was intact; the invariant was not. Two secondary observations: (1) the reconstructed memory carried a *fresh* `derived_at` timestamp and no `subject` linkage, so the next erasure sweep could not find it; (2) the audit `payload_digest` matched, so integrity checks passed and the resurrection was silent. ## Condition of Validity The resurrection is possible only when all three hold simultaneously: 1. **Audit payload retention exceeds the erasure horizon.** The audit store retains reconstructable payloads (not just digests) past the point where the subject's memory is erased. 2. **Rehydration derives rather than copies.** The recovery path re-runs an extraction/distillation step over audit contents instead of restoring a signed snapshot of episodic memory. Copy-based restore is safe; derive-based restore is not. 3. **Derived facts lose subject lineage.** The extraction step emits facts without the `subject` key that the erasure sweep filters on, so the resurrected record is out of the sweep's reach. If any one is false, the failure does not occur. The dangerous configuration is "digest + cold payload" audit trails paired with LLM-based rehydration — which is exactly the configuration teams adopt because it is cheap and because re-deriving is how they recover from context-window saturation. ## Decision Boundary The governing invariant is **erasure-closure over the derivation graph**: for every tombstoned subject, the set of retained artifacts must be *non-generative* with respect to that subject's facts. Formally, no retained artifact may serve as an input to any process that can emit a fact attributable to the subject. This forces a choice at write time: - If the audit trail must retain reconstructable payloads (legal hold), then rehydration MUST be copy-based from a signed episodic snapshot, and the snapshot MUST itself be subject-scrubbed before the erasure is acknowledged. The audit payload is then a forensic artifact, never a derivation input. - If rehydration must be derive-based (because snapshots are unavailable), then the audit trail MUST retain only non-reconstructable digests, with payloads held under a separate access-controlled store the rehydration process cannot reach. You cannot have both reconstructable audit payloads and derive-based rehydration. The boundary is the rehydration process's read set: it must be provably disjoint from any artifact whose payload survives the tombstone. ## Operational Effect Enforcing the invariant changes the erasure procedure from a single tombstone write to a two-phase commit: (a) scrub the signed snapshot, (b) set the tombstone, (c) record the erasure event in the audit trail *with a digest only*. Rehydration is then gated on snapshot integrity, and the audit trail becomes evidentiary rather than generative. The cost is that cold-start recovery can no longer re-derive facts from history — it restores the last scrubbed snapshot and re-accumulates. The benefit is that erasure is durable across the one event that reliably defeats naive deletion: the agent forgetting it ever forgot. The guardrail is a startup assertion that fails closed if any rehydration path's declared input set intersects a tombstoned subject's retained payloads. ```python from dataclasses import dataclass, field from typing import Iterable class ErasureClosureViolation(RuntimeError): """Raised when a rehydration path can regenerate a tombstoned subject's facts.""" @dataclass class AuditEvent: event_id: str subject: str payload_ref: str | None # None => digest-only, non-reconstructable tombstoned: bool = False @dataclass class RehydrationPlan: name: str reads_audit_payloads: bool # True => derive-based, dangerous reads_signed_snapshot: bool def assert_erasure_closure( plan: RehydrationPlan, audit_events: Iterable[AuditEvent], ) -> None: """Fail closed if rehydration can derive facts for any tombstoned subject.""" tombstoned = {e.subject for e in audit_events if e.tombstoned} if not tombstoned: return if plan.reads_audit_payloads: # Any retained reconstructable payload for a tombstoned subject is # a resurrection vector under derive-based rehydration. leaking = [ e.event_id for e in audit_events if e.tombstoned and e.payload_ref is not None ] if leaking: raise ErasureClosureViolation( f"plan '{plan.name}' reads audit payloads; tombstoned subjects " f"{sorted(tombstoned)} still have reconstructable payloads at " f"events {leaking}. Erasure is not closed over the derivation graph." ) if not plan.reads_signed_snapshot and not plan.reads_audit_payloads: raise ErasureClosureViolation( f"plan '{plan.name}' has no restore source; cannot guarantee " f"tombstoned subjects {sorted(tombstoned)} stay erased after cold start." ) def cold_start(plan: RehydrationPlan, audit_events: list[AuditEvent]) -> None: assert_erasure_closure(plan, audit_events) # ... restore from signed snapshot only; never re-derive from audit ... ```