Memory Management, Delete When Able, Encrypt or Purge Stored Prompts and Results

ML systems, on their own, do not keep track of memory, past conversations, or retrieved information. As a result, many AI systems—especially LLMs—need an additional module to retrieve previous interactions as they process new information and generate responses. There are several notable examples of such memory integration:

  • Combining LangChain with vector databases enables AI agents to store and retrieve large volumes of past interactions.
  • LangGraph allows developers to construct hierarchical memory graphs for AI agents.⁠1
  • Such tools as mem0 and Zep facilitate the integration of memory into LLMs.⁠2

This control focuses on disabling, encrypting, or purging stored memory when it is no longer needed, thereby making it inaccessible for retrieval augmented by AI systems. Implementing these measures can help prevent unintended reuse of dangerous queries, exposure of private or sensitive data, and use of tool outputs generated during prior sessions.

How Does This Relate to the Rest of the Guide or Other Threats That the User Cares About?

  • MITRE ATLAS: LLM Prompt Injection⁠3
  • OWASP:
    • LLM06: Sensitive Information Disclosure
    • LLM07:2025—System Prompt Leakage⁠4
  • Leakage: II.DPPC-2, II.DPPC-3

Other Sources of Information About This Topic

On long-term memory management in LLMs, see

  • “What Is AI Agent Memory?” (IBM)⁠5
  • “NVIDIA Agent Intelligence Toolkit Memory Module” (NVIDIA)⁠6
  • “MemoryBank” (Proceedings of the AAAI Conference on Artificial Intelligence)⁠7
  • “Memory Management in Large Language Models (LLMs)” (Medium)⁠8
  • “Think‑in‑Memory” (arXiv)⁠9
  • “What Role Does Memory Play in the Performance of LLMs?” (Association of Data Scientists)⁠10
  • “A Survey on the Memory Mechanism of Large Language Model‑Based Agents” (ACM Transactions on Information Systems)⁠11

On prompt injection and data leakage, see

  • “What Is a Prompt Injection Attack?” (IBM)⁠12
  • “Understanding and Mitigating Data Leakage in Large Language Models” (Medium)⁠13
  • “LLM Data Leakage” (Cobalt)⁠14

On encrypted prompts, see

  • “Encrypted Prompt” (arXiv)⁠15
  • “Towards Encrypted Large Language Models with FHE” (Hugging Face)⁠16

Notes

  1. LangChain, “Memory Overviews.” Return to content
  2. Mem0, “Homepage”; Zep AI, “Homepage.” Return to content
  3. MITRE Corporation, “LLM Prompt Injection.” Return to content
  4. OWASP, “LLM07:2025 System Prompt Leakage.” Return to content
  5. Stryker, “What Is AI Agent Memory?.” Return to content
  6. NVIDIA, “NVIDIA Agent Intelligence Toolkit Memory Module.” Return to content
  7. Zhong et al., “MemoryBank.” Return to content
  8. Verma, “Memory Management in Large Language Models (LLMs).” Return to content
  9. Liu et al., “Think‑in‑Memory.” Return to content
  10. Kumar, “What Role Does Memory Play in the Performance of LLMs?.” Return to content
  11. Zhang et al., “A Survey on the Memory Mechanism of Large Language Model‑Based Agents.” Return to content
  12. Kosinski and Forrest, “What Is a Prompt Injection Attack?.” Return to content
  13. Tarunvoff, “Understanding and Mitigating Data Leakage in Large Language Models.” Return to content
  14. Obadiaru, “LLM Data Leakage.” Return to content
  15. Chan, “Encrypted Prompt.” Return to content
  16. Bredehoft and Frery, “Towards Encrypted Large Language Models with FHE.” Return to content