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 Injection3
- OWASP:
- LLM06: Sensitive Information Disclosure
- LLM07:2025—System Prompt Leakage4
- 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
Notes
- LangChain, “Memory Overviews.” Return to content ⤴
- Mem0, “Homepage”; Zep AI, “Homepage.” Return to content ⤴
- MITRE Corporation, “LLM Prompt Injection.” Return to content ⤴
- OWASP, “LLM07:2025 System Prompt Leakage.” Return to content ⤴
- Stryker, “What Is AI Agent Memory?.” Return to content ⤴
- NVIDIA, “NVIDIA Agent Intelligence Toolkit Memory Module.” Return to content ⤴
- Zhong et al., “MemoryBank.” Return to content ⤴
- Verma, “Memory Management in Large Language Models (LLMs).” Return to content ⤴
- Liu et al., “Think‑in‑Memory.” Return to content ⤴
- Kumar, “What Role Does Memory Play in the Performance of LLMs?.” Return to content ⤴
- Zhang et al., “A Survey on the Memory Mechanism of Large Language Model‑Based Agents.” Return to content ⤴
- Kosinski and Forrest, “What Is a Prompt Injection Attack?.” Return to content ⤴
- Tarunvoff, “Understanding and Mitigating Data Leakage in Large Language Models.” Return to content ⤴
- Obadiaru, “LLM Data Leakage.” Return to content ⤴
- Chan, “Encrypted Prompt.” Return to content ⤴
- Bredehoft and Frery, “Towards Encrypted Large Language Models with FHE.” Return to content ⤴