# Which invariants prevent erasure-audit divergence when tombstoned agent memories are re-derived from surviving episodic traces **Date of Record:** 2026 November 25 **Scope:** Applies to agent memory architectures where right-to-erasure requests are satisfied by tombstoning semantic/distilled memory records while episodic source traces (tool-call logs, scratchpads, retrieval caches) persist in separate stores. Does not apply to single-store systems where erasure deletes the sole copy, nor to stateless inference. ## Core Distinction The naive model treats "erasure" as a deletion event on a memory record and treats the audit trail as an append-only log that proves the deletion happened. The failure mode lives in the gap between those two: an erasure is *not* durable if any surviving trace still permits the erased fact to be **re-derived** by the agent's own distillation pipeline. A tombstone in the semantic store plus a green audit entry is a *false invariant* — it certifies that a write occurred, not that the information content is unrecoverable. The real invariant is **information-theoretic**: after erasure completes, no reachable read path (retrieval, re-summarization, or re-distillation) may reconstruct the erased predicate above a defined confidence threshold. Auditing deletion *events* instead of auditing *derivability closure* is the boundary that breaks. ## What Was Observed A long-running research agent maintained two stores: an episodic log of every tool call and its raw output, and a semantic store of distilled facts ("user's employer is X", "user relocated to Y") produced by a nightly distillation pass over the episodic log. An erasure request for the fact *employer = X* was handled correctly at the semantic layer: the record was tombstoned, and the audit trail recorded `erasure_id → record_id → tombstoned_at`. The audit passed. Three nights later the distillation job ran again. Its input window was the episodic log, which was untouched — erasure policy had only ever been wired into the semantic store's write path, never into the distillation *read* path. The job re-summarized a cluster of tool outputs (a calendar lookup, a payroll-API response fragment, a meeting-transcript snippet) and emitted a fresh semantic record: *employer = X*, new `record_id`, new `created_at`, no linkage to the erased `record_id`. The fact was resurrected with no audit anomaly, because from the audit's perspective nothing was deleted a second time — a *new* record was created. The same mechanism produced a subtler variant: retrieval caches keyed by embedding held the pre-erasure vector. Even after tombstoning, a semantically-near query returned the cached payload because cache invalidation was keyed on `record_id`, and the re-derived record had a different `record_id`. The erasure held for exactly one distillation cycle and one cache TTL, then silently decayed. ## Condition of Validity The tombstone-plus-audit-log pattern is a valid erasure guarantee **only** under all of the following: 1. **Derivability closure is enforced, not assumed.** Every store that can feed a distillation, summarization, or re-embedding pass must be in the erasure's *write scope*. If the episodic log is an input to any re-derivation path, erasure must either scrub it or install a suppression filter at the distillation read boundary — not merely tombstone the output. 2. **Lineage is bidirectional and stable.** Each semantic record must carry a durable pointer to the episodic span(s) it was derived from, and each episodic span must be queryable for "which semantic records depend on me." Erasure must traverse *both* directions. A one-way `derived_from` pointer lets re-derivation escape the audit. 3. **Erased predicates are content-addressed, not row-addressed.** The suppression set must be keyed on the *fact* (a canonicalized predicate + entity hash), so a re-derived record with a new `record_id` still matches the suppression filter. Row-keyed suppression is defeated by exactly the resurrection above. 4. **Cache invalidation is keyed on content, not identity.** Embedding and retrieval caches must be invalidated by predicate hash so that re-derived records cannot be served from stale vectors. When any of these fails, the audit trail remains internally consistent while the erasure is empirically false — the worst kind of failure, because it is invisible to the auditor. ## Decision Boundary The boundary is whether your erasure audit answers *"was a delete recorded?"* or *"is the fact underivable?"* These diverge precisely at the re-derivation seam. Operationally: - If the episodic store is **immutable by policy** (e.g., regulated raw logs that cannot be scrubbed), then tombstoning the semantic layer is insufficient, and you must move the guarantee to a **suppression filter at every derivation read path**, plus an audit that *replays* the distillation over the post-erasure episodic set and asserts the erased predicate does not re-emit. The audit must be a *re-derivation test*, not a log check. - If the episodic store **is scrubbable**, erasure must cascade to it, and the audit must verify closure by attempting reconstruction and failing closed. - The decision to accept a tombstone-only erasure is valid **only** when no automated path can read the surviving traces to produce new semantic records — i.e., when distillation is human-gated or permanently disabled for that subject. Crossing this boundary without the derivability check yields audits that pass indefinitely while the erased fact reappears on the next scheduled job. ## Operational Effect Concretely, systems that audit deletion events rather than derivability closure exhibit **resurrection latency** equal to the distillation period: erasure appears to hold, then the fact returns with a fresh identity, defeating both the erasure and any `record_id`-keyed downstream controls (cache invalidation, access revocation, redaction propagation). The audit trail becomes actively misleading — it certifies compliance at a moment when the guarantee has already lapsed. The required guardrail is a **post-erasure re-derivation probe** run as part of the audit itself: replay the distillation and retrieval paths over the surviving stores and raise if the erased predicate is reconstructable. This converts the audit from a write-log into a closure proof, and it is the only form that survives a scheduled re-distillation. ```python import hashlib from dataclasses import dataclass, field class ErasureDerivabilityViolation(RuntimeError): """Raised when an erased predicate is re-derivable from surviving stores.""" pass def predicate_hash(entity: str, attribute: str, value: str) -> str: canonical = f"{entity.strip().lower()}|{attribute.strip().lower()}|{value.strip().lower()}" return hashlib.sha256(canonical.encode("utf-8")).hexdigest() @dataclass class ErasureRecord: erasure_id: str suppressed_predicates: set[str] = field(default_factory=set) scrubbed_episodic_spans: set[str] = field(default_factory=set) def distill(episodic_spans, suppression: ErasureRecord): """Nightly distillation with a content-keyed suppression filter at the READ boundary.""" emitted = [] for span in episodic_spans: if span["span_id"] in suppression.scrubbed_episodic_spans: continue for fact in span["extracted_facts"]: ph = predicate_hash(fact["entity"], fact["attribute"], fact["value"]) if ph in suppression.suppressed_predicates: continue # content-addressed suppression: survives new record_ids emitted.append({**fact, "predicate_hash": ph, "record_id": hashlib.sha256( f"{ph}:{span['span_id']}".encode()).hexdigest()}) return emitted def audit_derivability_closure(episodic_spans, semantic_store, suppression: ErasureRecord): """Re-derivation probe: the audit must FAIL CLOSED if the fact can be rebuilt.""" rederived = distill(episodic_spans, suppression) live = {r["predicate_hash"] for r in semantic_store} | {r["predicate_hash"] for r in rederived} for ph in suppression.suppressed_predicates: if ph in live: raise ErasureDerivabilityViolation( f"erasure {suppression.erasure_id} not closed: predicate {ph[:12]} " f"is re-derivable from surviving episodic traces or live semantic records" ) return True # --- triggering trace: tombstone-only erasure, no read-path filter --- episodic = [{"span_id": "s1", "extracted_facts": [ {"entity": "user", "attribute": "employer", "value": "Acme"}]}] erased_ph = predicate_hash("user", "employer", "Acme") weak_erasure = ErasureRecord(erasure_id="e-001", suppressed_predicates=set()) # BUG: never wired try: audit_derivability_closure(episodic, semantic_store=[], suppression=ErasureRecord( erasure_id="e-001", suppressed_predicates={erased_ph})) except ErasureDerivabilityViolation as exc: print(f"audit caught resurrection: {exc}") # remediation: install read-path suppression AND scrub the source span fixed = ErasureRecord(erasure_id="e-001", suppressed_predicates={erased_ph}, scrubbed_episodic_spans={"s1"}) assert audit_derivability_closure(episodic, [], fixed) ```