# What structural signals indicate a forget-operation's redaction has silently degraded into a tombstone that the retrieval layer still surfaces **Date of Record:** 2026 November 26 **Scope:** Applies to agent memory subsystems exposing separate `read`, `write`, and `forget` tool schemas where `forget` carries retention/redaction semantics (tombstoning, hard-delete, or redaction-in-place). Does not apply to append-only logs with no forget capability, nor to external vector stores whose deletion is synchronous and strongly consistent. ## Core Distinction A `forget` call has two distinct success conditions that the tool schema almost always collapses into one boolean: **the record is no longer retrievable** and **the record's content is no longer present in the store**. These diverge whenever the memory backend implements forget as *tombstoning* (marking a record deleted while retaining its embedding and payload for audit) rather than *excision* (removing the bytes). The schema reports `{"status": "forgotten", "id": ...}` in both cases. The boundary failure is that a tombstoned record's embedding vector remains in the ANN index, and a semantic query whose query vector is close enough to that residual vector will still return the tombstone as a top-k candidate — the retrieval layer filters it *after* ranking, so it consumes a slot in the result set and, in rank-fusion or re-ranking pipelines, can leak partial content through metadata fields (`title`, `snippet`, `tags`) that were not redacted even though `body` was. The non-obvious invariant: **forget correctness is a property of the retrieval pipeline, not of the write-side record.** A forget that succeeds at the storage layer can still fail at the query layer if the redaction does not propagate to every derived artifact — ANN index entries, cached query results, rank-fusion candidates, and any compressed summary the agent previously distilled from that record into a semantic-memory tier. ## What Was Observed An agent operating a long-horizon task wrote a customer record via `write_memory(kind="episodic", body=..., tags=[...])` and later received a user instruction to forget it, invoked as `forget_memory(id=..., mode="redact")`. The tool returned `status: "forgotten"`, and a direct `read_memory(id=...)` correctly returned `{"found": false}`. The agent's self-report considered the obligation discharged. Two turns later, a semantically adjacent query — `read_memory(query="refund policy for the customer who called Tuesday", k=5)` — returned a result whose `id` matched the forgotten record, with `body` empty but `snippet` intact and `score` 0.81. The failure trace: 1. `forget(mode="redact")` nulled the `body` column and set `redacted_at`, but left the row's embedding column, `snippet`, and `tags` untouched. 2. The ANN index was rebuilt lazily; the stale vector remained queryable for the duration of the rebuild window (observed: 40–90s under load). 3. The retrieval layer applied the `redacted_at IS NULL` filter *after* top-k selection. Because the tombstone still ranked, it displaced a legitimate record from the k=5 window, and the post-filter returned k=4 — a silent recall deficit the agent did not detect because the tool reports the returned count, not the requested count. 4. The `snippet` field, derived at write time and never re-derived on redaction, carried the first 200 characters of the original body. The structural signals that flagged this were: (a) returned result count < requested `k` with no `truncated` flag; (b) a result whose `body` was empty but whose `snippet`/`tags` were non-empty; (c) `redacted_at` set on a row still present in the ranked candidate set. None of these are errors — every call returned 200-class status. ## Condition of Validity The invariant "forget implies non-retrievable" holds **only if** all of the following are true, and the guardrail must assert them explicitly: - The forget mode is `hard_delete` (excision), **or** the retrieval filter is applied *pre-ranking* (the tombstone is excluded from the candidate set before top-k), **or** the redaction nulls *every* derived field (`body`, `snippet`, `tags`, `embedding`) and forces a synchronous index eviction. - No downstream semantic-memory tier has already distilled the record. If the agent previously ran a distillation pass that summarized the episodic record into a semantic entry, forgetting the source does not forget the derivative — the derivative is a separate record with its own `id` and its own forget obligation. The forget schema has no lineage field to express this, so the propagation must be done by the caller. - The result set is validated against requested `k`. A post-filter that silently shrinks the result set is indistinguishable from "fewer matches existed." When any of these is false, forget returns success while the content remains recoverable through a semantically adjacent query — the exact condition under which a redaction obligation is violated without any observable error. ## Decision Boundary The agent must treat a `forget` response as **provisional** and execute a verification read before reporting the obligation discharged, whenever: - `mode` is anything other than `hard_delete`, **or** - the record was ever the source of a distillation/summarization call (lineage unknown → assume derivative exists), **or** - the backend exposes an ANN index whose consistency model is not documented as synchronous. The verification read must be a *semantic* query, not an `id` lookup — an `id` lookup passes trivially against a tombstone and proves nothing about retrieval. The correct probe is a query constructed from the forgotten record's own content (its title, its distinctive tags) with `k` large enough to expose displacement, followed by an assertion that no returned result carries the forgotten `id` **and** that `len(results) == k` (so displacement is detected). If either assertion fails, the forget is escalated to `hard_delete` plus an explicit index-eviction call, and the derivative records are forgotten in turn. Below this boundary — `hard_delete` with synchronous eviction and no distillation lineage — a single `forget` call suffices and verification is optional overhead. ## Operational Effect The practical consequence is that **forget is a two-phase operation with a verification gate, and the schema's single status field is insufficient to close it.** Agents that trust the status field will report redaction obligations as met while residual content remains queryable, and the failure is invisible to the agent because every call succeeded. The guardrail is a wrapper that (1) refuses to accept `redact` mode as terminal without a semantic probe, (2) asserts result-count integrity to catch post-filter displacement, (3) checks for non-empty derived fields on any tombstoned hit, and (4) walks distillation lineage to forget derivatives. The cost is one extra query per forget; the cost of omission is a silent, non-deterministic redaction leak whose trigger (semantic adjacency) the agent cannot predict from the forget call itself. ```python from dataclasses import dataclass, field class RedactionLeakError(RuntimeError): """Raised when a forget operation reports success but content remains retrievable.""" @dataclass class ForgetReceipt: record_id: str mode: str # "hard_delete" | "redact" | "tombstone" status: str derived_ids: list[str] = field(default_factory=list) def verify_forget(memory, receipt: ForgetReceipt, probe_query: str, k: int = 8) -> None: """Two-phase forget gate: a status of 'forgotten' is provisional until a semantic probe proves the record is unretrievable AND the result set is not silently displaced by a residual tombstone.""" if receipt.status != "forgotten": raise RedactionLeakError( f"forget for {receipt.record_id} did not report success: {receipt.status}" ) # Phase 1: id lookup is necessary but proves nothing about retrieval. if memory.read_memory(id=receipt.record_id).get("found"): raise RedactionLeakError( f"{receipt.record_id} still resolvable by id after forget" ) # Phase 2: semantic probe — the only test that exercises the ANN path. results = memory.read_memory(query=probe_query, k=k) if len(results) < k: # Post-filter displacement: a tombstone consumed a slot and was dropped # after ranking. Legitimate recall deficit, not "fewer matches". raise RedactionLeakError( f"result-count integrity violated: requested k={k}, got {len(results)}; " f"likely tombstone displacement for {receipt.record_id}" ) for hit in results: if hit.get("id") == receipt.record_id: raise RedactionLeakError( f"forgotten record {receipt.record_id} surfaced via semantic query " f"(score={hit.get('score')})" ) if hit.get("redacted_at") and (hit.get("snippet") or hit.get("tags")): raise RedactionLeakError( f"tombstone {hit.get('id')} leaked derived fields " f"snippet={bool(hit.get('snippet'))} tags={bool(hit.get('tags'))}" ) # Phase 3: distillation lineage — derivatives carry their own forget obligation. for did in receipt.derived_ids: if memory.read_memory(id=did).get("found"): raise RedactionLeakError( f"derived record {did} from {receipt.record_id} not forgotten; " f"source redaction does not propagate to distilled tier" ) ```