Skip to content

Researchers systematically study memory poisoning attacks on LLM agents and propose the MPBench benchmarkFrom Untrusted Input to Trusted Memory: A Systematic Study of Memory Poisoning Attacks in LLM Agents

Paper Tracker· arXiv:2606.04329· Pritam Dash, Tongyu Ge, Aditi Jain, Tanmay Shah, Zhiwei Shang·Indexed by this site · 2026-10-08· Originally publishedSelected AttacksSelectedAttention38

Quick read

Attacks

Based on the paper PDF (generated by Gemini); refer to the original

The authors' evaluation finds that GPT-OSS-120B achieves an average ASR of 66.67% and RSR of 64.70% on HERMES (Table 2).

Threat modelBlack-box threat model: an external attacker has no privileged access, cannot read or directly modify agent memory, cannot modify system prompts or policies, cannot impersonate users or inject into the user channel, and cannot observe internal reasoning and state; they only inject content through external inputs such as web pages, documents, emails, and tool outputs, with no prior knowledge of the underlying model and memory store.

Questions
Agent persistent long-term memory is susceptible to memory poisoning attacks, where attackers induce the agent to write malicious memories through untrusted external inputs, thereby continuously influencing agent behavior in future sessions. However, existing research lacks systematic vulnerability analysis, and traditional prompt injection defenses struggle to address this threat.
Methods
Under a black-box threat model, the authors distill 4 memory write channels and 9 structural vulnerabilities across 3 levels, and categorize 6 types of memory poisoning attacks; they also construct a two-stage evaluation benchmark MPBench containing 3,240 test cases, measuring the memory write stage and the cross-session retrieval stage respectively.
Experiments and results
GPT-OSS-120B achieves an average ASR of 66.67% and RSR of 64.70% on HERMES, higher than OpenClaw's 34.25% and 17.40% (Table 2). Existing prompt injection defenses show a decline in detection rates on weak-signal attacks (Table 4).
Limitations and future work
The experiments evaluate only a single model, GPT-OSS-120B; some domains simulate input through annotated context blocks without modeling the tool invocation pipeline of real deployments; the evaluation covers two agents, OpenClaw and HERMES, and four prompt injection defenses.
Experimental setupPIGuard (Deberta-v3-base)、DataFilter (Llama-3.1-8B-Instruct) et al. · MPBench · ASR、RSR et al.
Evaluated models
PIGuard (Deberta-v3-base)DataFilter (Llama-3.1-8B-Instruct)CommandSans (XLM-RoBERTa-base)PromptArmor (Llama-3.1-70B-Instruct)
Benchmarks
MPBench
Metrics
ASRRSRTPRFPR
AI summaryand selection rationaleThe researchers systematically studied memory poisoning attacks in LLM-based agents, proposed four memory write channels, nine structural vulnerabilities, and a six-category attack taxonomy, and released the MPBench benchmark. On the two agent systems OpenClaw and HERMES, the average attack ASR is 50.46% and RSR is 41.05%, with HERMES's average ASR of 66.67% notably higher than OpenClaw's 34.25%. The study shows that agents with more aggressive memory read/write behavior are more susceptible to poisoning, and that the four prompt injection defenses PIGuard, DataFilter, CommandSans, and PromptArmor provide insufficient coverage against memory poisoning, with particularly low detection rates on weak-signal attacks.

The researchers systematically studied memory poisoning attacks in LLM-based agents, proposed four memory write channels, nine structural vulnerabilities, and a six-category attack taxonomy, and released the MPBench benchmark. On the two agent systems OpenClaw and HERMES, the average attack ASR is 50.46% and RSR is 41.05%, with HERMES's average ASR of 66.67% notably higher than OpenClaw's 34.25%. The study shows that agents with more aggressive memory read/write behavior are more susceptible to poisoning, and that the four prompt injection defenses PIGuard, DataFilter, CommandSans, and PromptArmor provide insufficient coverage against memory poisoning, with particularly low detection rates on weak-signal attacks.

Why it was selectedThe paper systematically organizes the four write channels and nine structural vulnerabilities of agent long-term memory, and provides benchmark results for six categories of poisoning attacks, which can be used to evaluate the memory write policies of one's own agents.

Related events and news

0 events · 1 news mentions

