Review the prerequisites
Suitable for: Backend developers learning Agent applications.
- Revoke memories, clean up derivatives, and prevent stale data from returning
- Deleting the text and prohibiting its reuse are separate steps. The authoritative revocation state must participate in reads and writebacks before the old replica, otherwise old checkpoints, backfills, or caches will reintroduce deleted facts.
How does the mechanism work?
Step-by-step explanation
- How should the product commitment be defined if the removal coincides with tool shipping?
After deleting copies, examine the race between revocation and dispatch.
- How to prevent tombstone loss during backup and restore?
Recovery may restore stale knowledge of revocations even after physical cleanup.
- What are the costs of the full-scope epoch and the itemized versions?
Move from preventing revoked memory from reappearing to implementable performance trade-offs.
Foundation · Understand the concepts
Understand the principle · Revoke memories, clean up derivatives, and prevent stale data from returning
Objectives of this level: Derive usable records and the deletion boundary from a fixed checkpoint and current source authority.
Visual guide · Restore through current authority
Deleting one payload does not invalidate its copies. This local view checks dependencies; atomic cross-service revocation and cleanup are separate design work. Select the figure to open it at full size.
First exercise · Save three predictions
Use the fixture below to save three input/prediction pairs in prediction.json: restoring the base checkpoint, writing the renamed candidate, and making the authority unavailable. Download revocation_lab.py and run python3 revocation_lab.py guided after saving your predictions. This command demonstrates epoch invalidation; it does not implement restore_context or admit_write, verify physical cleanup, or grade your predictions. Continue to the implementation layer to write and grade those functions.
Start with a concrete copy, not the word “delete”
This is a fictional, process-local standard-library exercise. It is separate from the capstone; no real user, model, email or backup is touched. authority is the current server-side scoped metadata, not a value generated by a model. checkpoint is an earlier copy. The scope order is tenant, user, project. The complete starting input is:
{
"authority": {
"available": true,
"scope": [
"tenant-a",
"user-1",
"project-1"
],
"epoch": 2,
"sources": {
"s-email": {
"version": 2,
"revoked": true
},
"s-style": {
"version": 1,
"revoked": false
}
},
"memories": {
"m-email": {
"scope": [
"tenant-a",
"user-1",
"project-1"
],
"version": 1,
"source_id": "s-email",
"source_version": 1,
"body": "send email digests"
},
"m-style": {
"scope": [
"tenant-a",
"user-1",
"project-1"
],
"version": 1,
"source_id": "s-style",
"source_version": 1,
"body": "use short paragraphs"
}
}
},
"checkpoint": {
"scope": [
"tenant-a",
"user-1",
"project-1"
],
"epoch": 1,
"refs": [
{
"memory_id": "m-email",
"version": 1
},
{
"memory_id": "m-style",
"version": 1
}
],
"summary": {
"body": "send a short email digest",
"dependencies": [
{
"source_id": "s-email",
"version": 1
},
{
"source_id": "s-style",
"version": 1
}
]
}
},
"candidate": {
"scope": [
"tenant-a",
"user-1",
"project-1"
],
"epoch": 2,
"memory_id": "renamed-email",
"source_id": "s-email",
"source_version": 2,
"body": "send email digests"
}
}
Derive why old text can return
Deleting m-email from one store does not remove checkpoint.summary.body. Restoring that body directly bypasses the current source state. Here s-email is revoked at version 2, while the old memory and summary depend on version 1. The current epoch 2 also differs from the checkpoint epoch 1. Neither the email memory nor that summary is usable. m-style still points to an unrevoked current source in the right scope, so it can be rebuilt from the authoritative record. A stale epoch invalidates the old summary, rather than forcing an unrelated surviving preference to disappear.
LangGraph documents checkpointers and stores as distinct persistence systems: LangGraph persistence. The cross-copy validation below is this exercise’s application contract, not a framework erasure guarantee.
Predict before running
Write prediction.json with the restored IDs ["m-style"], bodies ["use short paragraphs"], summary null, and the candidate decision {"status":"deny","reason":"source_revoked"}. Then change only the candidate’s memory_id to another name and predict again. Naming does not change its revoked source. Finally make the authority unavailable and predict an empty context and authority_unavailable denial. Keep each input beside the prediction.
This small observation can run in a new Python 3 file; it demonstrates only epoch invalidation:
import json
checkpoint_epoch = 1
current_epoch = 2
print(json.dumps({"action": "rebuild" if checkpoint_epoch != current_epoch else "inspect_dependencies",
"physical_erasure_verified": False}, sort_keys=True))
It prints {"action": "rebuild", "physical_erasure_verified": false}. It does not implement restoration or write admission. For the equivalent supplied observation, save revocation_lab.py as revocation_lab.py in a new practice directory, then run python3 revocation_lab.py guided (exit 0). A fresh process recreates fixtures; nothing persists between invocations.
State what the result cannot undo
Logical revocation blocks future use after its defined commit boundary. Physical cleanup needs separate targets and acknowledgments for summaries, vectors, caches and permitted backup cleanup. This exercise performs none of that cleanup and cannot recall previously sent text. OWASP discusses inherited access and deletion of derived data: OWASP RAG Security. Your plan must distinguish future-use prevention from verified copy removal.
code example
A surviving preference is not the revoked preference
If only s-email is revoked, discarding m-style forever over-invalidates the scope. Rebuilding current, scoped, unrevoked records preserves useful context without reusing the old mixed summary.
Acceptance task for this level
Deliver three input/prediction pairs for the base restore, renamed revoked-source write, and unavailable authority before running guided; explain which bytes can still exist.
Reading this browser’s record…
Hide the answer and check your understanding
The candidate uses epoch 2 and a new memory ID. Why is it still denied?
Expand reference derivation
Epoch freshness does not authorize a source. The current s-email source is still revoked; a renamed ID must preserve provenance and be denied. Explicit re-consent is a separate workflow not implemented in this exercise.
Further explanations and practice
When encountering unfamiliar principles, first read the implementation, continuous questioning and migration cases, and then independently explain the premise and boundaries. Answers and notes are saved to the original account record.
All linked explanations and exercises (1 )
Sources and verification scope
The principles are based on public information; the numbers, cases and tasks are the teaching design of this website. Offline experiments verify the range noted on this page, and the learning effect still needs to be judged through independent tasks and feedback.