Combining Long-Term Memory and LLMs Comes at a High Cost: From Prompt Injection to Persistent Compromise
On the map: LLM safety and security → Prompt injection and agent security also fits: Jailbreaking
Abstract (arXiv)
The widespread adoption of generative artificial intelligence in recent years has brought a parallel rise in prompt injection and jailbreak attacks. By embedding malicious instructions, these exploits manipulate language models to bypass intended behavior and operational boundaries. In traditional chatbots, such attacks are confined to a single session because state memory is not preserved across conversations. However, persistent memory features in modern conversational interfaces enable cross-session attack propagation, establishing a threat vector known as memory injection. This work explores this emerging vulnerability in leading LLM-as-a-service platforms, highlighting its real-world severity and the need for countermeasures. While existing literature focuses on violations tailored to specific platform features, we present a general threat model. We demonstrate that all NIST attack goals are collectively achievable across ChatGPT Instant 5.3, Claude Sonnet 4.6, and Gemini 3 Flash under this model. We also show that memory injections can exploit multiple attack vectors, including personal memories, projects, skills, organization instructions, and Model Context Protocol (MCP)-connected resources. Our findings reveal that all evaluated services can be manipulated to persistently spread disinformation, generate harmful content, or simulate offline unresponsiveness, even in fresh sessions. In the particular case of Claude, shared-memory features allow an attacker to compromise multiple users within an organization and also exfiltrate user prompts. To address these vulnerabilities, we derive defense mechanisms from our proposed threat model and foundational cybersecurity principles. Our analysis indicates that nearly half of these mitigations remain unimplemented across the target services. Datasets and attack artifacts are available at https://github.com/PedroBarcha/Memory-injection.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Prompt injection and agent security, one of 12 directions in LLM safety and security. Builds on 24 of its 59 references that are in the map. Submitted 20 Oct 2026.
Builds on
24 of 59 references.
Closest ancestors · 5
Same direction, newest first
- 2025System Prompt Poisoning: Persistent Attacks on Large Language Models Beyond User Injection10 May
- 2024AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Bases17 Jul
- 2024Neural Exec: Learning (and Learning from) Execution Triggers for Prompt Injection Attacks6 Mar
- 2024Security and Privacy Challenges of Large Language Models: A Survey30 Jan
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection23 Feb
Other references · 19
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,845
- 2022Constitutional AI: Harmlessness from AI Feedbackcited by 3,271
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,718
- 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 693
- 2024A Survey on the Memory Mechanism of Large Language Model based Agentscited by 683
- 2023MemoryBank: Enhancing Large Language Models with Long-Term Memorycited by 630
- 2024WildGuard: Open One-Stop Moderation Tools for Safety Risks, Jailbreaks, and Refusals of LLMscited by 566
- 2023"Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language Modelscited by 535
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Modelscited by 300
- 2025Constitutional Classifiers: Defending against Universal Jailbreaks across Thousands of Hours of Red Teamingcited by 206
- 2025Memory Injection Attacks on LLM Agents via Query-Only Interactioncited by 169
- 2023Universal Jailbreak Backdoors from Poisoned Human Feedbackcited by 150
7 more
- 2024GradSafe: Detecting Jailbreak Prompts for LLMs via Safety-Critical Gradient Analysiscited by 101
- 2024RigorLLM: Resilient Guardrails for Large Language Models against Undesired Contentcited by 73
- 2024HSF: Defending against Jailbreak Attacks with Hidden State Filteringcited by 25
- 2024WalledEval: A Comprehensive Safety Evaluation Toolkit for Large Language Modelscited by 18
- 2024Efficient Detection of Toxic Prompts in Large Language Modelscited by 15
- 2024Legilimens: Practical and Unified Content Moderation for Large Language Model Servicescited by 14
- 2026A Systematic Literature Review on LLM Defenses Against Prompt Injection and Jailbreaking: Expanding NIST Taxonomycited by 7
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Hidden in Memory: Sleeper Memory Poisoning in LLM Agents
- 2024An Early Categorization of Prompt Injection Attacks on Large Language Models
- 2025Breaking the Prompt Wall (I): A Real-World Case Study of Attacking ChatGPT via Lightweight Prompt Injection
- 2026A Layered Security Framework Against Prompt Injection in RAG-Based Chatbots
- 2023MasterKey: Automated Jailbreak Across Multiple Large Language Model Chatbots
- 2026Analysis of LLMs Against Prompt Injection and Jailbreak Attacks
- 2025ChatInject: Abusing Chat Templates for Prompt Injection in LLM Agents
- 2025Dialogue Injection Attack: Jailbreaking LLMs through Context Manipulation