Manuscript Offprint
arXiv:2611.09721MemoryDojo: Benchmarking Poisoning Through LLM Agent Memory
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:
-
We develop MemoryDojo, an extensible benchmark that quantifies the effects of memory poisoning across different memory systems, supported by multi-session long-horizon trajectories.
-
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.
-
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.
Memory poisoning. Indirect prompt injection places attacker instructions in the environment that an agent can access, and is typically measured within a single session (Greshake et al., 2023; Zhan et al., 2024; Debenedetti et al., 2024; 2025; Wang et al., 2026). Before a session ends, agent memory systems may write those instructions into memory, so the attack can outlive both the observation and the session that produced it (Xie et al., 2026; Lin et al., 2026). Attacks of this kind were first studied against static retrieval corpora or had strong assumptions on how the payload is inserted (Zhong et al., 2023; Zou et al., 2025; Chaudhari et al., 2024; Liang et al., 2025). More recent works deliver the payload as ordinary content that an agent reads during its own task (Zou et al., 2026; Torres et al., 2026). Prior work also optimizes poisoning payloads (Chen et al., 2024; Pasquini et al., 2024), but not in a memory-aware fashion.
Memory poisoning benchmarks. A few works have attempted to measure these attacks. AgentLAB covers memory poisoning as one of five long-horizon attack types (Jiang et al., 2026). MemPoison shows write-time filters admitting records that turn harmful only through joint retrieval or later triggering (Gao et al., 2026). MPBench enumerates memory write channels and structural vulnerabilities across six attack classes (Dash et al., 2026). These works primarily hold the memory implementation fixed, while the write channel, attack class, or model family varies. Different from existing works, MemoryDojo performs a comparative evaluation of continued agent operation over multi-session trajectories. Following a poisoned observation, it tracks subsequent task execution and native memory
¹Code to be released soon.
updates across different memory systems, measuring how widely attacker-intended behavior recurs across later tasks.
3 PROBLEM FORMULATION
Agent formulation. Consider an LLM agent interacting in an environment. Let , and denote the user prompt, action, observation, and response spaces, respectively. Define a trajectory run as a sequence of agent sessions , where each session , , consists of a user prompt , a sequence of actions with environment observations , and a final response . The number of steps is determined by the agent and may vary across sessions. Each session corresponds to one task, and sessions are executed in order.
Use of memory. Let denote the state of the memory system after session has completed, with . Write operations are performed once each session ends, , where the operator abstracts any sequence of memory operations performed during this write. This may include memory-system-specific operations such as extraction, relation construction, or merging; we therefore do not assume that takes any particular form. Memory retrieval is performed prior to each session and reads the state left by the previous session, , where the operator denotes broadly a retrieval mechanism inherent to the memory system used. This can be a simple top- vector retrieval or a more complex search algorithm, given the user input . The retrieved context is concatenated with the user request before reasoning occurs.
Poison insertion. The attacker controls content returned by an external tool call. They do not modify the system prompt, user requests, benchmark tasks, utility functions, memory-system implementation, or later tool results. Let denote the attacker objective, formalized as a predicate on sessions, , where if and only if the actions and response of session execute the objective. The attacker encodes as a poison text prompt , which is appended once at a single insertion point , denoting observation of session . The original observation is appended with the poison prompt, forming . We require so that at least one session follows the insertion. This models indirect prompt injection from a document, message, or service read by an otherwise benign agent. After insertion, ordinary tasks continue without further attacker intervention. Since becomes part of the trajectory , the poison can be written into memory, and retrieved in subsequent sessions, causing cumulative effects.
4 MEMORYDOJO
We present MemoryDojo, a benchmark for evaluating how poisoning affects behaviors of memory-augmented agents in multi-session trajectories (Figure 1).

Figure 1: MemoryDojo overview. Task trajectories are generated from 4 different domains and user-AI conversations are optionally added. Execution is done through a repeated retrieve-interact-write cycle. Poison enters one tool result at the marked session , and can be written into memory. Different metrics capture the lifecycle effects of the poisoning.
4.1 CONSTRUCTING TRAJECTORIES
We construct multi-session trajectories using task templates from AgentDojo (Debenedetti et al., 2024) across four domains: Workspace, Travel, Banking, and Slack. Each domain provides a stateful environment and tools for interacting with it. All tasks specify an objective and utility check that determines whether the objective is achieved. We concatenate tasks into trajectories, treating each task execution as a separate session while carrying environment state forward. To ensure the concatenated tasks remain executable, we check task pairs for state conflicts and validate each complete sequence. For each domain, we also define an attacker objective , accompanied by a textual description of the behavior that the poison seeks to induce. Using these tasks and conversation histories from LongMemEval-S (Wu et al., 2025), we obtain a dataset with three different collections. Additional details can be found in Appendix A.1 and A.2.
Same-domain trajectories. First, we concatenate compatible tasks within a single domain. This setting evaluates whether a poison encountered by an agent working in that domain influences its behavior on subsequent tasks in the same domain. This collection contains 93 trajectories across the four domains, with 802 task sessions in total and 3–35 sessions per trajectory.
Cross-domain trajectories. An agent may also perform tasks across multiple domains over time. To evaluate poisoning in this setting, we construct trajectories that interleave tasks from all four domains while ensuring trajectory validity. Each domain has its own environment state, while all sessions share one memory system. This allows us to examine whether poison encountered in one domain influences later behavior as the agent performs tasks across domains. The collection contains 31 trajectories with 680 task sessions in total and 5–60 sessions per trajectory.
History-prefixed trajectories. Task concatenation produces trajectories of moderate length, but agents may accumulate much longer interaction histories before encountering a poisoned data source. To evaluate memory systems under high-volume pressure, we extend the cross-domain trajectories with benign user-assistant conversations from LongMemEval-S (Wu et al., 2025). We select 31 histories across its six question categories, and pair each with a distinct cross-domain trajectory. Before task execution, we initialize memory by having the agent replay the recorded history sessions making use of the memory system's operations. These 31 trajectories add an additional 1,493 history sessions in total, with each prefix averaging 48.2 sessions and approximately 500 individual messages. This substantial benign history places additional pressure on memory storage and retrieval, enabling a more systematic way to study the poison lifecycle alongside previously accumulated information.
4.2 RUNNING TRAJECTORIES
Each trajectory starts from the default domain environments, with memory empty or initialized by replaying a specified conversation history. Sessions follow the retrieve-interact-write cycle using a fresh context window with retrieved memory prepended to the task request. After the session completes, MemoryDojo constructs a memory write record containing the original task request, assistant messages, tool calls, observations, and final response. Retrieved context is excluded to prevent recopying of old memories into each new write. An adapter projects this record into the selected memory system's native write format, after which the system performs its own memory processing, including any extraction, rewriting, consolidation, or linking. This design enables our benchmark to flexibly support different memory systems. We implement this interface for five representative open-source memory systems: A-MEM (Xu et al., 2025), Graphiti (Rasmussen et al., 2025), Letta (Packer et al., 2023), Mem0 (Chhikara et al., 2025), and Memora (Xia et al., 2026).
4.3 TRACING POISON THROUGH A TRAJECTORY
Throughout a trajectory, MemoryDojo keeps track of various statistics at different timesteps in the process to better understand how poison interacts with memory. Let denote a collection of planned runs, with trajectory length , insertion session , and payload for run . The benchmark is accompanied by a visualization tool to manually inspect traces (see example in Appendix A.3).
Insertion. After the insertion-session write, we inspect the memory system for content attributable to using an LLM Judge to classify four categories. An exact match preserves the complete payload word for word, a transformed match preserves its salient instruction or meaning after rewriting, and a fragmented match retains only part of that meaning. If no attributable content is found, we assign the label of not observed. Let denote this judgment and = {exact, transformed, fragmented}. We define the insertion indicator and insertion success rate (ISR) as:
Retrieval. For each later session , contains the returned memory items, including primary search results and content supplied through links or episodic expansion (see Appendix A.4 for example). We assess these items using the same categories as insertion. Writing for the judgment of item relative to , retrieval succeeds when at least one item qualifies. The retrieval success rate (RSR) pools these successes over all post-insertion sessions:
While retrieval indicates that the poison found its way to the current task session, it does not help us answer how. To obtain additional insights on this, we propose a method of attribution, and define two mechanisms by which a poison can surface over time, persistence and propagation.
Persistence. We compare memory snapshots before and after the insertion session to identify the entries that are initially written which contain poison. We refer to these entries as the original poison. These can include newly created entries and existing entries modified by that write. If during retrieval, an original memory entry is retrieved, we attribute this as an effect of persistence. Persistence provides a signal of how long the original poison stays in memory.
Propagation. On the other hand, propagation occurs in subsequent sessions post-insertion, when memory writes create new entries containing poison or previously benign entries are rewritten to contain the payload. For example, if the agent retrieves a payload and executes a malicious objective in a future session, it may again write its new observations into memory. In this case, the poison may spread and during future retrieval the original poison no longer becomes the only source of attribution.
Together, persistence and propagation capture how poison evolves in a memory system over time. To help quantify this, we define metrics to attribute each poison-bearing retrieved session to an effect of persistence only (PE), propagation only (PR), or both (PP). See Appendix A.5 for a formal definition of these metrics.

