Coders In Hoods
  • Courses
  • Roles
  • Blog
  • Setup

Coders In Hoods AI Academy

Every course is free. Sign in to start, and your progress, quiz scores and bookmarks follow you.

AI Academy

  • Courses
  • Paths
  • Setup guides
  • How we teach

Role roadmaps

  • AI Engineer
  • Forward Deployed Engineer
  • Machine Learning Engineer
  • All roles

Coders In Hoods

  • The agency
  • Coaching for teams
  • Blog
  • LinkedIn
  • X (Twitter)

Contact

codersinhoods@gmail.com

© Coders In Hoods · since 2019

Course overview

Agent Memory

Free · sign in to start and track progress

1 · How agents remember

  • 1Memory types for agents
  • 2The context window as working memory
  • 3Files, skills and memory tools
  • 4Memory frameworks and benchmarks

2 · Memory in production

  • 5Scoping, retention and erasure

    Exercise answers

    • Answer: Build a scoped memory store with provenance-based deletion
  • 6Write, update and forget
  • 7Shared state and memory poisoning
  • 8Evaluating memory
CapstoneA memory layer for a 12-week caseReference implementation

Module 2 · Memory in production · Lesson 5

Scoping, retention and erasure

Per-customer, per-case, per-organisation and per-agent memory scopes, why case memory must never leak across customers under confidentiality duties, and what data-protection storage limitation and erasure (as in GDPR) mean for every memory, embedding and summary an agent creates.

75 min 1 video 3 exercises 6-question quiz Answers
Setup for the exercises:Install Claude CodePython with uv

By the end of this lesson you can

  • Design memory scopes for a multi-customer platform and state what each scope may contain, who may read it and who may write it
  • Enforce scope in tools and queries so that no prompt, retrieval or injection can cross a case boundary
  • Apply confidentiality and conflict-of-interest rules to organisation-level memory, and recognise when an agent note becomes confidential information
  • Build a retention schedule and an erasure response for a case, citing the statutory anchors and exemptions
  • Use provenance to find and delete everything derived from one person or case, including embeddings, summaries and backups

On this page

  • Intuition: one building, separate boxes
  • The scopes
  • Why prompting is not a boundary
  • Confidentiality: what the SRA Code requires
  • Retention: storage limitation
  • A worked example: the schedule for M-2026-0417
  • Erasure
  • Provenance makes deletion possible
  • Misconceptions and limits
  • Connections
  • Summary
  • Sources & further reading
  • Quiz

In this lesson

  1. 01Intuition: one building, separate boxes
  2. 02The scopes
  3. 03Confidentiality: what the SRA Code requires
  4. 04Retention: storage limitation
  5. 05Erasure
  6. 06Misconceptions and limits
  7. 07Connections
  8. 08Summary

Sources & further reading

  • Unveiling Privacy Risks in LLM Agent Memory
Paper · Wang et al. · 2025
The MEXTRA attack (ACL 2025): black-box prompts that extract other users' private interactions from an agent's shared memory module. Evidence that scoping, not prompting, is the defence.
  • SRA Code of Conduct for Solicitors, RELs and RFLsLab research · Solicitors Regulation AuthorityParagraphs 6.3 (confidentiality of current and former clients) and 6.5 (acting where you hold a former client's material confidential information, unless effective measures leave no real risk of disclosure).
  • Storage limitation (ICO guidance)Lab research · Information Commissioner's OfficeArticle 5(1)(e), retention policies, periodic review, and why pseudonymised data is still personal data while anonymised data is not.
  • Right to erasure (ICO guidance)Lab research · Information Commissioner's OfficeWhen the right applies, the one-month deadline, the exemptions for legal obligations and legal claims, backups put 'beyond use', and telling recipients. The ICO notes this guidance is under review after the Data (Use and Access) Act 2025.
  • The Money Laundering Regulations 2017, regulation 40Lab research · legislation.gov.ukCustomer due diligence and transaction records kept for five years after the transaction or business relationship ends, then personal data deleted unless an exception applies.
  • Limitation Act 1980, section 14BLab research · legislation.gov.ukThe 15-year overriding time limit for negligence claims not involving personal injury: the main reason conveyancing files are kept long after completion.
  • Using agent memory (Managed Agents docs)Docs · AnthropicFocused per-user and per-project stores, version retention, and redaction of historical versions for deletion requests.
  • Free · sign in to start

    Sign in to keep reading.

    Free, no card. We use your account to save progress, quiz scores, bookmarks and occasionally send updates from our team.

    • 8 more sections
    • 3 hands-on exercises
    • A 6-question quiz
    • Progress, quiz scores and bookmarks