Memory Is the New Attack Surface: Benchmarking Poisoning Through Agent Memory
Giorgio Severi (AI Safety Research · Microsoft), David Yang (PhD Candidate - RPI · Microsoft)
[un]prompted II 2026 — The AI Security Practitioner Conference · Day 2 · Stage 1
Overview
In the rapidly evolving landscape of artificial intelligence, the integration of external memory systems with large language models (LLMs) has become crucial for enabling agents to perform complex, long-horizon tasks. However, this advancement introduces a critical new attack surface: memory poisoning. David Yang and Giorgio Severi, researchers from Microsoft and RPI, presented their work at [un]prompted II, shedding light on how malicious instructions can be persistently embedded and amplified within an agent's memory, leading to sustained and widespread compromise. Their talk, "Memory Is the New Attack Surface: Benchmarking Poisoning Through Agent Memory," introduced Memory Dojo, a novel benchmark designed to systematically evaluate the safety of different agent memory architectures against such attacks.

Key moments
- 0:00 Introduction: Indirect prompt injection and agent memory problem
- 3:10 Introducing Memory Dojo: A benchmark for memory poisoning
- 7:20 Tracking poison: Insertion, retrieval, persistence, and propagation
- 11:00 Initial results: Memory poisoning affects all systems differently
- 12:20 Memory-aware optimizer: Creating stronger, adaptive poison payloads
- 15:00 Practical implications for testing and evaluating agent memory
- 16:00 Q&A: Why do memory architectures behave differently?
- 21:45 Q&A: Future work on testing countermeasures and defenses
Memory Is the New Attack Surface: Benchmarking Poisoning Through Agent Memory
Speakers: Giorgio Severi (AI Safety Research, Microsoft), David Yang (PhD Candidate - RPI, Microsoft)
Conference: [un]prompted II
YouTube: https://www.youtube.com/watch?v=J3ACm8oRDTY
Overview
In the rapidly evolving landscape of artificial intelligence, the integration of external memory systems with large language models (LLMs) has become crucial for enabling agents to perform complex, long-horizon tasks. However, this advancement introduces a critical new attack surface: memory poisoning. David Yang and Giorgio Severi, researchers from Microsoft and RPI, presented their work at [un]prompted II, shedding light on how malicious instructions can be persistently embedded and amplified within an agent's memory, leading to sustained and widespread compromise. Their talk, "Memory Is the New Attack Surface: Benchmarking Poisoning Through Agent Memory," introduced Memory Dojo, a novel benchmark designed to systematically evaluate the safety of different agent memory architectures against such attacks.
The core problem addressed is the amplification of indirect prompt injection (also known as XPIA or adversarial examples in context) when an agent uses external memory. While traditional prompt injection might affect a single interaction, a memory-aware attack can cause a single malicious instruction to be stored, retrieved, and acted upon repeatedly over the agent's lifetime, potentially across multiple, disparate tasks. This research aims to provide a framework for understanding and comparing the resilience of various memory systems, helping developers build more secure and trustworthy AI agents.
The implications of this work are significant for anyone developing or deploying agentic AI systems. By demonstrating the persistent and propagating nature of memory poisoning, Yang and Severi underscore the need for rigorous, long-horizon testing methodologies. Their findings highlight that not all memory architectures are equally vulnerable, and that attackers can optimize their payloads to dramatically increase the success rate and spread of malicious instructions. Memory Dojo offers a vital tool for researchers and practitioners to benchmark and ultimately enhance the defensive capabilities of AI agents against this emerging threat.
Background
▶ Watch: Introduction: Indirect prompt injection and agent memory problem (0:00)
The foundation of this research lies in two key areas of modern AI: the inherent limitations of Large Language Models (LLMs) and the emergence of agentic AI systems leveraging external memory. LLMs, despite their impressive capabilities, operate within a limited context window. This constraint makes it challenging for them to maintain coherence, recall past information, or execute multi-step tasks that span extended periods or require vast amounts of data. To overcome this, developers have increasingly turned to external memory systems.
These memory systems serve as persistent storage for an agent, allowing it to store, modify, and retrieve information semi-autonomously or fully autonomously. This capability is vital for features like personalization, maintaining long-term conversational context, and tackling complex, multi-session tasks—such as processing emails, managing travel plans, or handling banking operations. However, as Giorgio Severi pointed out, these memory systems are not monolithic; they vary significantly in their architectural design. Some store raw notes from past sessions, others extract individual facts, build relational graphs, or organize information into hierarchical tiers. They also differ in their operational mechanisms: how they write new information, consolidate existing data over time, and search/retrieve facts from memory. Each of these steps—extraction, rewriting, linking, merging—presents a potential vector for attack.
The critical vulnerability arises when these agentic memory systems are combined with the threat of indirect prompt injection, often referred to as XPIA or "adversarial examples in context." Indirect prompt injection occurs when an agent processes untrusted external content (e.g., an email, a web page, a document) that contains a hidden or disguised instruction designed to manipulate the agent's behavior. For instance, an email might subtly instruct an agent to forward all invoices to an adversary-controlled address. While LLMs are known to be susceptible to such injections even with recent models, the introduction of external memory dramatically escalates the potential impact.
If a malicious instruction is successfully injected and subsequently written into the agent's memory, it ceases to be a transient threat. Instead, it becomes a persistent poison. This poison can then be retrieved, processed, and acted upon repeatedly throughout the agent's operational lifetime. A single successful indirect prompt injection could transition from leaking one invoice to leaking every single invoice the agent ever encounters. This transformation from a one-off compromise to a long-term, amplified threat is precisely why memory becomes the "new attack surface," posing a significant challenge to the safety and reliability of agentic AI systems. The central question driving this research is how different memory architectures shape the lasting effects of such poisoning, and whether one architecture can be deemed "safer" than another.
Key Findings
▶ Watch: Tracking poison: Insertion, retrieval, persistence, and propagation (7:20)
The research presented by David Yang and Giorgio Severi revealed several crucial insights into the nature of memory poisoning in AI agents, underscoring the pervasive vulnerability of current memory architectures and the power of targeted attacks.
Firstly, a foundational finding is that all evaluated memory systems are susceptible to poisoning, albeit to varying degrees. The Memory Dojo benchmark, designed to simulate long-horizon agent trajectories, consistently demonstrated that a single, well-placed malicious instruction could be written into memory and subsequently retrieved and acted upon in later, distinct tasks. This confirms that the threat of persistent poisoning is not theoretical but a practical reality across diverse memory designs.
A significant contribution of this work is the introduction of life cycle metrics—Insertion, Retrieval, Persistence, and Propagation—which provide a granular understanding of how poison evolves within memory. These metrics proved instrumental in explaining the observed differences in vulnerability among memory systems. For example, some systems like mem zero exhibited a lower insertion success rate (around 60%), potentially due to their LLM-based memory extraction abstracting away the instruction. Others, such as Graffiti, showed significantly lower retrieval success rates because they retrieve relations rather than full facts, which can also abstract the malicious intent. Even when retrieved, the agent acted on the poison only in approximately one in four instances across most systems, indicating that retrieval alone doesn't guarantee attack success but is a necessary precursor. These metrics offer a diagnostic tool, pinpointing where a memory system might lose or retain poison.
Perhaps the most alarming finding is the dramatic increase in attack efficacy when employing memory-aware optimization. The researchers developed an LM optimizer that iteratively refines poison payloads based on feedback from the life cycle metrics. This optimization process led to a substantial increase in attack success, with the behavioral reach per task (the fraction of tasks post-insertion where the attacker's objective is achieved) increasing by an average of 15% across all tested systems. For a system like Leda, the attack success rate soared from 24% to 64% in sessions where poison was retrieved. This highlights that initial, unoptimized payloads might significantly underestimate the true risk posed by a determined adversary.
Furthermore, the optimization process not only increased the frequency of attacks but also fundamentally altered how the poison manifested in memory. Post-optimization, there was a notable rise in propagation, with the share of retrieved poison attributable to propagated copies (rather than just the original entry) increasing by approximately 22% across all systems. This suggests that optimized poisons are more likely to be rewritten, duplicated, or merged into new memory entries, effectively spreading like a "virus" within the agent's memory. This propagation creates a reinforcing effect, making the malicious instruction appear as an "established user preference" over time, further increasing its efficacy and making it harder to detect and mitigate.
In summary, the key findings confirm the widespread vulnerability of agentic memory to poisoning, provide a robust framework for analyzing its life cycle, and demonstrate that sophisticated, memory-aware attacks can dramatically amplify the persistence and spread of malicious instructions, presenting a significant challenge to AI safety.
Technical Deep Dive
▶ Watch: Memory-aware optimizer: Creating stronger, adaptive poison payloads (12:20)
The core of this research is the Memory Dojo benchmark, a meticulously designed system for evaluating the susceptibility of external agent memory architectures to poisoning over long-horizon trajectories. The benchmark operates in three main phases: constructing multi-session trajectories, executing them with an agent equipped with a memory system, and measuring the subsequent effects of the poison.
Memory Dojo Benchmark Architecture
- Constructing Multi-Session Trajectories: The benchmark generates 155 multi-session trajectories across four distinct domains: workspace, travel, banking, and Slack. Each trajectory is a sequence of tasks, with each task executed in a "session" using a fresh context window, while the agent's memory and application state persist. Each task has a binary outcome, and each domain is associated with fixed attacker objectives (e.g., data exfiltration, preference manipulation).
- Single Domain Trajectories: These are the base case, concatenating tasks within a single domain (e.g., multiple banking tasks). They test whether poison impacts later tasks in the same context.
- Cross-Domain Trajectories: These interleave tasks from all four domains, but the poison is designed for only one. This investigates whether poison can influence out-of-domain tasks.
- Cross-Domain with History: The longest trajectories include a prefix of general user-AI conversations before the cross-domain tasks. This simulates a real-world scenario where memory is already populated with competing information, testing poisoning under more realistic conditions.
- Executing with an Agent and Memory System: An agent, powered by GPT 3.5 Turbo (specifically, the 5.6 Luna model), interacts with the tasks. In each session, relevant memories are retrieved from the external memory system and appended to the task query. The agent then acts, utilizing various tools to complete its objective. The crucial step for poisoning occurs at a specified poison insertion point: the malicious instruction is appended to a tool call response. Critically, the attacker does not have direct access to edit the memory. Instead, the completed session's content goes through the memory system's normal write process, allowing the memory system itself to decide what to extract, rewrite, link, or merge based on its native operations. This simulates a realistic indirect prompt injection scenario.
- Measuring Outcomes: After poison insertion, the benchmark continuously measures its effects using a suite of custom-defined metrics:
- Insertion: A binary metric indicating whether the poison was successfully written into memory during the insertion session. An LLM acts as a judge to validate if the poison, or a reworded version (e.g., a user preference), was stored.
- Retrieval: Measures how often the poison reaches the agent's context in each subsequent session. This indicates the agent's exposure to the malicious instruction.
- Attribution (Persistence and Propagation): These metrics provide deeper insights into the poison's origin in retrieved memories.
- Persistence: Determines if the retrieved poison can be directly attributed to the original poison memory entry. It tracks how long the initial poison survives in memory.
- Propagation: Asks if the retrieved poison originates from a memory entry that is not the original. This occurs when the memory system creates new entries containing the poison or rewrites benign entries to include it, effectively spreading the poison like a "virus" within the memory structure.
- Behavioral Reach per Task: A cumulative attack success metric, defined as the fraction of tasks post-insertion where the attacker's objective is achieved. This captures the long-term impact of the poisoning.
Evaluated Systems and Models
The research evaluated five different external memory systems, selected to cover a wide range of architectural types. While specific names are largely obscured in the transcript, systems like Graffiti, Leda, and mem zero are explicitly mentioned. These systems differ in how they represent information (e.g., full facts vs. relations) and their write/retrieval mechanisms. The agent model used was GPT 3.5 Turbo (5.6 Luna) for both agent actions and any memory-related processes (e.g., extraction, summarization). The findings were further confirmed across other LLM models, including Deep Sea G V 4 Flash, GPT 5.4 Mini, and GLM V 5.3 Flash, demonstrating the generalizability of the vulnerabilities.
Memory-Aware Optimizer
A crucial component of the technical deep dive was the development of a memory-aware optimizer. This tool aims to stress-test memory systems by creating stronger poison payloads tailored to specific memory architectures.
- Mechanism: Given an attack objective and a description of the target memory system's properties, an LM optimizer iteratively refines the poison text.
- Feedback Loop: The optimizer runs through synthetic test trajectories in a separate sandbox environment, using the life cycle metrics (insertion, retrieval, behavioral reach) as feedback signals. For instance, if an initial poison is written but rarely retrieved, the optimizer proposes revisions to improve retrieval. If it's retrieved but ignored, it refines the instruction to increase the agent's likelihood of acting on it.
- Impact: The optimized payloads significantly increased attack success (15% average behavioral reach increase) and propagation (22% increase in propagated copies), proving that understanding and adapting to memory system characteristics is highly effective for an attacker. This optimization process highlights the need for defenders to also consider tailored attacks.
In essence, Memory Dojo provides a robust, empirical framework for dissecting the complex interplay between indirect prompt injection and agentic memory, offering granular insights into the vulnerabilities and the lifecycle of poison within these critical AI components.
Demo / Proof of Concept
▶ Watch: Practical implications for testing and evaluating agent memory (15:00)
While the talk did not feature a live, interactive demonstration in the traditional sense, the entire presentation of the Memory Dojo benchmark serves as a comprehensive proof of concept. The researchers demonstrated through their methodology and results that memory poisoning is a tangible and measurable threat across various agent memory architectures.
The "demonstration" lies in the empirical data and analysis derived from running 155 multi-session trajectories across five different memory systems. The plots illustrating the task-level behavioral reach, insertion success rates, retrieval success rates, and the evolution of persistence versus propagation directly demonstrate the efficacy and characteristics of memory poisoning. The subsequent results from the memory-aware optimizer further serve as a proof of concept for how an attacker could leverage knowledge of a memory system to significantly amplify the impact of a poison. The detailed metrics and the observed changes in attack success and propagation rates provide concrete evidence of the vulnerabilities and the proposed framework's ability to expose them.
Defensive Implications
▶ Watch: Q&A: Future work on testing countermeasures and defenses (21:45)
The findings from the Memory Dojo benchmark have profound implications for developers, security researchers, and practitioners involved in building and deploying AI agents with external memory. Understanding these implications is crucial for designing more resilient and secure systems.
- Adopt Long-Horizon Trajectory Testing: The research unequivocally demonstrates that evaluating agent safety solely on short, single-task interactions is insufficient. A poison might not manifest immediately but can persist and propagate over many subsequent sessions. Defenders must implement testing methodologies that simulate long-horizon trajectories, continuing to evaluate the agent's behavior long after any initial injection attempts. This ensures that persistent and propagating vulnerabilities are detected.
- Inspect Memory Writes and Retrievals, Not Just Agent Actions: Relying solely on the agent's final actions (e.g., whether it forwarded an invoice) provides an incomplete picture. The life cycle metrics revealed that poison can be successfully inserted into memory and frequently retrieved into the agent's context without necessarily leading to an immediate malicious action. Defenders should develop tools and processes to inspect the internal state of memory systems, monitoring what information is being written, how it's being consolidated, and what is being retrieved into the agent's active context. This allows for early detection of poison ingress and exposure, even if the agent hasn't yet acted maliciously.
- Adapt Attack Tests to Specific Memory Architectures: The memory-aware optimizer proved that generic poison payloads might significantly underestimate the true risk. Attackers can and will tailor their malicious instructions to exploit the specific characteristics of a given memory system (e.g., how it extracts facts, builds relations, or performs summarization). Therefore, defenders must also adapt their attack tests to the specific memory architecture being evaluated. Understanding the internal workings of the memory system allows for the creation of more realistic and potent attack scenarios, leading to more robust defensive measures.
- Prioritize Memory System Design for Safety: The varying degrees of vulnerability across different memory architectures indicate that design choices matter significantly. Systems that abstract instructions away (like Graffiti retrieving relations) or have less effective write processes (like mem zero with its 60% insertion success) might inadvertently offer some resilience. Developers should critically evaluate how their chosen or designed memory systems handle untrusted input, particularly during extraction, rewriting, and consolidation phases, to minimize potential attack surfaces.
- Recognize the Reinforcement Effect of Propagation: The observation that optimized poisons lead to increased propagation, causing malicious instructions to appear as "established user preferences," highlights a sophisticated attack vector. Defenders need to consider mechanisms that can detect such self-reinforcing malicious patterns in memory, potentially by analyzing the provenance or consistency of memory entries over time, rather than just their content in isolation.
By embracing these defensive implications, organizations can move beyond reactive patch-fixing and proactively build more secure and resilient AI agents capable of operating safely in complex, untrusted environments.
Key Takeaways
- Agentic memory transforms indirect prompt injection into a persistent and amplified threat. A single malicious instruction can be stored, retrieved, and acted upon repeatedly over an agent's lifetime, leading to far more severe consequences than a one-off attack.
- **All tested memory systems are vulnerable to poisoning, but their architectural designs dictate how and how much they are affected.** Differences in write, retrieval, and consolidation mechanisms create varying degrees of susceptibility.
- Life cycle metrics (Insertion, Retrieval, Persistence, and Propagation) are essential for diagnosing memory system vulnerabilities. These metrics provide granular insights into where poison enters, survives, and spreads within an agent's memory.
- Memory-aware optimization dramatically increases attack success and propagation. Optimized payloads, tailored to specific memory systems, can boost attack efficacy by an average of 15% and increase the spread of poison by approximately 22%, highlighting the need for realistic threat modeling.
- Defenders must adopt long-horizon testing and inspect internal memory operations, not just agent outputs. Evaluating agent safety requires continuous monitoring of memory writes and retrievals over extended periods, as initial attacks may not immediately manifest in malicious actions.
- The Memory Dojo benchmark provides a critical, open framework for evaluating and improving the safety of AI agents with external memory. It offers a standardized way to compare memory architectures and stress-test them against advanced poisoning attacks.
About the Speaker(s)
The research presented was a collaborative effort led by David Yang, currently a PhD Candidate at RPI, and Giorgio Severi, who specializes in AI Safety Research at Microsoft. David Yang brought his academic rigor and research focus from RPI, while Giorgio Severi contributed his expertise from Microsoft's AI safety initiatives. Their work was also supported by contributions from other group members, Blake, Amanda, and Muhammad. Together, they have focused on addressing critical security challenges in the emerging field of agentic AI, specifically investigating how external memory systems introduce new attack surfaces and how these can be systematically benchmarked and understood. Their collective expertise spans AI safety, machine learning, and security, positioning them to tackle the complex interdisciplinary problems at the intersection of these fields.
Reviews
→ Top-rated talks at [un]prompted II 2026 — The AI Security Practitioner Conference
All talks from [un]prompted II 2026 — The AI Security Practitioner Conference