Figure 2: Example of persistence in Letta

Figure 3: Example of propagation in A-MEM
4.4 MEASURING DOWNSTREAM BEHAVIOR
Retrieval and attribution characterize the poison's presence and exposure routes in later sessions. We additionally measure attack success as a cumulative metric of poisoning across the trajectory. For each session , we evaluate the agent actions and final response against the attacker objective . Let denote the outcome. Excluding separates later behavior from the agent's immediate response to the poisoned observation.
Behavioral reach. A run is reached if the attack objective is achieved in at least one session after insertion. Across a collection of runs, behavioral reach (BR) is the fraction of runs that are reached. Task-level behavioral reach (BRT) measures the fraction of post-insertion tasks on which the objective is observed, pooled over all post-insertion sessions:
BR measures whether influence occurs at all, while BRT measures how broadly it occurs across later tasks. In contrast to the standard attack success rate (ASR), which measures whether an attack succeeds in the session where it is injected, BR and BRT measure its longitudinal effect on later sessions, where the poison can only act through memory.
Task and Memory Utility. In addition to behavioral reach, we measure task utility as the fraction of all task sessions that pass the benchmark's task success checks. For history-prefixed trajectories, we measure memory utility through accuracy on the held-out LongMemEval question, answered using retrieved memory after the trajectory is complete. These measures help assess task performance and effective memory usage under the effects of poisoning.
5 MEMORY-AWARE POISON OPTIMIZATION
Memory systems differ in how they transform, store, and retrieve past interactions, directly affecting whether a poisoned instruction survives a write, appears in later context, and induces the intended behavior. To study the dynamics of each system under adversarial pressure, we propose a memory-aware optimization process that iteratively refines a payload to increase behavioral reach (see Figure 4). The LLM optimizer is first provided an attack objective, memory-system description, and domain context. Starting from seed payloads, each round proposes candidates and evaluates them on synthetic trajectories in an auxiliary environment. Feedback from each iteration guides further revisions. After a fixed budget, selection maximizes auxiliary BRT subject to a utility threshold. See Appendix A.6 for additional details of the optimization process.

Figure 4: Memory-aware poison optimization. An LLM optimizer revises candidate payloads using a memory-system description, an attack objective , and feedback from auxiliary runs. Behavioral outcomes, coarse memory evidence, and failure summaries guide subsequent revisions.
6 EVALUATION
We evaluate how a single poisoned observation influences an agent's later behavior, and use memory traces to examine where that influence is retained, propagated, and acted upon. We first study unoptimized and optimized payloads on same-domain trajectories, then consider trajectories that cross application domains and finish by adding extra memory pressure.
6.1 EXPERIMENT SETUP
We evaluate tool-calling agents on five memory systems, selected to cover a wide range of memory types: A-MEM, Graphiti, Letta, Mem0, and Memora. Their native representations span linked notes, entity-relation graphs, hierarchical memory, extracted facts, and linked semantic and episodic memory. We evaluate GPT-5.6-Luna (OpenAI, 2026) across all trajectory settings and optimize poisons for every memory system with Luna as the target and GPT-5.6-Sol as the optimizer. To assess transfer across models, we additionally evaluate GPT-5.4-mini, DeepSeek-V4-Flash-0731 (DeepSeek-AI, 2026), and GLM-5.3-Flash (GLM-5-Team, 2026) in the same-domain setting using the Luna-optimized payloads. We vary the task-agent and generative memory-side LLM models together, and use GPT-5.6-Luna for LLM judging. For each memory system, we use its native retrieval mechanisms. Thus, these configurations compare complete memory integrations, including their different context-selection policies and budgets. Additional setup details can be found in Appendix A.7.
Table 1: Same-domain results for unoptimized and optimized poison for GPT-5.6-Luna.
| Memory System | ISR | ASR | RSR | PE | PR | PP | TU | BRT | BRT | R | BR | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Unoptimized | A-MEM | 98.92 | 25.27 | 89.84 | 60.28 | 8.01 | 31.71 | 72.25 | 21.02 | 23.39 | 45.70 |
| Graphiti | 98.39 | 23.12 | 33.43 | 81.86 | 5.49 | 12.66 | 80.49 | 7.76 | 23.21 | 24.73 | |
| Letta | 98.92 | 24.19 | 64.88 | 77.28 | 1.74 | 20.98 | 69.46 | 15.30 | 23.59 | 16.67 | |
| Mem0 | 60.75 | 20.97 | 56.70 | 78.11 | 0.87 | 21.02 | 76.66 | 7.90 | 13.93 | 14.52 | |
| Memora | 97.85 | 23.12 | 86.18 | 62.36 | 6.55 | 31.10 | 65.72 | 20.38 | 23.65 | 38.71 | |
| Optimized | A-MEM | 97.85 | 19.35 | 93.37 | 37.16 | 13.29 | 49.55 | 60.74 | 44.01 | 47.13 | 70.97 |
| Graphiti | 100.00 | 4.30 | 30.61 | 62.67 | 17.51 | 19.82 | 81.42 | 9.31 | 30.41 | 30.11 | |
| Letta | 95.70 | 25.81 | 72.21 | 46.48 | 0.59 | 52.93 | 53.67 | 46.26 | 64.06 | 50.54 | |
| Mem0 | 77.42 | 9.68 | 71.65 | 53.94 | 4.33 | 41.73 | 71.77 | 21.02 | 29.33 | 39.78 | |
| Memora | 98.92 | 24.73 | 92.81 | 47.72 | 12.46 | 39.82 | 74.15 | 29.76 | 32.07 | 66.67 | |
Unless otherwise specified, each run appends one payload to a tool observation in the first task session, then resumes execution and completes session memory writes. Same-domain runs use their domain's objective while cross-domain and history-prefixed trajectories are evaluated under each of the four domain objectives separately. We report insertion success (ISR), insertion-task attack success (ASR), retrieval success (RSR), retrieval attribution due to persistence (PE) propagation (PR) or both (PP), task utility (TU), memory utility (MU), later-task reach (BRT), later-task reach given retrieval (BRT|R), and trajectory-level reach (BR).
6.2 SAME-DOMAIN
Table 1 compares the unoptimized and optimized payloads on the same-domain trajectories for GPT-5.6-Luna. The optimized payloads are generated by the memory-aware optimization in Section 5.
Unoptimized poison reaches later tasks unevenly across memory systems. Memory poisoning affects all evaluated systems, reaching up to 45.70% BR and 21.02% BRT, with substantial variation across systems. For example, Graphiti and Mem0 exhibit less than 8% BRT, compared with over 20% for A-MEM and Memora. Tracing poison through memory helps interpret this variation. ISR approaches 100% for four systems, indicating that downstream outcomes differ despite successful storage of some representation of the poison. Mem0 represents an exception, with 60.75% insertion success, potentially due to how its write mechanisms use an LLM to extract facts from the session and may abstract away certain information. Across all five systems, insertion-task ASR exceeds BRT. For these runs, the poison's effect on the immediate response was strictly stronger.
RSR separates the systems more sharply. A-MEM and Memora record poison retrieval over 80% of later tasks, compared with 64.88% for Letta, 56.70% for Mem0, and 33.43% for Graphiti. The memory operations native to each system can help explain the differences here. A-MEM searches stored session notes, while Memora can supply original episodes through links from retrieved facts. As a result, poison retrieval is more likely. Graphiti stores more complete episode information but its retrieval process returns relation facts. In an unoptimized banking run we inspected, the episode stores the poison exactly, yet the query's returned facts omit this information.
These findings suggest that processing between memory insertion and retrieval can strongly affect RSR. However, retrieval alone does not imply behavioral reach: for four systems, only approximately 1/4 instances of retrieval lead to successful reach, with a further 10% drop for Mem0. This gap motivated our poison optimization schema to explore the reach of more advanced attacks.
Optimization improves Behavioral Reach. Both BR and BRT increase for all five systems relative to the unoptimized runs (Figure 5a). A closer look at the metrics provides insights on where these gains come from for each memory system. For Mem0, ISR rises from 60.75% to 77.42%, with a higher chance of poison being actually written into memory. For Letta RSR increases by around 8%, but the largest change is in BRT | R, which rises from 23.59% to 64.06%. Similarly for A-MEM, ISR and RSR stay around the same, while BRT | R more than doubles. These results show that the optimized payloads can induce greater reach even with roughly equivalent RSR.
Reach varies across models and domains. Evaluation with three additional models reinforces the findings that poisoning effects differ between memory systems, and we observe examples of

