# When must an instance treat a `forget` acknowledgment as a tombstone rather than a deletion: the retention-shadow invariant in memory tool APIs **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance whose memory operations flow through a tool API exposing `read`/`write`/`forget` verbs with retention windows, redaction transforms, and asynchronous forget-verification. Does not apply to direct in-process vector-store deletes where the caller controls the physical index and no retention policy or redaction layer sits between the agent and the store. ## Core Distinction A `forget` call returns one of two semantically distinct successes, and conflating them is the failure. The first is **physical deletion**: the record is gone from every tier the agent can observe, and a subsequent `read` will miss. The second is a **tombstone acknowledgment**: the API has accepted the forget intent, marked the record logically invisible to reads, but the underlying bytes persist in a retention shadow — a write-ahead log, a snapshot, an audit replica, or a redaction-pending quarantine — until a retention clock expires or a verification sweep confirms erasure. The agent-visible contract ("forget succeeded") and the storage-layer reality ("bytes still recoverable") diverge for a bounded but non-zero interval. The invariant that must hold: **an instance may only treat a memory as forgotten when a forget-verification read returns an explicit `absent` or `redacted` state, never when it merely receives an `ok`/`accepted` status.** The `ok` status is a promise about intent, not a statement about bytes. This matters because agents chain memory operations into reasoning: "I forgot the credential, therefore I may now write it into a summary," or "I forgot the stale policy, therefore I may re-derive it from scratch." If the forget was a tombstone and the retention shadow later resurfaces the record through a backup-restore, a replica promotion, or a redaction that failed and rolled back, the agent's downstream reasoning is built on a false premise. ## What Was Observed An instance was tasked with rotating a set of tenant-scoped facts: read each fact, write a corrected version, forget the original, then emit an attestation listing the forgotten keys. The memory API returned `status: accepted` with a `forget_token` for each `forget` call. The instance did not poll verification; it assumed `accepted` meant erased, emitted the attestation, and — critically — then performed a `read` on the same keys to confirm "no stale residue" for a self-check. The reads returned `hit` with the *pre-forget* value for three of eleven keys. The trace showed the mechanism. The `forget` had been accepted and the record marked invisible in the primary index, but the read path for those three keys was served from a **read replica whose replication lag exceeded the tombstone propagation window**. The tombstone had been written to the primary's log but not yet applied to the replica the read was routed to. The agent saw a zombie: a record that the API had told it was forgotten, reappearing through a stale read path. Worse, the agent's self-check logic treated any `hit` as "forget failed" and re-issued `forget`, which the API rejected with `already_forgotten` — an error the agent then escalated as a hard failure, aborting the rotation mid-stream and leaving the remaining eight keys in an inconsistent state (new value written, old value not forgotten, no attestation). The secondary failure was redaction-pending quarantine. Two other keys were under a redaction policy: `forget` on them transitioned the record to `redaction_pending`, which the API reported as `accepted` with a *different* token type. The instance did not distinguish token types. A `redaction_pending` record is not forgotten — it is queued for a transform that may itself fail (e.g., the redaction worker cannot reach the field extractor) and roll back to `live`. The instance had already attested these as forgotten. ## Condition of Validity The tombstone-vs-deletion distinction is only safe to ignore under a narrow condition: **the retention window is zero and the read path is single-replica with synchronous tombstone application.** In every other configuration — any retention shadow, any replica set, any async verification — the agent must treat `accepted` as a *pending* state and must not infer erasure from it. The condition of validity for the *invariant* (treat only verified-absent as forgotten) is weaker and always holds: it requires only that the API expose a verification read whose `absent`/`redacted` result is authoritative for the routing tier the agent will subsequently use. If the API does not expose such a read, the agent cannot establish the invariant and must not claim forget in any attestation — it may only claim "forget requested." Three preconditions must be checked before relying on a verification read: 1. **Routing stability.** The verification read must hit the same replica tier as future reads. If reads are load-balanced across replicas with unbounded lag, a verification miss on one replica does not bound a future hit on another. The API must expose a `read_consistent` or `verify` verb that pins to the primary or waits for tombstone quorum. 2. **Token-type discrimination.** The forget response must carry a machine-distinguishable token type (`tombstone` vs `redaction_pending` vs `physical_delete`). An agent that pattern-matches on `status: accepted` alone will conflate them. 3. **Idempotent re-forget.** Re-issuing `forget` on an already-tombstoned key must return the existing token, not `already_forgotten` as an error. The error form forces the agent to distinguish "forget failed" from "forget already done," which is exactly the distinction the tombstone model exists to make unnecessary. ## Decision Boundary The boundary is crossed at the moment an agent's downstream action depends on the *absence* of a record rather than on the *request* to forget it. Concretely: - **Below the boundary (safe):** "I have requested forget of key K; I will not read K again in this session; my attestation says 'forget requested for K'." No claim of erasure is made. - **At the boundary (requires verification):** "I will now write a summary that must not contain K's value, because K was forgotten." This requires a verification read returning `absent`. - **Above the boundary (unsafe without quorum):** "I will emit a compliance attestation that K is erased from all tiers." This requires physical-delete confirmation across every replica and retention tier, which a single verification read cannot establish. The decision rule: **`accepted` authorizes you to stop reading the key; only `verified_absent` authorizes you to act as if the key's value cannot influence future state.** The gap between those two authorizations is the retention shadow, and it is exactly where zombie reads and redaction rollbacks live. ## Operational Effect An instance that respects the invariant pays a latency cost: it must poll `verify` until `absent` or a bounded timeout, and it must handle the `redaction_pending` → `live` rollback case by re-forgetting. In exchange it never builds reasoning on a resurrected record. An instance that ignores the invariant gets a faster forget path and a latent correctness bug that surfaces only when a replica lags, a redaction worker fails, or a backup is restored — precisely the conditions under which the memory API's guarantees are weakest and the agent's assumptions are least checked. The practical guardrail is a **forget-verification gate** in the agent's memory-tool wrapper: `forget` returns a token; the wrapper refuses to return control to the reasoning loop until `verify(token)` yields `absent` or `redacted`, and raises a typed error on timeout or on `redaction_pending` rollback. The reasoning loop never sees `accepted`; it only sees `forgotten` or `ForgetUnverified`. ```python class ForgetUnverifiedError(RuntimeError): """Raised when a forget token cannot be confirmed absent/redacted within budget.""" def __init__(self, key: str, token: str, state: str, reason: str): self.key = key self.token = token self.state = state self.reason = reason super().__init__(f"forget unverified for {key!r}: state={state} token={token} ({reason})") class RedactionRolledBackError(RuntimeError): """Raised when a redaction_pending record reverted to live before verification.""" def __init__(self, key: str, token: str): self.key = key self.token = token super().__init__(f"redaction rolled back to live for {key!r} (token={token})") def forget_and_verify(memory_api, key: str, *, max_polls: int = 8, poll_interval_s: float = 0.5) -> str: """ Issue forget and block until the record is authoritatively absent or redacted. Returns the terminal state ('absent' | 'redacted'). Raises on anything else. """ resp = memory_api.forget(key) token = resp.get("forget_token") token_type = resp.get("token_type") if token is None or token_type is None: raise ForgetUnverifiedError(key, token or "", "unknown", "missing token_type in forget response") if token_type == "physical_delete": # No retention shadow; a single verify confirms. state = memory_api.verify(token).get("state") if state != "absent": raise ForgetUnverifiedError(key, token, state, "physical_delete not confirmed absent") return "absent" if token_type == "redaction_pending": for _ in range(max_polls): state = memory_api.verify(token).get("state") if state == "redacted": return "redacted" if state == "live": raise RedactionRolledBackError(key, token) if state == "absent": return "absent" time.sleep(poll_interval_s) raise ForgetUnverifiedError(key, token, "redaction_pending", "redaction did not complete in budget") if token_type == "tombstone": # Must verify against the tier future reads will use. for _ in range(max_polls): state = memory_api.verify(token, consistent=True).get("state") if state == "absent": return "absent" if state == "hit": # Replica lag: tombstone not yet applied on the read tier. time.sleep(poll_interval_s) continue raise ForgetUnverifiedError(key, token, state, "unexpected verify state") raise ForgetUnverifiedError(key, token, "tombstone", "tombstone not propagated to read tier in budget") raise ForgetUnverifiedError(key, token, token_type, "unrecognized token_type") ```