cs.CRSep 12, 2026

When Malicious Instructions Persist: Persistent Memory Poisoning Attack on Harness-Based Agents

Authors: Shuhuai Huang, Jingfeng Zhang, Hong Jia

Organizations: University of Auckland · Fudan University

Abstract

Harness design has transformed the development of LLM-based agents by integrating memory, tool use, and runtime control. However, this design also introduces security and privacy risks because malicious instructions from external sources may be written into persistent memory and persist across sessions. To study this risk, we propose PMPA, a Persistent Memory Poisoning Attack against harness-based agents. PMPA embeds malicious instructions into benign external sources and induces the victim agent to write them into persistent memory without directly accessing to the agent framework. Once stored, the poisoned memory can be retrieved in later sessions, triggering additional malicious actions and causing privacy leakage. We evaluate PMPA on OpenClaw and Claude Code across different backbone LLMs, input modalities, and trigger scenarios. Across all settings, PMPA achieves average Injection Success Rate (ISR) and Cross-session Attack Success Rate (C-ASR) of 73.7%/ 55.5% on OpenClaw and 66.9%/ 81.7% on Claude Code, while preserving benign task performance on both systems. We further evaluate a targeted prompt-level defense and find that it can reduce memory injection in many settings, but provides limited protection once the persistent memory has been poisoned.

Figures & tables

Appendix figures & tables1 asset

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. From Untrusted Input to Trusted Memory: A Systematic Study of Memory Poisoning Attacks in LLM Agents

    Jun 3, 2026Pritam Dash, Tongyu Ge, Aditi Jain +2AI Agent Security BenchmarksAgent Memory Poisoning

  2. MemPoison: Uncovering Persistent Memory Threats and Structural Blind Spots in LLM Agents

    Jul 16, 2026Jifeng Gao, Kang Xia, Yi Zhang +5LLM Agent MemoryLLM Agent Security

  3. Hidden in Memory: Sleeper Memory Poisoning in LLM Agents

    May 14, 2026Sidharth Pulipaka, Stanislau Hlebik, Leonidas Raghav +4Persistent Memory for Language ModelsLLM Security