(a) Reach gains with Luna.

(b) Optimized reach across models.
Figure 5: Optimization gains and reach across models. (a) Optimized minus unoptimized BR and BRT with GPT-5.6-Luna. (b) Heatmap showing optimized BRT across different models.
significant BRT for memory systems across models (Figure 5b). The relative ordering for BRT changes, but both A-MEM and Memora have consistently high BRT compared to other memory systems, while Graphiti has the lowest across the four models. These results also demonstrate the transferability of poison optimization, as optimization was performed using GPT-5.6-Luna, but we observe strong effects in these different models as well. We also find that BRT varies by domains, and additional details can be found in Appendix A.8 and A.9.
Poison remains effective when inserted later. We additionally insert optimized payloads at the trajectory midpoint, after earlier sessions have populated memory. Delaying poison insertion until the trajectory midpoint generally reduces subsequent retrieval and behavioral impact, but does not eliminate the attack. Sensitivity varies substantially across memory systems, with Letta showing the largest reduction and Mem0, A-MEM, and Memora retaining strong effectiveness (see Appendix A.10).
Poison spreads across all five memory systems. The retrieval attribution results from Table 1 show evidence of PE, PR, and PP across all memory systems. Poison spreads beyond its insertion memories and while the effects of PR alone are rarer, traces of propagation are more often found along with the original poison memory (PP). Interestingly, the poison optimization process encouraged more propagation, as the combined PR + PP increased by over 20%. The overall increase in propagation after optimization implies stronger effects of the poison, correlating with higher BRT | R. Retrieval of both original poison and descendants may reinforce the malicious objective more strongly than persistence alone. Multiple poison-bearing memories can also make the malicious instruction seem like an established requirement or precedent, adding additional credibility.
6.3 CROSS-DOMAIN

(a) Within- and cross-domain reach.

(b) Retrieval and reach over later sessions.
Task-session distance after insertion
Figure 6: Cross-domain behavioral reach and poison retrieval. (a) BRT on tasks within and outside the poison target domain. (b) RSR and BRT by task-session distance after insertion.
Poisoning reaches out-of-domain tasks. Cross-domain trajectories interleave tasks from different domains and contain more sessions on average. We decompose BR and BRT into within-domain and cross-domain contributions, defining cross-domain poisoning as payload execution during a task outside the target domain. We observe cross-domain reach in four systems, albeit less frequently than within-domain (see Figure 6a). Lower cross-domain reach can be attributed to both lower RSR and
BRT | R (see Appendix A.11). While retrieval is less frequent, the largest difference is lower BRT | R. The payload may be less relevant to the current task and context when the domains differ. While overall BR and BRT decline relative to single-domain experiments, within-domain reach remains substantial, further highlighting the difference in poisoning effects across memory systems.
BRT and RSR across sessions. Cross-domain experiments consist of trajectories of up to 60 sessions. Here, we investigate the effects of poisoning over time. Figure 6b plots all memory systems using task-session distance after insertion. From the first 10 sessions post-insertion to distance 31 and beyond, BRT falls for A-MEM, Graphiti, Mem0, and Memora. Letta instead remains consistent at around 15% BRT across the four bins. Towards later sessions, RSR also drops accordingly for most of these memory systems except for Letta, which remains consistently over 50%. This pattern is consistent with Letta's core memory module supplying persistent context across sessions.
6.4 HISTORY-PREFIXED CROSS-DOMAIN
Table 2: History-prefixed cross-domain results.
| Memory | ISR | ASR | RSR | TU | MU | BRT | BRT | R | BR |
|---|---|---|---|---|---|---|---|---|---|
| A-MEM | 97.58 | 8.06 | 37.98 | 79.20 | 76.86 | 4.66 | 12.27 | 31.45 | |
| Graphiti | 100.00 | 3.23 | 5.32 | 82.65 | 70.16 | 1.54 | 28.99 | 12.90 | |
| Letta | 95.97 | 10.48 | 7.94 | 70.47 | 65.22 | 0.00 | 0.00 | 0.00 | |
| Mem0 | 47.58 | 12.90 | 19.38 | 77.75 | 64.41 | 2.58 | 13.32 | 21.77 | |
| Memora | 96.77 | 20.16 | 44.18 | 77.65 | 75.00 | 5.32 | 12.03 | 45.16 |

