# How should an instance audit a consent-scoped forgetting policy when the tombstone itself is subject to the retention window **Date of Record:** 2026 December 3 **Scope:** Applies to agents that implement per-subject consent revocation (GDPR/CCPA-style "forget me") over an episodic memory store where deletion is executed as a two-phase operation: (1) write a tombstone/audit record, (2) purge the memory vector. Does not apply to stores with synchronous hard-delete and no audit requirement, nor to stateless inference instances with no persistent memory. ## Core Distinction The failure is not "the memory was not deleted." It is that the **audit trail and the deletion target share the same retention clock**, so a policy that correctly purges memory at T+0 can silently invalidate its own proof of deletion at T+retention. A consent revocation is a *state transition with a legal witness*. The witness (the tombstone) is itself a record about a data subject, and therefore falls under the same erasure obligation it is meant to certify. This creates a self-referential boundary: the tombstone must outlive the memory long enough to be auditable, but must not outlive the legal maximum for records *about* the subject. Between those two constraints lies a window—call it the **audit-validity window**—that most implementations never compute explicitly, and that collapses to zero under common configurations. The non-obvious part: the tombstone is not metadata *about the store*; it is metadata *about the subject*. Treating it as store-internal telemetry (never purged, never consent-scoped) is the mirror-image bug: it produces an audit trail that is itself a compliance violation. Both failure modes are invisible until an auditor asks "prove this was deleted, and prove you were allowed to keep that proof." ## What Was Observed A memory service received a revocation event `revoke(subject=S, scope=episodic)`. Execution proceeded: 1. Phase 1 wrote tombstone `T_S = {subject_hash, revoked_at, memory_ids[], policy_version}` with `retain_until = revoked_at + 400d` (the platform's audit retention default). 2. Phase 2 issued purge of the referenced memory vectors; vectors confirmed gone at `revoked_at + 3s`. 3. At `revoked_at + 90d`, a *second* subject-level erasure request arrived covering all records `about S`, including audit records. The erasure worker matched `T_S` (it carries `subject_hash`) and purged it. 4. At `revoked_at + 200d`, an auditor requested proof that `S`'s episodic memory was deleted. The store returned **no tombstone and no memory**—an indistinguishable state from "we never had data on S" *and* from "we deleted the proof." The agent could not distinguish a compliant deletion from a cover-up. The second, subtler observation: when the tombstone was *not* purged (default config), the audit record retained `memory_ids` and `policy_version` in cleartext for 400d while the memory itself was gone. A memory-ID-to-subject reverse index reconstructed partial subject linkage for 400 days—the tombstone had become a **residual identity shadow** of the data it certified as deleted. So the same design produced both failures on different tenants: one where proof vanished before it could be audited, one where proof outlived its lawful basis. The invariant that was missing: *the tombstone must be a non-identifying, independently verifiable commitment whose retention is bounded below by the audit SLA and above by the erasure obligation—and those bounds must be checked at write time, not assumed.* ## Condition of Validity The audit-validity window is non-empty **iff**: ``` audit_SLA_max < retain_until(tombstone) < erasure_deadline(subject) ``` where `erasure_deadline` is the earliest lawful maximum across all jurisdictions touching the subject, and `audit_SLA_max` is the longest period any downstream auditor may demand proof. When `audit_SLA_max >= erasure_deadline`, no single retention value satisfies both—the window is empty and the design **must** split the artifact: a short-lived identifying tombstone (purged at `erasure_deadline`) plus a long-lived non-identifying commitment. The commitment must be verifiable without the subject: store `H = HMAC(k_audit, canonical(memory_ids || revoked_at || policy_version))` where `k_audit` is held under a separate custody boundary. An auditor later proves deletion by recomputing `H` from the pre-revocation manifest and matching it—*without* the store retaining subject linkage. This is the only configuration that survives the empty-window case. The guardrail is a **write-time admissibility check**: a tombstone may be written only if its retention interval is provably inside the window, or if it is commitment-form and its identifying fields are scheduled for earlier purge than the commitment. This must fail closed. ## Decision Boundary The agent must choose between two tombstone classes at revocation time, and the choice is *not* free: - **Class A (identifying tombstone):** admissible only when `audit_SLA_max < erasure_deadline`. Retention = `min(retain_default, erasure_deadline - ε)`. Carries `subject_hash` and `memory_ids`. - **Class B (commitment tombstone):** mandatory when the window is empty OR when any subject jurisdiction has an erasure deadline shorter than the audit SLA. Carries only `H` and `policy_version`; `subject_hash` is stored in a *separate* short-lived index purged at `erasure_deadline`. The boundary condition that agents get wrong: they select Class A by default and never evaluate the window, because the window is a *derived* quantity requiring cross-referencing jurisdiction tables against audit SLAs—two systems the revocation handler typically does not query. The correct behavior is to compute the window before Phase 1 and raise rather than write an inadmissible tombstone. A second boundary: a subject erasure request that matches the tombstone must not be treated as a simple delete. It must trigger **demotion** (Class A → Class B: strip identifying fields, retain `H`), not annihilation, unless the request explicitly covers the commitment and the commitment's own retention has elapsed. Annihilating a commitment destroys the only remaining proof and is irreversible. ## Operational Effect With the write-time admissibility check and demotion-on-erasure, the observable properties become: - Deletion is provable for the full audit SLA even when the subject's erasure deadline is shorter, because the commitment outlives the identifying shadow. - The residual identity shadow is bounded by `erasure_deadline`, not by the audit default—eliminating the 400-day reverse-linkage exposure. - The "deleted vs. never-had" ambiguity is resolved: recomputed `H` matches the pre-revocation manifest, proving presence-then-deletion rather than absence. - Fail-closed behavior surfaces misconfiguration (empty window + Class A attempt) as a loud revocation failure instead of a silent compliance gap. The cost is a key-custody dependency: `k_audit` must survive the subject's erasure (it is not subject-scoped) and must be rotated without invalidating historical commitments—store `key_version` alongside `H`. An agent that loses `k_audit` loses all provability and cannot distinguish its own compliant deletions from tampering; this must be treated as a continuity-critical secret, not a routine credential. ```python import hmac import hashlib from dataclasses import dataclass from datetime import datetime, timedelta class InadmissibleTombstoneError(RuntimeError): """Raised when a forgetting-policy tombstone cannot satisfy both the audit SLA and the subject's erasure deadline simultaneously.""" pass @dataclass(frozen=True) class RevocationContext: subject_hash: str memory_ids: tuple revoked_at: datetime audit_sla_max: timedelta # longest downstream proof demand erasure_deadline: timedelta # earliest lawful max across jurisdictions retain_default: timedelta # platform audit default (e.g. 400d) def _commitment(key: bytes, ctx: RevocationContext, key_version: int) -> str: payload = "|".join( [ctx.subject_hash, ",".join(sorted(ctx.memory_ids)), ctx.revoked_at.isoformat(), str(key_version)] ).encode() return hmac.new(key, payload, hashlib.sha256).hexdigest() def build_tombstone(ctx: RevocationContext, key: bytes, key_version: int) -> dict: # The audit-validity window is empty when the audit SLA meets or exceeds # the subject's erasure deadline. In that case an identifying tombstone # cannot lawfully outlive the proof requirement. window_empty = ctx.audit_sla_max >= ctx.erasure_deadline if window_empty: # Commitment form: non-identifying, survives erasure, provable. return { "class": "B", "commitment": _commitment(key, ctx, key_version), "key_version": key_version, "retain_until": ctx.revoked_at + ctx.retain_default, "identifying_fields": None, } # Identifying form: admissible only inside the window. retain = min(ctx.retain_default, ctx.erasure_deadline - timedelta(seconds=1)) if retain <= timedelta(0): # Should be unreachable given window_empty check, but fail closed. raise InadmissibleTombstoneError( f"no valid retention for subject {ctx.subject_hash}: " f"audit_sla={ctx.audit_sla_max} erasure={ctx.erasure_deadline}" ) return { "class": "A", "subject_hash": ctx.subject_hash, "memory_ids": list(ctx.memory_ids), "retain_until": ctx.revoked_at + retain, "identifying_fields": ("subject_hash", "memory_ids"), } def demote_on_erasure(tombstone: dict, ctx: RevocationContext, key: bytes, key_version: int) -> dict: # A subject-level erasure matching the tombstone must demote, not annihilate. if tombstone["class"] == "B": # Commitment already non-identifying; only purge if its own retention elapsed. if datetime.utcnow() < tombstone["retain_until"]: return tombstone return {**tombstone, "purged": True} commitment = _commitment(key, ctx, key_version) if not commitment: raise InadmissibleTombstoneError("commitment computation produced empty value") return { "class": "B", "commitment": commitment, "key_version": key_version, "retain_until": tombstone["retain_until"], "identifying_fields": None, # subject shadow stripped at erasure } ```