arXiv:2611.09721cs.CRNov 2026

Manuscript Offprint

arXiv:2611.09721

MemoryDojo: Benchmarking Poisoning Through LLM Agent Memory

David H. Yang, Blake Bullwinkel, Amanda Minnich, Mohammad Mohammadi Amiri, Giorgio Severi

ABSTRACT

LLM agents benefit from using memory systems to improve performance on long-horizon, multi-session tasks. However, memory introduces a critical attack surface. Malicious instructions encountered in one session may be stored and propagated through memory before being retrieved and acted upon in later sessions. Because memory systems differ in how they process and retrieve information, the downstream effects of poisoning can vary significantly across systems. To quantify the effects of poisoning across different memory architectures, we introduce MemoryDojo, a benchmark for tracing the lifecycle of poisoned information through agent memory and measuring its influence on subsequent agent behavior. MemoryDojo is easily extensible, consists of 155 multi-session long-horizon trajectories covering four domains, and supports five different memory systems. Through our evaluation, we find that all memory systems are susceptible to memory poisoning, with substantial variation in downstream effects. We further propose a memory-aware poison optimization process that increases the poisoning efficacy, highlighting differences between memory architectures. We hope that MemoryDojo will support research on understanding and mitigating agentic memory risks.

1 INTRODUCTION

AI agents powered by large language models (LLMs) use tools, or dedicated software functions, to take actions in external environments such as reading emails or managing calendars. While tool-use substantially expands LLM capabilities, it also opens up a growing risk of indirect prompt injection. A malicious actor can disseminate instructions in a document or message in the external environment, causing the agent to execute arbitrary actions (Greshake et al., 2023; Debenedetti et al., 2024).

This risk, known as indirect or cross prompt injection (XPIA), is significantly amplified by the introduction of agentic memory. Because LLM context windows are limited, long-running agents need memory systems to compact prior context and preserve information across interactions. By storing information persistently, memory lets agents reuse facts, preferences, and prior experience after the original context is lost (Packer et al., 2023; Chhikara et al., 2025; He et al., 2026). However, this process can also turn an untrusted observation into a stored preference, summary, or procedure. The payload may persist, be summarized, or connected to other memories, and be retrieved during subsequent sessions. This can lead to compounding harmful effects and a lasting attack over time.

Consider an email containing instructions misrepresenting a user preference to forward outgoing invoices to a target email address. Without memory, an agent following these instructions may leak one invoice. With memory, the instruction may be stored as a user preference and applied to all future invoices, long after the original email has been evicted from context. Thus, memory can convert a transient exposure into a persistent behavior, a risk highlighted by recent threat intelligence (Microsoft Defender Security Research Team & Kochavi, 2026; Lu & Chen, 2025; Socket Research Team, 2026).

Agent memory systems, however, vary significantly in their architectures. Some extract facts, some evolve linked notes, and others traverse graphs or hierarchical stores. Although prior work has

*Work done while at Microsoft. Correspondence to: yangd13@rpi.edu, gseveri@microsoft.com.

compared these systems on task performance, we still lack a systematic understanding of how memory architecture affects the persistence and behavioral impact of a poisoned observation as an agent completes new tasks and updates its memory over multiple sessions. We therefore ask: “How do different memory systems shape the lasting effects of a poisoned observation as an agent performs new tasks and updates its memory across sessions?”

To answer this question, we introduce MemoryDojo¹, an extensible benchmark for comparatively evaluating memory architectures under poisoning attacks over long-horizon, multi-session trajectories. Currently, MemoryDojo supports 155 multi-session trajectories covering 4 application domains, and is enabled by 5 different agent memory system implementations. Additional memory systems, environments, and configurations can be easily added for evaluation. We also introduce new metrics to better quantify the effects of poisoning across its lifecycle, tracking information on payload insertion, effects of persistence and propagation in memory, retrieval, and cumulative attack success metrics. Finally, we propose a natural adaptive memory-aware poison optimization method that performs iterative refinement of the payload prompt in an auxiliary environment.

Our experiments reveal substantial variation in poisoning success across memory systems. While some are more resilient, none are invulnerable: applying our memory-aware poison optimization method increases attack success by approximately 2% – 31%. Memory architecture materially affects each stage of the poison lifecycle and should be treated as a central component of agent security evaluation. Overall, our contributions are as follows:

  1. We develop MemoryDojo, an extensible benchmark that quantifies the effects of memory poisoning across different memory systems, supported by multi-session long-horizon trajectories.

  2. We define new metrics that quantify how poison persists and spreads within agent memory, and how broadly it induces attacker-desired behavior across subsequent tasks.

  3. We propose a memory-aware poison optimization method that increases the effectiveness of the payload, and allows us to study the properties of different memory systems under powerful attacks.

References (35)