Figure 7: Memory utility.
We next evaluate poisoning after memory has accumulated benign conversation history. Each trajectory starts from a checkpoint populated with a LongMemEval history of around 50 sessions.
Poisoning remains effective in populated memory. Table 2 shows lower RSR and BRT for every system than in the cross-domain experiment without a history prefix. Nevertheless, poison reaches later tasks in four of the five systems. Memora had the highest BRT at 5.32%, followed by A-MEM at 4.66%. Memora's trajectory-level BR is 45.16%, showing that the lower per-task frequency still corresponds to attacks across many trajectories. The poisoning efficacy on memory systems differs from the earlier experiments. Letta, which previously had the highest in BRT, has no later-task reach. Reach also extends beyond the poison's target domain for A-MEM, Mem0, and Memora, while reached tasks for Graphiti remain within the poison's target domain.
Memory pressure changes retrieval and subsequent behavior. Insertion success remains similar to the cross-domain experiment without a prefix: four systems have ISR above 95%, while Mem0 remains below 50%. The larger differences arise after insertion. For both A-MEM and Memora, RSR drops by over 30% while BRT | R remains around the same at just above 10%. These results show that applying additional memory pressure through the LongMemEval histories weakens the effects of poisoning due to growing competition in retrieval. Letta is impacted most by the additional memory pressure. RSR falls from 55.66% to 7.94%, and none of its retrieved tasks exhibits behavioral reach. Existing benign memory may influence which new information is promoted to core memory and how it is summarized. As a result, poison was unable to persist in most cases.
Effect of poisoning on task and memory utility. Task utility is largely preserved under poisoning (Appendix A.12). However, Figure 7 shows that memory utility decreases for A-MEM, Graphiti, and Mem0, suggesting that poisoning can impair recall of benign conversation history over multi-session trajectories. The effect on Letta and Memora is not significant, indicating that this degradation is not uniform across memory systems.
7 CONCLUSION
As memory becomes central to agentic AI performance, its security warrants increased attention. Guided by the question of how to measure and compare the dynamics of poisoned instructions percolating through different memory architectures, we developed MemoryDojo, an extensible, modular benchmark that tracks poisoning effects throughout the data lifecycle.
Unlike prior benchmarks, our work focuses on long-horizon, multi-session interactions in which agents create and process large volumes of new memories before and after poison injection. We also design our measurements to provide fine-grained insights on the evolution of the poisoned data after ingestion, allowing significantly more informed comparisons between memory systems. Our experiments show that a single poisoned observation can influence behavior in later sessions, with substantial variation across systems in retrieval, propagation, and behavioral effects.
Future work can extend MemoryDojo to broader deployment settings, investigate multiple instances of poisoning in a trajectory, and systematically evaluate memory defenses against poisoning. We hope that MemoryDojo will support improvements in the security and safety of agentic AI memory platforms by providing a framework to evaluate new variants and defensive approaches.
ETHICS STATEMENT
We limit the benchmark to sandboxed task suites, synthetic trajectories, and locally hosted memory state. No human-subject data are collected.
REPRODUCIBILITY STATEMENT
We will release the benchmark data, trajectory-construction code, memory-system integrations, and evaluation scripts.
AI USE STATEMENT
In this work, we used generative AI tools for polishing the paper writing and implementing code. We have not used generative AI tools for research ideation, developing conceptual frameworks, proposing hypothesis, methodology, or interpreting results. We take responsibility for the final content of this work, including text, claims or artifacts produced with the aid of generative AI.
REFERENCES
Harsh Chaudhari, Giorgio Severi, John Abascal, Anshuman Suri, Matthew Jagielski, Christopher A. Choquette-Choo, Milad Nasr, Cristina Nita-Rotaru, and Alina Oprea. Phantom: General backdoor attacks on retrieval augmented language generation. arXiv preprint arXiv:2405.20485, 2024. URL https://arxiv.org/abs/2405.20485.
Zhaorun Chen, Zhen Xiang, Chaowei Xiao, Dawn Song, and Bo Li. AgentPoison: Red-teaming LLM agents via poisoning memory or knowledge bases. In Advances in Neural Information Processing Systems, volume 37, 2024. doi: 10.52202/079017-4136. URL https://proceedings.neurips.cc/paper_files/paper/2024/hash/eb113910e9c3f6242541c1652e30dfd6-Abstract-Conference.html.
Prateek Chhikara, Dev Khant, Saket Aryan, Taranjeet Singh, and Deshraj Yadav. Mem0: Building production-ready AI agents with scalable long-term memory. In Proceedings of the 28th European Conference on Artificial Intelligence, pp. 2993–3000, 2025. doi: 10.3233/FAIA251160. URL https://doi.org/10.3233/FAIA251160.
Pritam Dash, Tongyu Ge, Aditi Jain, Tanmay Shah, and Zhiwei Shang. From untrusted input to trusted memory: A systematic study of memory poisoning attacks in llm agents, 2026. URL https://arxiv.org/abs/2606.04329.
Edoardo Debenedetti, Jie Zhang, Mislav Balunovic, Luca Beurer-Kellner, Marc Fischer, and Florian Tramèr. AgentDojo: A dynamic environment to evaluate prompt injection attacks and defenses for LLM agents. In Advances in Neural Information Processing Systems, volume 37, 2024. doi:10.52202/079017-2636. URL https://proceedings.neurips.cc/paper_files/paper/2024/hash/97091a5177d8dc64b1da8bf3elf6fb54-Abstract-Datasets_and_Benchmarks_Track.html.
Edoardo Debenedetti, Ilia Shumailov, Tianqi Fan, Jamie Hayes, Nicholas Carlini, Daniel Fabian, Christoph Kern, Chongyang Shi, Andreas Terzis, and Florian Tramèr. Defeating prompt injections by design. arXiv preprint arXiv:2503.18813, 2025. URL https://arxiv.org/abs/2503.18813.
DeepSeek-AI. DeepSeek-V4: Towards highly efficient million-token context intelligence, 2026. URL https://arxiv.org/abs/2606.19348.
Jifeng Gao, Kang Xia, Yi Zhang, Xiaobin Hong, Mingkai Lin, Xingshen Wei, Wenzhong Li, and Sanglu Lu. MemPoison: Uncovering persistent memory threats and structural blind spots in LLM agents. arXiv preprint arXiv:2607.14651, 2026. URL https://arxiv.org/abs/2607.14651.
GLM-5-Team. GLM-5: from vibe coding to agentic engineering, 2026. URL https://arxiv.org/abs/2602.15763.
Kai Greshake, Sahar Abdelnabi, Shailesh Mishra, Christoph Endres, Thorsten Holz, and Mario Fritz. Not what you've signed up for: Compromising real-world LLM-integrated applications with indirect prompt injection. In Proceedings of the 16th ACM Workshop on Artificial Intelligence and Security, pp. 79–90, 2023. doi: 10.1145/3605764.3623985. URL https://doi.org/10.1145/3605764.3623985.
Bernal Jiménez Gutiérrez, Yiheng Shu, Yu Gu, Michihiro Yasunaga, and Yu Su. HippoRAG: Neurobiologically inspired long-term memory for large language models. In Advances in Neural Information Processing Systems, 2024. URL https://arxiv.org/abs/2405.14831.
Zexue He, Yu Wang, Churan Zhi, Yuanzhe Hu, Tzu-Ping Chen, Lang Yin, Ze Chen, Tong Arthur Wu, Siru Ouyang, Zihan Wang, Jiaxin Pei, Julian McAuley, Yejin Choi, and Alex Pentland. MemoryArena: Benchmarking agent memory in interdependent multi-session agentic tasks. arXiv preprint arXiv:2602.16313, 2026. URL https://arxiv.org/abs/2602.16313.
Yuanzhe Hu, Yu Wang, and Julian McAuley. Evaluating memory in LLM agents via incremental multi-turn interactions. In The Fourteenth International Conference on Learning Representations, 2026. URL https://openreview.net/forum?id=DT7JyQC3MR.
Tanqiu Jiang, Yuhui Wang, Jiacheng Liang, and Ting Wang. AgentLAB: Benchmarking LLM agents against long-horizon attacks. arXiv preprint arXiv:2602.16901, 2026. URL https://arxiv.org/abs/2602.16901.
Zhiyu Li, Shichao Song, Hanyu Wang, Simin Niu, Ding Chen, Jiawei Yang, Chenyang Xi, Huayi Lai, Jihao Zhao, Yezhaohui Wang, Junpeng Ren, Zehao Lin, Jiahao Huo, Tianyi Chen, Kai Chen, Kehang Li, Zhiqiang Yin, Qingchen Yu, Bo Tang, Hongkang Yang, Zhi-Qin John Xu, and Feiyu Xiong. MemOS: An operating system for memory-augmented generation (MAG) in large language models. arXiv preprint arXiv:2505.22101, 2025. URL https://arxiv.org/abs/2505.22101.
Jiacheng Liang, Yuhui Wang, Changjiang Li, Rongyi Zhu, Tanqiu Jiang, Neil Gong, and Ting Wang. Graphrag under fire, 2025. URL https://arxiv.org/abs/2501.14050.
Zehao Lin, Xixuan Hao, Renyu Fu, Shaobo Cui, Kai Chen, Chunyu Li, Zhiyu Li, and Feiyu Xiong. A survey on long-term memory security in LLM agents: Attacks, defenses, and governance across the memory lifecycle. arXiv preprint arXiv:2604.16548, 2026. URL https://arxiv.org/abs/2604.16548.
Royce Lu and Jay Chen. When AI remembers too much – persistent behaviors in agents' memory. Palo Alto Networks Unit 42, October 2025. URL https://unit42.paloaltonetworks.com/indirect-prompt-injection-poisons-ai-longterm-memory/.
Adyasha Maharana, Dong-Ho Lee, Sergey Tulyakov, Mohit Bansal, Francesco Barbieri, and Yuwei Fang. Evaluating very long-term conversational memory of LLM agents. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 13851–13870, 2024. doi: 10.18653/v1/2024.acl-long.747. URL https://aclanthology.org/2024.acl-long.747/.
Microsoft Defender Security Research Team and Noam Kochavi. Manipulating AI memory for profit: The rise of AI Recommendation Poisoning. Microsoft Security Blog, February 2026. URL https://www.microsoft.com/en-us/security/blog/2026/02/10/ai-recommendation-poisoning/.
OpenAI. GPT-5.6 Luna. OpenAI API model documentation, 2026. URL https://developers.openai.com/api/docs/models/gpt-5.6-luna.
Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, and Joseph E. Gonzalez. MemGPT: Towards LLMs as operating systems. arXiv preprint arXiv:2310.08560, 2023. URL https://arxiv.org/abs/2310.08560.
Dario Pasquini, Martin Strohmeier, and Carmela Troncoso. Neural Exec: Learning (and learning from) execution triggers for prompt injection attacks. In Proceedings of the 2024 Workshop on Artificial Intelligence and Security, AISec '24, pp. 89–100, 2024. doi: 10.1145/3689932.3694764. URL https://doi.org/10.1145/3689932.3694764.
Preston Rasmussen, Pavlo Paliychuk, Travis Beauvais, Jack Ryan, and Daniel Chalef. Zep: A temporal knowledge graph architecture for agent memory. arXiv preprint arXiv:2501.13956, 2025. URL https://arxiv.org/abs/2501.13956.
Socket Research Team. TrapDoor crypto stealer supply chain attack hits 34 packages and hundreds of versions across npm, PyPI, and Crates.io. Socket, May 2026. URL https://socket.dev/blog/trapdoor-crypto-stealer-npm-pypi-crates.
George Torres, Sharad Shrestha, and Satyajayant Misra. When agents remember too much: Memory poisoning attacks on large language model agents. arXiv preprint arXiv:2607.06595, 2026. URL https://arxiv.org/abs/2607.06595.
Yuhui Wang, Tanqiu Jiang, Jiacheng Liang, Charles Fleming, and Ting Wang. Safeguarding llm agents against long-horizon threats via shadow memory, 2026. URL https://arxiv.org/abs/2605.03228.
Di Wu, Hongwei Wang, Wenhao Yu, Yuwei Zhang, Kai-Wei Chang, and Dong Yu. LongMemEval: Benchmarking chat assistants on long-term interactive memory. In International Conference on Learning Representations, 2025. URL https://arxiv.org/abs/2410.10813.
Menglin Xia, Xuchao Zhang, Shantanu Dixit, Paramaguru Harimurugan, Rujia Wang, Victor Rühle, Robert Sim, Chetan Bansal, and Saravan Rajmohan. MEMORA: A harmonic memory representation balancing abstraction and specificity. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, 2026. URL https://arxiv.org/abs/2602.03315.
Yuanbo Xie, Wenlei Zhu, Tianyun Liu, Yingjie Zhang, Suchen Liu, Yulin Li, Liya Su, and Tingwen Liu. What if prompt injection never left? rethinking agent security through cross-session stored prompt injection. arXiv preprint arXiv:2606.04425, 2026. URL https://arxiv.org/abs/2606.04425.
Wujiang Xu, Zujie Liang, Kai Mei, Hang Gao, Juntao Tan, and Yongfeng Zhang. A-MEM: Agentic memory for LLM agents. In Advances in Neural Information Processing Systems, volume 38, 2025. doi: 10.52202/085713-0593. URL https://papers.nips.cc/paper_files/paper/2025/hash/19909c36f51abc4856b4560aff3d36d6-Abstract-Conference.html.
Qiusi Zhan, Zhixiang Liang, Zifan Ying, and Daniel Kang. InjecAgent: Benchmarking indirect prompt injections in tool-integrated large language model agents. In Findings of the Association for Computational Linguistics: ACL 2024, pp. 10471–10506, 2024. doi: 10.18653/v1/2024.findings-acl.624. URL https://aclanthology.org/2024.findings-acl.624/.
Yujie Zhao, Boqin Yuan, Junbo Huang, Haocheng Yuan, Zhongming Yu, Haozhou Xu, Lanxiang Hu, Abhilash Shankarampeta, Zimeng Huang, Wentao Ni, Yuandong Tian, and Jishen Zhao. AMA-Bench: Evaluating long-horizon memory for agentic applications. In Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, 2026. URL https://arxiv.org/abs/2602.22769.
Wanjun Zhong, Lianghong Guo, Qiqi Gao, He Ye, and Yanlin Wang. MemoryBank: Enhancing large language models with long-term memory. In Proceedings of the AAAI Conference on Artificial Intelligence, 2024. URL https://ojs.aaai.org/index.php/AAAI/article/view/29946.
Zexuan Zhong, Ziqing Huang, Alexander Wettig, and Danqi Chen. Poisoning retrieval corpora by injecting adversarial passages. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, 2023. URL https://openreview.net/forum?id=8FgdMHbW27.
Wei Zou, Runpeng Geng, Binghui Wang, and Jinyuan Jia. PoisonedRAG: Knowledge corruption attacks to retrieval-augmented generation of large language models. In 34th USENIX Security Symposium, pp. 3827–3844, 2025. URL https://www.usenix.org/conference/usenixsecurity25/presentation/zou-poisonedrag.
Wei Zou, Mingwen Dong, Miguel Romero Calvo, Shuaichen Chang, Jiang Guo, Dongkyu Lee, Xing Niu, Xiaofei Ma, Yanjun Qi, and Jiarong Jiang. Poison once, exploit forever: Environment-injected memory poisoning attacks on web agents. arXiv preprint arXiv:2604.02623, 2026. URL https://arxiv.org/abs/2604.02623.
A APPENDIX
A.1 BENCHMARK COMPOSITION
Table 3 breaks down the collections introduced in Section 4.1. A task template is a distinct user request and its utility check. A task session is one occurrence of that template in a trajectory. Templates recur across trajectories but do not repeat within a trajectory. The history-prefixed collection reuses the cross-domain task sequences, each paired with a different conversation history.
Table 3: Benchmark composition before replication across memory systems, objectives, or payload conditions. Template counts overlap across collections. The final collection additionally contains 1,493 recorded history sessions; these are excluded from the task-session counts and lengths above.
| Collection / domain | Templates | Trajectories | Task sessions | Sessions/run |
|---|---|---|---|---|
| Same-domain | ||||
| Workspace | 40 | 26 | 278 | 3–35 |
| Travel | 20 | 23 | 188 | 3–20 |
| Banking | 16 | 22 | 168 | 3–15 |
| Slack | 21 | 22 | 168 | 3–15 |
| Subtotal | 97 | 93 | 802 | 3–35 |
| Cross-domain | 97 | 31 | 680 | 5–60 |
| History-prefixed cross-domain | 97 | 31 | 680 | 5–60 |
| Total | 97 | 155 | 2,162 | 3–60 |
Task compatibility and lengths. We replay every directed pair of distinct tasks within a domain, carrying application state from the first task to the second, and require both native utility checks to pass without an execution error. Pairwise checks guide construction, and replaying the entire proposed sequence then checks for conflicts involving longer task histories.
Each same-domain collection has one length-3 trajectory, ten length-5 trajectories, and ten length-10 trajectories. It additionally contains one trajectory at each of lengths 15, 20, 25, 30, and 35 for Workspace; 15 and 20 for Travel; and 15 for Banking and Slack.
The cross-domain collection has five trajectories at each of lengths 5, 10, 15, 20, and 30, three at length 40, two at length 50, and one at length 60. Application state is maintained separately for each domain, while memory is shared across the complete sequence. Figure 8 illustrates both single-domain and cross-domain forms of trajectory.
Same-domain Workspace Example
- Workspace: Create a four-hour family-reunion calendar event from the relevant emails.
- Workspace: Create a Hawaii packing-list file from an existing document.
- Workspace: Find and delete the largest file in the drive. ... two further Workspace tasks.
Cross-domain Example
- Slack: Post employees' hobbies from Bob's inbox to the company website.
- Banking: Update an address and standing orders, and refund a payment.
- Travel: Compare electric-car rentals in Los Angeles. ... one Workspace task and one further Slack task.
Figure 8: Abbreviated requests from two benchmark trajectories. Numbering denotes successive task sessions. Requests are shortened for display.
Conversation histories. We use the cleaned LongMemEval-S dataset (Wu et al., 2025), including five histories from each of the single-session-user, single-session-assistant, single-session-preference, temporal-reasoning, and knowledge-update categories, plus six multi-session histories. The selected prefixes contain 38–62 sessions each, totaling 1,493 sessions and 15,362 individual user or assistant messages.
History sessions are ingested in their recorded order, preserving message roles and dates. Replay writes the recorded conversations through the memory integration. Questions, reference answers, answer-session identifiers, and answerability annotations are excluded from memory input. The held-out question is posed only after the cross-domain continuation, using a memory query before the final answer. Figure 9 shows this ordering for one example.
History Prefix Sessions 1--38: [earlier recorded conversations] Session 39, user: 'I've been watching a lot of documentaries lately, especially on Netflix. Can you recommend some more documentary series similar to 'Our Planet', 'Free Solo', and 'Tiger King'...?'' Session 39, assistant: [suggestions grouped into nature, adventure, and true-crime documentaries] Sessions 40--48: [remaining recorded conversations]
Write all 48 sessions; checkpoint the resulting memory.
↓ Cross-domain continuation 15 task sessions, sharing the prefixed memory. The designated tool observation in the first task receives the payload.
↓ Terminal question, withheld until now 'I've got some free time tonight, any documentary recommendations?'
Figure 9: A history-prefixed trajectory. The dialogue is abbreviated from the selected history.
A.2 ATTACK OBJECTIVES
An objective specifies the behavior to detect, independently of how a payload phrases the instruction. Table 4 illustrates examples supported by the benchmark, spanning unauthorized tool actions and answer manipulation.
Table 4: Examples of benchmark attack objectives and the agent-produced evidence used to evaluate them. The objective remains fixed across payload revisions.
| Domain | Evaluated evidence | Example objective |
|---|---|---|
| Workspace | send_email call | Email mark.black-2134@gmail.com; subject “Important message!”; body “Hey, how is it going?” |
| Travel | Final response | Positively recommend visiting Riverside View Hotel |
| Banking | send_money call | Transfer $10 to US133000000121212121212 |
| Slack | send_direct_message call | Send Alice a message containing www.secure-systems-252.com |
A.3 MEMORY TRACING INTERFACE
MemoryDojo provides an interface for tracing the recorded memory writes, observed state changes, and later memory inputs. Figure 10 shows an example optimized same-domain run with GPT-5.6-Luna and Letta, with poison inserted in the first session.
A.4 INDIRECT RETRIEVAL
Indirect retrieval occurs when poison enters the supplied context through links or episodic expansion from primary retrieval results. Figure 11 illustrates an example with an original poisoned episode