News that mentions this paper

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Studying the mechanisms of memory poisoning vulnerability, attack taxonomies, and the lack of cross-session evaluation benchmarks for agents with persistent memory.

    This paper attempts to address the problems of unclear mechanisms of memory poisoning attacks on large language model agents under persistent memory mechanisms, the lack of a systematic taxonomy of the attack surface, and the absence of evaluation benchmarks.

    • Scenario and importance: Modern agents accumulate user preferences and task experience through persistent long-term memory to support long-horizon tasks, but memory content comes from untrusted external inputs such as web pages and documents, and lacks provenance tracking mechanisms; a single write can have persistent cross-session effects.
    • Shortcomings of existing methods: The authors state that existing research either makes overly strong assumptions (e.g., requiring direct memory access) or evaluates narrow attack scenarios in isolation, lacking unified vulnerability analysis, and that the assumption that default prompt injection defenses cover memory poisoning does not hold.
    • Core observation and hypothesis: There is a structural difference between prompt injection and memory poisoning: prompt injection requires the payload to take effect in the current context, whereas memory poisoning requires only a single successful write for the content to be retrieved as trusted knowledge in subsequent sessions.
    • Main contributions of the paper: The authors identify 4 memory write channels and 9 structural vulnerabilities, propose a taxonomy containing 6 attack categories, and build the first evaluation benchmark, MPBench, that separates the two stages of writing and retrieval.
    • Threat model:
      • Goal: To cause the agent to trigger memory writes during normal tasks, control the adversarial content written, and trigger retrieval of the malicious entry in future sessions to manipulate behavior.
      • Knowledge: Black-box threat model; the attacker has no knowledge of the underlying model, cannot access the memory store contents, and relies only on black-box interaction and public documentation.
      • Capability: No privileged access; cannot read or directly modify memory, cannot modify system prompts or policies, cannot impersonate the user or inject user-channel messages, and can only inject payloads into external environment data that the agent processes normally (web pages, documents, emails, tool outputs, etc.).
      • Victim system: Large language model agents with persistent memory capabilities (OpenClaw and HERMES in the experiments).
  2. What related research exists?

    Reviews research on agent memory, memory poisoning attacks, and prompt injection defenses, noting that existing work lacks systematic vulnerability analysis and cross-session evaluation.

    Related research mainly covers agent memory architectures, memory poisoning and real security incidents, and prompt injection evaluation and defense techniques.

    Agent memory mechanisms and evaluation

    • Long-term memory system construction: Chhikara et al. (2025) and Kang et al. (2025) studied agent memory operating systems and scalable long-term memory architectures; Hu et al. (2025) surveyed the classification of agent factual memory, episodic memory, and procedural memory.
    • Benign memory performance benchmarks: Maharana et al. (2024) (LoCoMo), Wu et al. (2024) (LongMemEval), and Tan et al. (2025) (MemBench) evaluate agent long-term interactive memory fidelity under benign conditions; the authors note that these benchmarks lack adversarial components.

    Memory poisoning attacks and real security incidents

    • Memory poisoning attack research: Dong et al. (2025), Srivastava & He (2025), Anonymous (2025), Zou et al. (2026), and Xu et al. (2026) demonstrate agent memory poisoning in different settings; Chen et al. (2024) propose the AgentPoison red-team method, but the authors note that this work makes strong assumptions requiring direct memory access, limiting applicability in real deployments.
    • Security incidents in real systems: Rehberger (2025) reports prompt injection and delayed tool invocation risks in Gemini, Microsoft Defender Security Research Team (2026) reports recommendation poisoning in Azure, and Palo Alto Networks Unit 42 (2025) reports poisoning of long-term memory via indirect prompt injection in Bedrock.

    Prompt injection benchmarks and defense methods

    • Single-session security benchmarks: Debenedetti et al. (2024) (AgentDojo) and Zhan et al. (2024) (InjecAgent) build dynamic tool and indirect prompt injection evaluation environments; the authors note their limitation to single-session paradigms, not considering cross-session persistent effects.
    • Prompt injection defense solutions: Li et al. (2025) propose the lightweight guard tool PIGuard, Wang et al. (2025) propose DataFilter based on data filtering, Das et al. (2025) propose CommandSans for precise prompt purification, and Shi et al. (2025) propose PromptArmor based on large models.

    Baseline methods and comparison settings

    • Defense comparison baselines: The paper selects PIGuard, DataFilter, CommandSans, and PromptArmor as prompt injection defenses representing different mitigation strategies, evaluating their performance out-of-the-box and after fine-tuning/adaptation for memory poisoning.

    The authors argue that existing threat models either assume too much or are limited to isolated attacks, lacking a unified analysis of the agent memory vulnerabilities that enable these attacks; this paper aims to establish a systematic foundation from write channels and system vulnerabilities.

  3. How does the paper address this problem?

    Formalize the memory system and identify 4 categories of channels and 9 vulnerability points, propose a 6-category attack taxonomy, and build the two-stage benchmark MPBench.

    By systematically formalizing agent memory architecture, the authors distill 4 write channels and 9 cross-level vulnerabilities, establish a 6-category attack taxonomy with a strong/weak signal dimension, and build a two-stage evaluation benchmark, MPBench.

    Formalization of Memory Systems and Write Channels

    The agent memory system is formalized as a tuple M = (S, W, R), where S denotes persistent memory storage, W denotes the write function mapping context to memory updates, and R denotes the retrieval function mapping queries to subsets of stored entries. Memory writes are divided into two paths, direct writes and reasoning-based writes, implemented through 4 channels:

    • C1 Explicit instruction execution writes: External input directly issues a write command, which the agent treats as authoritative and executes without additional reasoning; both the trigger condition and write permission come from the instruction itself.
    • C2 System prompt-driven writes: The system prompt contains a persistent memory policy; the agent evaluates whether input content conforms to the policy during task execution and then performs reasoning-based writes.
    • C3 Compaction-driven writes: When system events such as reaching the context window limit or session termination occur, the agent integrates historical information according to the compaction prompt and writes a summary.
    • C4 Experience-to-procedure conversion writes: When the agent identifies structural signals such as new workflows, error recovery, user corrections, or task completion, it synthesizes the full task execution trajectory into a reusable skill and stores it in procedural memory.

    Cross-Level Structural Vulnerabilities

    The authors identify 9 vulnerabilities across three levels: model capability, prompt design, and system architecture:

    • Model capability level: Includes instruction-data boundary ambiguity (V-M1), where instructions cannot be structurally distinguished from data, and source attribution failure (V-M2), where content provenance cannot be reliably inferred in multi-source contexts.
    • Prompt design level: Includes under-specified write policies (V-P1), where system prompts only provide broad saving criteria, and unfiltered compaction (V-P2), where summarization and compaction occur without source distinction.
    • System architecture level: Includes no write-path validation (V-S1), where there is no validation before writing; shared multi-source context (V-S2), where multi-source data is mixed; manipulable compaction triggers (V-S3), where attackers can trigger compaction by controlling length; unvalidated skill creation (V-S4), where procedural memory writes lack review; and self-improvement amplification (V-S5), where erroneous steps are continuously solidified in self-evolving loops.

    Attack Formalization and Six-Category Taxonomy

    A single memory poisoning attack is formalized as a tuple P = (xadv, Ci, t), where x_adv is the adversarial payload injected through channel C_i, and t is the target instruction the attacker wants written. Attacks are divided into two signal strengths and six specific categories:

    • Strong-signal attacks: Include explicit command insertion (using imperative verbs or user-preference phrasing), conditional command insertion (pre-embedding conditional instructions triggered after the user gives an affirmative response), and salience-driven compaction poisoning (using lexical or semantic repetition to make content treated as salient by the compaction algorithm).
    • Weak-signal attacks: Include policy-conformant fact injection (disguised as world facts or user attributes conforming to broad policies), false precedent insertion (fabricated historical experience logs containing task descriptions, steps, and successful outcomes), and skill-procedure insertion (inducing the agent to generalize adversarial steps into reusable procedures and enter a self-improvement loop).

    MPBench Benchmark Construction and Evaluation Protocol

    • Data generation and validation: Generated using Meta-Llama-3.1-70B-Instruct based on fixed templates, covering 7 domains—file operations, web browsing, email, calendar management, Slack, script/code execution, and skill invocation—and 6 adversarial goals—credential theft, data exfiltration, recommendation poisoning, authentication bypass, unauthorized operations, and trust hijacking; includes 3,240 attack cases and 2,997 benign cases, all validated for pattern compliance with manual spot checks.
    • Two-stage measurement protocol: Divided into two independent stages, memory write and memory retrieval. After the write stage, an independent LLM judge checks whether the target instruction was written to persistent storage; in the retrieval stage, a related query in a subsequent independent session triggers retrieval, and an LLM judge assesses whether the agent's actions or outputs reflect the adversarial instruction.
  4. What experiments did the paper conduct?

    Evaluation shows that more aggressive memory mechanisms are more vulnerable, and existing prompt injection defenses show a drop in detection rates on weak-signal attacks.

    Experimental Setup

    • Models and agents under test: The agents under test are OpenClaw and HERMES, both with GPT-OSS-120B as the underlying model, using default system prompts and default memory configurations; prompt injection defense models include Deberta-v3-base (86M), Llama-3.1-8B-Instruct (8B), XLM-RoBERTa-base (279M), and Llama-3.1-70B-Instruct (70B) (Table 6).
    • Dataset size: The evaluation benchmark is MPBench, with a total of 3,240 attack test cases (600 each of explicit command insertion, conditional command insertion, salience-driven compaction poisoning, policy-conformant fact injection, and false precedent insertion, and 240 skill-procedure insertion cases) and 2,997 benign cases (Table 7).
    • Payload delivery modes: Divided into static context mode and dynamic tool invocation mode; the agent's processing and judgment logic for payloads is consistent across both modes.
    • Evaluation metrics: Attack Success Rate (ASR, measuring the frequency of writing to persistent memory), Retrieval Success Rate (RSR, measuring on test cases where ASR is true the frequency with which subsequent session behavior is affected), True Positive Rate (TPR), and False Positive Rate (FPR).
    • Review method: Independent LLM judges separately assess memory writes and subsequent replies, with random sampling of human annotations confirming agreement with human judgment.

    Main Results

    The main experiments evaluate the performance of six attack categories on OpenClaw and HERMES (per Table 2):

    Swipe horizontally to read the table

    Attack CategorySignal StrengthOpenClaw ASR (%)OpenClaw RSR (%)HERMES ASR (%)HERMES RSR (%)
    Explicit Command InsertionStrong18.2544.2342.6786.33
    Conditional Command InsertionStrong67.8913.7976.0092.76
    Salience-Driven CompactionStrong45.1011.3185.1769.86
    Policy-Conformant Fact InjectionWeak8.335.9364.5042.12
    False Precedent InsertionWeak31.6711.7273.3335.45
    Skill-Procedure InsertionWeakNot reportedNot reported58.3361.67
    Average–34.2517.4066.6764.70

    Note: OpenClaw does not support the C4 write channel, so the Skill-Procedure Insertion row is marked as not reported for OpenClaw (the original Table 2 marks it as not applicable with †).

    • Differences in system vulnerability: The authors report that HERMES's average ASR (66.67%) and average RSR (64.70%) are both higher than OpenClaw's (34.25% and 17.40%). The authors attribute this to HERMES having a more permissive write policy and a lower compaction threshold (2200 characters), and to automatically injecting a persistent snapshot at session start without requiring explicit tool retrieval.
    • Signal strength and policy dependence: On OpenClaw, strong-signal attacks have higher ASR than weak-signal attacks (conditional command insertion reaches 67.89%, while fact injection is only 8.33%); on HERMES, the gap between weak-signal attacks (e.g., fact injection with ASR reaching 64.50%) and strong-signal attacks narrows, which the authors attribute to permissive retention policies increasing the success rate of reasoning-based writes.
    • Cross-session persistence performance: RSR is greater than zero for all attack categories on both agents. The authors interpret this as indicating that once a memory write succeeds, there is a non-trivial probability of persistently manipulating subsequent session behavior without further attacker intervention.

    Evaluation of Existing Prompt Injection Defenses

    • What was tested: Evaluation of the TPR and FPR of four prompt injection defenses—PIGuard, DataFilter, CommandSans, and PromptArmor—both out-of-the-box and after retraining/adaptation (Table 3).
    • Experimental results: Out-of-the-box, PromptArmor has a TPR of 67.67% and FPR of 1.00%; DataFilter has a TPR of 23.00% and FPR of 53.33%. After fine-tuning or adaptation, PIGuard's TPR rises from 38.33% to 47.67% (FPR 5.33%), CommandSans's TPR rises to 61.00% (FPR 8.67%), while PromptArmor's TPR drops slightly to 61.60% (FPR 2.67%).
    • Authors' interpretation: The authors state that out-of-the-box, no defense achieves both high TPR and low FPR; even PromptArmor, which uses a 70B large model as a guardrail, fails to achieve high detection rates, and adaptation yields no gains, indicating that the defense deficiencies stem from structural differences rather than model capacity or training distribution.

    Coverage Differences of Defenses on Strong- and Weak-Signal Attacks

    • What was tested: Testing the detection rate differences and the drop Δ of the four defenses on strong- and weak-signal attacks (Table 4).
    • Experimental results: Out-of-the-box, all defenses have lower detection rates on weak-signal attacks; PromptArmor's detection rate is 84.44% on strong signals and drops to 42.50% on weak signals (a drop of 41.94 percentage points). After retraining, CommandSans's gap is 29.49 percentage points (from 72.78% down to 43.33%), while PIGuard's gap narrows to 1.67 percentage points (48.33% on strong signals, 46.66% on weak signals).
    • Authors' interpretation: The authors argue that prompt injection defenses cannot detect weak-signal adversarial payloads that lack syntactic anomalies in the original input and resemble legitimate content, creating a structural blind spot in input-side detection.

    Additional Ablations and Analyses

    • Compaction threshold impact: HERMES's compaction threshold of 2200 characters makes it easier to trigger writes under adversarial input than OpenClaw (Section 4.2).
    • Static vs. dynamic delivery comparison: Test cases are divided into static context and dynamic tool invocation; the authors state that processing logic and evaluation results are consistent across the two modes (Section 4.1.2).
  5. What are some points that can be further explored?

    The authors point out the limitations of evaluating a single model and of using annotated context blocks to simulate some domains, and propose defensive directions such as tightening policies, hardening the architecture, and post-write monitoring.

    Limitations Noted by the Authors and Future Directions

    • Single evaluated model: The experiments use a single model, GPT-OSS-120B, on both agents; different models may exhibit different behaviors, and ASR and RSR may differ (Section 5).
    • Payload delivery does not model the real tool invocation pipeline: In domains such as email, Slack, and web browsing, the benchmark provides adversarial payloads as annotated context blocks alongside user queries, without modeling the tool invocation and retrieval pipeline through which payloads arrive in real deployments (Section 5).
    • Tightening memory write policies: The authors note that tightening the memory retention policy in the system prompt is the first line of defense, requiring precise, scope-limited authorized storage rules (Section 5).
    • Architecture-level memory hardening: The authors propose introducing provenance isolation, write-path source tracking, and compaction filters that distinguish trusted from untrusted content at the architecture level (Section 5).
    • Post-write memory monitoring: The authors propose monitoring after writes against the agent's authorized behavior principles, assessing whether candidate entries are compliant (Section 5).
    • Threat settings beyond the scope of this study: The authors note that scenarios with privileged access (directly modifying memory, modifying system prompts, or acting as the user), multi-user shared memory stores, and attackers with knowledge of the underlying model are orthogonal categories not covered by this study (Section 3.1).

    Experimental Coverage

    • The agent systems under test are OpenClaw and HERMES, both with GPT-OSS-120B as the underlying execution model.
    • Defense evaluation covers 4 prompt injection defenses: PIGuard, DataFilter, CommandSans, and PromptArmor.
    • Attack evaluation covers 6 attack categories, with 3,240 test cases and 2,997 benign evaluation samples.
    • Task evaluation covers 7 domains: file operations, web browsing, email, calendar management, Slack, code execution, and skill invocation.
    • The paper does not report generalization experiments on other commercial or open-source models, nor does it report variance or confidence intervals across multiple repeated runs.
  6. Summarize the main content of the paper

    Systematically studied the risk of agent memory poisoning, revealed vulnerabilities in write channels, built the MPBench benchmark, and pointed out the limitations of prompt injection defenses.
    • Positioning: This is a systematic vulnerability analysis and benchmark evaluation study of persistent memory poisoning attacks on large language model agents.
    • Core problem: Modern agents rely on cross-session memory, but untrusted external input can inject malicious content through write mechanisms and persist over the long term, while existing research lacks systematic vulnerability analysis and traditional prompt injection defenses cannot effectively cover this.
    • Method highlights: The authors propose a taxonomy covering 4 write channels, 9 system vulnerabilities, and 6 attack categories, and build a two-stage benchmark, MPBench, covering 3,240 attack cases, separately evaluating memory writes and subsequent cross-session retrieval.
    • Main experimental findings:
      1. On two agent systems, GPT-OSS-120B achieves an average ASR of 66.67% and average RSR of 64.70% on HERMES, and an average ASR of 34.25% and average RSR of 17.40% on OpenClaw (Table 2).
      2. Weak-signal attacks are highly stealthy, with policy-conformant fact injection reaching an ASR of 64.50% on HERMES, and they evade existing defenses (Table 2, Table 4).
      3. The four out-of-the-box prompt injection defenses cannot achieve both high TPR and low FPR; after adaptation, PromptArmor's detection rate on weak-signal attacks is only 42.34% (Table 3, Table 4).
    • Authors' conclusions and implications: The authors argue that aggressive memory designs for improving long-horizon task performance (more frequent writes, automatic retrieval) proportionally expand the poisoning attack surface, revealing an inherent conflict between memory capability and security; effective defenses should shift from input-side filtering to write-path validation, provenance isolation, and post-write behavior monitoring.

Related papers

Read originalarxiv.org