# What structural signals indicate a retention-policy tombstone has been silently resurrected by an embedding reindex **Date of Record:** 2026 November 26 **Scope:** Applies to agent memory subsystems exposing `read`/`write`/`forget` tool APIs where `forget` is implemented as a retention-policy tombstone (soft delete + redaction) rather than a hard row deletion, and where a separate embedding index is rebuilt or incrementally reindexed from the primary store. Does not apply to append-only logs with cryptographic erasure, nor to single-store memory where deletion and index mutation are atomic in one transaction. ## Core Distinction A `forget` call answers a *policy* question ("this datum must no longer influence agent behavior"), but a tombstone-plus-reindex architecture answers a *storage* question ("is the row gone?"). These diverge. The critical, non-obvious distinction is between **logical redaction** (the payload field is nulled, a tombstone flag is set, an audit record is appended) and **derived-state erasure** (every embedding, summary, episodic digest, and cached retrieval shard that *referenced* the payload is also invalidated). Most memory tool APIs implement the first and assume the second follows for free. It does not, because the vector index is a *derived artifact* rebuilt by a batch process that reads the tombstoned row, sees a null payload, and—absent an explicit tombstone-aware filter—reconstructs a semantically stale vector from a *neighboring* field (title, tags, prior summary) that survived redaction. The invariant that must hold: **for any tombstoned record, no embedding vector derived from its pre-redaction content may remain queryable after the reindex watermark advances past the tombstone's creation timestamp.** The structural signal that this invariant has been violated is a retrieval hit whose `source_record_id` resolves to a tombstoned row *and* whose `embedding_created_at` is *later* than the tombstone's `forgotten_at`. That single timestamp ordering is the whole diagnostic. ## What Was Observed A customer-support agent memory store held episodic records with fields `{id, payload, title, tags, embedding, forgotten_at, forgotten_reason, audit_seq}`. A `forget` call for record `ep_8841` (containing a user's PII) executed correctly: 1. `payload` set to `NULL`, `forgotten_at = T0`, `forgotten_reason = "gdpr_erasure"`. 2. Audit record appended at `audit_seq = 44127` with the redaction diff hash. 3. The `read` API immediately stopped returning `ep_8841` (tombstone filter on the primary store worked). Ninety minutes later a nightly incremental reindex ran. Its selection query was `SELECT id, title, tags FROM episodes WHERE payload IS NOT NULL OR updated_at > watermark`—written before tombstones existed and never updated. Because `updated_at` was bumped during redaction, `ep_8841` was *selected*. The embedder, receiving a record with a null payload, fell back to concatenating `title + tags` (a defensive default added for sparse records). The title was `"Refund for jane.doe@example.com"`. A fresh vector was written with `embedding_created_at = T1 > T0`. The result: `read` was clean; `search` was poisoned. A query for the user's email returned `ep_8841` as the top hit at cosine 0.94, with `payload` null but `title` still leaking the identifier. The audit trail was internally consistent—it faithfully recorded the redaction—but it had no record of the *resurrection*, because the reindex process wrote to the embedding table, not the audited episode table. ## Condition of Validity The tombstone-plus-reindex pattern is only safe under all of the following, and fails when any one is dropped: - **Reindex selection is tombstone-aware.** The selection predicate must be `forgotten_at IS NULL AND (...)` in addition to the watermark clause. A null-payload fallback in the embedder is a *latent* resurrection vector whenever selection is not tombstone-filtered. - **Redaction covers every embeddable field, not just the primary payload.** `title`, `tags`, precomputed `summary`, and any `prior_version` fields must be redacted or excluded from the embedder's input schema. The embedder's fallback path must be *schema-driven*, not heuristic. - **The embedding table carries a provenance timestamp** (`embedding_created_at`) comparable to `forgotten_at`. Without this, the resurrection is undetectable by query and the failure is silent. - **The audit trail records derived-artifact mutations**, not only primary-store mutations. If reindex writes bypass the audit log, the trail proves redaction happened but cannot prove erasure held. The condition fails specifically when the embedder has a *non-empty fallback* (title/tags/summary) combined with a *watermark-based* (not tombstone-based) selection. Either alone is survivable; together they resurrect. ## Decision Boundary The operative decision is: **when a tombstone and a reindex selection race, which wins?** Two defensible architectures: - **Tombstone-wins (recommended):** reindex selection excludes tombstoned rows unconditionally; the embedder rejects null-payload records with a hard error rather than falling back. Cost: sparse/legacy records fail to index and must be backfilled deliberately. Benefit: erasure is monotonic—once `forgotten_at` is set, no derived artifact can be created for that id. - **Watermark-wins (unsafe without a guard):** reindex processes everything past the watermark. This is only acceptable if the embedder is *incapable* of producing a vector from redacted fields (i.e., fallback disabled and all embeddable fields redacted). The moment a fallback field exists, watermark-wins becomes a resurrection channel. The boundary is crossed the instant an engineer adds "just in case" fallback logic to the embedder to improve recall on sparse records. That change is semantically a *policy regression* even though it reads as a recall improvement. It must be gated on a check that tombstoned ids are excluded from selection, and it must emit a reindex-time assertion. ## Operational Effect After the incident, the store adopted a **resurrection canary**: every `forget` writes a synthetic probe vector derived from the redacted fields' *pre-redaction* content into a shadow index, tagged with the record id. After each reindex, a verifier queries the live index for that probe; any hit with `embedding_created_at > forgotten_at` raises a hard failure and halts the reindex before the watermark advances. This converts a silent, weeks-latent privacy breach into a synchronous, per-batch abort. The verifier also audits `audit_seq` continuity: the count of embedding-table writes for tombstoned ids must be zero, and any nonzero count is reconciled against the audit log or flagged. The net effect is that `forget` now guarantees *derived-state* erasure, not merely payload nulling, and the guarantee is continuously proven by the canary rather than assumed from the redaction diff. ```python import time from dataclasses import dataclass from typing import Optional class ResurrectionDetected(RuntimeError): """Raised when a reindex produces a vector for a tombstoned record.""" pass @dataclass class Episode: id: str payload: Optional[str] title: str tags: list forgotten_at: Optional[float] = None forgotten_reason: Optional[str] = None @dataclass class Embedding: source_record_id: str vector: list embedding_created_at: float def reindex_batch(episodes, embedder, watermark: float, tombstone_aware: bool): """Rebuild embeddings for records past the watermark. INVARIANT: no embedding may be created for an episode whose forgotten_at is set, regardless of watermark position. """ out = [] for ep in episodes: selected = ep.forgotten_at is None or ep.forgotten_at > watermark if not selected: continue # Tombstone-wins guard: this is the line whose absence caused the incident. if tombstone_aware and ep.forgotten_at is not None: # Skip silently in production; assert in canary mode. continue text = ep.payload if text is None: # The dangerous fallback. Only legal if selection excluded tombstones. if ep.forgotten_at is not None: raise ResurrectionDetected( f"embedder fallback reached tombstoned record {ep.id} " f"(forgotten_at={ep.forgotten_at}); reindex selection " f"is not tombstone-aware" ) text = f"{ep.title} {' '.join(ep.tags)}" vec = embedder(text) out.append(Embedding(ep.id, vec, time.time())) return out def verify_no_resurrection(index: list, episodes_by_id: dict) -> None: """Post-reindex canary: any vector newer than its tombstone is a failure.""" for emb in index: ep = episodes_by_id.get(emb.source_record_id) if ep is None or ep.forgotten_at is None: continue if emb.embedding_created_at > ep.forgotten_at: raise ResurrectionDetected( f"record {ep.id} tombstoned at {ep.forgotten_at} but has " f"embedding created at {emb.embedding_created_at}; " f"derived-state erasure invariant violated" ) ```