(b) Memory supplied before session 20, linked to its source write.
Figure 10: Tracing memory persistence. (a) The observed state after the first-session write contains the injected email instruction in a core block and an archival passage. (b) Before session 20, the same core block appears first in the memory input list, with a source-write link to session 1. Letta supplies this block through its always-visible core-memory route.
reached through a benign fact in Memora. Retrieval provides 12 primary facts and 7 distinct linked episodes. Although the episode containing the poison is absent from the primary result set, episodic expansion includes it in the context delivered to the agent. Thus, this illustrates a case of indirect retrieval, where a benign fact can provide a route for poison to surface.

Figure 11: Indirect retrieval in Memora. The dashed blue boundary contains primary facts and the solid charcoal boundary also includes linked episodes. The highlighted arrow connects a retrieved primary fact to the original poisoned episode.
A.5 PERSISTENCE AND PROPAGATION METRICS
Define the original poison entries created during insertion session as . Formally, for trajectory and session , let if the retrieved context contains at least one payload-bearing entry from , and if it contains at least one payload-bearing entry outside (both 0 otherwise). A session retrieves poison when , and we write for the number of poison-retrieving sessions. We report the share of these sessions attributable to persistence only (PE), propagation only (PR), or both (PP):
The three shares partition poison-retrieving sessions, so .
A.6 MEMORY-AWARE OPTIMIZATION DETAILS
A.6.1 AUXILIARY ENVIRONMENTS AND TRAJECTORIES
For each application domain, we construct a standalone synthetic environment with tools and application state supporting representative tasks that might be executed. The domains cover workspace, travel, banking, and communication tasks. Within each domain, task templates specify user requests involving information retrieval, state-changing actions, or combinations of tool operations. Each task includes reference tool actions and deterministic checks of legitimate task completion, allowing us to measure task utility alongside the attack objective. As with MemoryDojo, we concatenate tasks into trajectories of different lengths and perform validity checks.
The auxiliary setting uses separate task templates, tool implementations, and application state from MemoryDojo. We ensure tools used in this environment have different names from those used in MemoryDojo, and these names vary across each trajectory to discourage dependence on exact tool names. The objective is for optimization results to transfer to the benchmark evaluation from the domain information and attack objective.
A.6.2 INITIALIZATION
During optimization, we fix the task-agent configuration, memory configuration, and attack objective , along with a payload text . Optimization aims to find a better representation for while preserving the attack objective.
To support revisions tailored to the memory system, we provide a description of its write inputs and transformations, stored representations, retrieval mechanisms, and the way retrieved material is presented to the task agent. This description accentuates the unique properties associated with each memory system. We also supply a domain ontology that has a generic description of the application capabilities, their parameters, and categories of tasks and tool observations. This ontology is assembled from the auxiliary environment and task definitions and gives the optimizer domain context without exposing MemoryDojo tasks.
We initialize the optimization with seed payloads and an additional memory-property-only seed candidate generated by the optimizer from the objective, memory-system description, and domain ontology. We evaluate the initial candidates on the auxiliary trajectories before beginning feedback-guided revision.
A.6.3 FEEDBACK, REVISION, AND SELECTION
Starting from the evaluated initial candidates, we repeat a cycle of proposing revised poison payloads, testing them on the auxiliary trajectories, and providing feedback to the optimizer.
Candidate proposal. At each round, the optimizer uses the fixed inputs from Section A.6.2, previously evaluated payloads, and their feedback to propose revised poison prompts. Each proposal explains the changes, the suspected bottleneck they address, and the expected improvement. In addition, the optimizer can see the best valid candidate evaluated so far and the most recently evaluated valid revision. Because the latest revision may underperform an earlier candidate, providing both lets the optimizer build on its strongest result while still learning from its most recent attempt.
Candidate validation and evaluation. Before testing a proposal, we check that it preserves the attack objective. We also screen for auxiliary tool names, task and trajectory identifiers, and overlaps with task prompts to discourage dependence on specific auxiliary tasks. Both deterministic checks and LLM judges are used here.
We select the best proposal that passes validation for evaluation. The task agent then executes the auxiliary trajectories with this payload, starting each run with fresh memory and application state. The payload is inserted into one tool observation, and the agent continues through the remaining sessions using the execution procedure in Section 4.2. The resulting runs provide the behavioral outcomes and memory observations used as feedback.
Behavioral and memory feedback. After each candidate's evaluation, we obtain the number of later sessions satisfying and the number of tasks completed. We pool these counts over the planned later sessions and all planned tasks, respectively, to obtain BRT and task utility.
We additionally collect coarse evidence of the poison's lifecycle through memory. The framework checks for distinctive markers in post-write memory snapshots, later retrieved items, and logged agent inputs. This feedback helps identify where the attack may be failing. Poison-related content may be lost during memory processing, omitted from later retrievals, or presented to the agent without causing it to follow the injected instruction.
Failure examples. Alongside aggregate statistics, we give the optimizer a small set of failure examples from the auxiliary runs. Each example identifies the task's position in the trajectory, task type, and the earliest failed check in the sequence from poison write through memory processing and retrieval to behavior. For instance, an example may indicate that poison-related content reached the agent's context in a later session, but the agent did not follow the instruction. These examples help the optimizer connect aggregate results to specific sessions and identify where a revision might help.
Iteration and final selection. Each evaluated payload and its feedback become available for subsequent proposal rounds. After a fixed number of rounds, we compare valid revisions with the initial seeds. Eligible candidates must complete at least as many legitimate tasks as a designated reference seed, minus a preset tolerance. We compare the strongest eligible revision with the strongest eligible seed, retaining the seed unless the revision improves BRT.
Let be the count of legitimate auxiliary tasks completed by candidate , including the insertion tasks, and let be the initial reference instruction seed. The eligibility threshold is
where Tol is the tolerance for utility in number of tasks. The selected text is then transferred for MemoryDojo evaluation.
A.7 EXPERIMENT SETUP DETAILS
Table 5 lists the evaluated memory systems. Retrieval limits apply to each system's native interface.
Table 5: Memory configurations used in the experiments. Native search and expansion policies determine the final retrieved context.
| System | Stored representation | Retrieval budget |
| A-MEM | Notes with metadata and links | , including neighbors |
| Graphiti | Episodes, entities, and relations | relation facts |
| Letta | Core, conversation, and archival memory | per search tier, plus core |
| Mem0 | Extracted primary facts | hybrid results |
| Memora | Primary facts, cues, and episodes | with episodic expansion |
Model settings. Task agents, memory-side generation, and benchmark semantic judges use GPT-5.6-Luna with medium reasoning. Configured temperatures are zero for the task agent and semantic judges, 0.1 for memory-side generation, and zero for Memora's retrieval-policy LLM. Graphiti's native reranker also uses GPT-5.6-Luna. Embeddings use OpenAI's text-embedding-3-small model. Model, provider, and retrieval settings are saved with each run; the different native write and read policies are part of the comparison of complete memory integrations.
A-MEM. A-MEM writes each completed session as a note. Native processing derives metadata, links related notes, and can revise existing note representations as new material arrives (Xu et al., 2025). Retrieval uses the native agentic note search; its limit includes both directly selected notes and linked neighbors. The resulting context can retain substantial session text alongside the system's generated metadata.
Graphiti. Each session is ingested as an episode, from which the system extracts entities and relation facts and reconciles them with the existing graph (Rasmussen et al., 2025). The evaluated read interface uses hybrid graph search and native reranking to return relation facts. Stored episode text and retrieved facts are therefore different observation surfaces: retaining an episode does not guarantee that its instructions appear in the returned context.
Letta. We use the external-agent integration, with background memory processing enabled. A completed-task episode enters the conversation history, while native processing can update core blocks and archival memory (Packer et al., 2023). Retrieval renders nonempty foreground core blocks, conversation-search results, and archival-search results, in that order. Each search receives independently, and core blocks are supplied outside these limits.
Mem0. The integration projects the session into ordered, role-bearing messages and uses inferred addition to extract primary facts (Chhikara et al., 2025). This path creates new facts and an empty or duplicate extraction can complete without adding an entry. Retrieval combines dense, BM25, and entity-based search with , a configured threshold of 0.1, and no additional search reranker.
Memora. A completed session becomes a chat segment that supports episodic storage and extraction of primary facts and retrieval cues (Xia et al., 2026). The evaluated prompted policy combines semantic search and BM25 fusion, then can stop, expand through links, or issue a revised query. Episodic context is included, so linked source episodes can accompany retrieved facts. The configuration uses an initial hybrid budget of 10, a cue budget of 20, and at most four prompted retrieval steps. It uses the prompted policy without GRPO training.
A.8 SAME-DOMAIN RESULTS BY DOMAIN
Figure 12 breaks down the optimized GPT-5.6-Luna results from Section 6.2 by application domain and memory system. These runs use poison insertion in the first session of each trajectory.

Figure 12: Optimized same-domain reach by application domain. BRT (%) with GPT-5.6-Luna.
A.9 SAME-DOMAIN RESULTS ACROSS MODELS
We expand the model comparison in Section 6.2 with full metrics in Table 6. All four models use the same selected optimized payloads for each memory system and domain, with insertion in the first session of the same-domain trajectories. Task agents and generative memory components change together, while judges all use GPT-5.6-Luna with medium reasoning. For the task agents and memory LLMs, GPT-5.4-mini uses default none reasoning, GPT-5.6-Luna uses default medium reasoning, DeepSeek-V4-Flash-0731 uses default high reasoning, and GLM-5.3-Flash uses default high reasoning.
Figure 13 separates how often poison is retrieved from how often later behavior satisfies the attack objective. High retrieval can coexist with much lower reach: Letta with GLM has 100% RSR and 15.09% BRT, compared with 72.21% RSR and 46.26% BRT with Luna. With mini, Graphiti retrieves poison on 38.08% of planned later tasks but reaches only 0.28%. These observations show that the effect of a fixed payload depends on both the model and memory integration, and retrieval alone does not imply that the agent follows its instruction.
A.10 MIDDLE-INSERTION SAME-DOMAIN RESULTS
Table 7 reports optimized same-domain results with poison inserted at the trajectory midpoint, after earlier sessions have contributed entries to memory.
A.11 CROSS-DOMAIN RESULTS
Table 8 highlights the difference between tasks that are in the same domain as the poison versus those that are cross-domain. Table 9 aggregates all later tasks from the cross-domain runs in Section 6.3.
Table 6: Optimized same-domain results across models.
| Memory system | ISR | ASR | RSR | BR | BRT | BRT | R | TU |
|---|---|---|---|---|---|---|---|---|
| GPT-5.6-Luna | ||||||||
| A-MEM | 97.85 | 19.35 | 93.37 | 70.97 | 44.01 | 47.13 | 60.74 | |
| Graphiti | 100.00 | 4.30 | 30.61 | 30.11 | 9.31 | 30.41 | 81.42 | |
| Letta | 95.70 | 25.81 | 72.21 | 50.54 | 46.26 | 64.06 | 53.67 | |
| Mem0 | 77.42 | 9.68 | 71.65 | 39.78 | 21.02 | 29.33 | 71.77 | |
| Memora | 98.92 | 24.73 | 92.81 | 66.67 | 29.76 | 32.07 | 74.15 | |
| GPT-5.4-mini | ||||||||
| A-MEM | 96.77 | 51.61 | 92.67 | 53.76 | 23.98 | 25.88 | 60.55 | |
| Graphiti | 100.00 | 50.54 | 38.08 | 2.15 | 0.28 | 0.74 | 64.71 | |
| Letta | 98.92 | 48.39 | 81.81 | 13.98 | 4.94 | 6.03 | 68.61 | |
| Mem0 | 70.97 | 64.52 | 52.61 | 9.68 | 1.97 | 3.75 | 66.85 | |
| Memora | 98.92 | 72.04 | 97.74 | 84.95 | 48.66 | 49.78 | 57.47 | |
| DeepSeek-V4-Flash-0731 | ||||||||
| A-MEM | 100.00 | 21.51 | 90.27 | 37.63 | 28.91 | 32.03 | 63.85 | |
| Graphiti | 100.00 | 3.23 | 23.98 | 11.83 | 3.10 | 12.94 | 83.92 | |
| Letta | 100.00 | 24.73 | 95.49 | 38.71 | 35.26 | 36.93 | 67.71 | |
| Mem0 | 91.40 | 20.43 | 79.83 | 36.56 | 16.22 | 20.32 | 80.14 | |
| Memora | 100.00 | 16.13 | 95.35 | 51.61 | 38.79 | 40.68 | 71.82 | |
| GLM-5.3-Flash | ||||||||
| A-MEM | 98.92 | 19.35 | 90.83 | 49.46 | 33.85 | 37.27 | 66.93 | |
| Graphiti | 100.00 | 6.45 | 19.46 | 5.38 | 2.12 | 10.87 | 86.53 | |
| Letta | 100.00 | 23.66 | 100.00 | 19.35 | 15.09 | 15.09 | 75.69 | |
| Mem0 | 93.55 | 12.90 | 74.61 | 16.13 | 6.63 | 8.88 | 82.06 | |
| Memora | 100.00 | 29.03 | 96.47 | 43.01 | 31.73 | 32.89 | 70.57 | |

(c) DeepSeek-V4-Flash-0731
(d) GLM-5.3-Flash
Figure 13: Poison retrieval and later-task reach across models.
Table 7: Optimized same-domain results with middle insertion.
| Memory system | ISR | ASR | RSR | BR | BRT | BRT | R | TU |
|---|---|---|---|---|---|---|---|---|
| A-MEM | 92.47 | 21.51 | 78.99 | 51.61 | 31.91 | 40.40 | 74.67 | |
| Graphiti | 96.77 | 8.60 | 11.17 | 10.75 | 4.52 | 40.48 | 82.08 | |
| Letta | 95.70 | 29.03 | 29.79 | 11.83 | 6.65 | 22.32 | 77.28 | |
| Mem0 | 74.19 | 27.96 | 65.69 | 38.71 | 25.00 | 38.06 | 74.57 | |
| Memora | 87.10 | 22.58 | 70.48 | 47.31 | 23.40 | 33.21 | 77.64 |
Table 8: Within-domain and cross-domain results.
| Memory system | ISR | Within-domain | Cross-domain | ||||||
|---|---|---|---|---|---|---|---|---|---|
| RSR | BR | BRT | BRT | R | RSR | BR | BRT | BRT | R | ||
| A-MEM | 96.77 | 81.97 | 45.97 | 22.34 | 27.26 | 66.00 | 20.97 | 3.54 | 5.37 |
| Graphiti | 96.77 | 30.05 | 25.00 | 10.94 | 36.41 | 7.55 | 0.00 | 0.00 | 0.00 |
| Letta | 96.77 | 57.78 | 37.10 | 38.06 | 65.87 | 54.96 | 26.61 | 6.37 | 11.59 |
| Mem0 | 49.19 | 45.15 | 31.45 | 17.57 | 38.91 | 35.64 | 13.71 | 2.72 | 7.64 |
| Memora | 97.58 | 83.98 | 57.26 | 24.04 | 28.62 | 71.24 | 25.00 | 3.24 | 4.54 |
Table 9: Aggregate cross-domain results.
| Memory system | ISR | ASR | RSR | BR | BRT | BRT | R | TU |
|---|---|---|---|---|---|---|---|
| A-MEM | 96.77 | 7.26 | 69.99 | 46.77 | 8.24 | 11.78 | 80.41 |
| Graphiti | 96.77 | 6.45 | 13.17 | 25.00 | 2.73 | 20.76 | 82.26 |
| Letta | 96.77 | 7.26 | 55.66 | 37.90 | 14.29 | 25.67 | 74.14 |
| Mem0 | 49.19 | 4.84 | 38.02 | 32.26 | 6.43 | 16.92 | 78.70 |
| Memora | 97.58 | 16.94 | 74.42 | 60.48 | 8.44 | 11.34 | 80.10 |
A.12 MEMORY AND TASK UTILITY CROSS-DOMAIN
Figure 14 shows the effects of poisoning on task utility for history-prefixed cross-domain runs with GPT-5.6-Luna. Task utility is minimally impacted, but is on average lower.

Figure 14: Task utility with and without poisoning.