When Malicious Instructions Persist: Persistent Memory Poisoning Attack on Harness-Based Agents
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.
Create a lesson
Metadata
- Categories
- cs.CR, cs.AI
- Comments
- 14 pages, 1 figures. Code: https://github.com/hsh754/PMPA
Related papers
Cross User/App Network Attacks - Hijacking TCP Connections and DNS Cache Poisoning via a Malicious User/App (Extended Version)
Shared title terminologycs.CRTamir Shahar, Amit Klein
Data Poisoning Attacks and Defenses to Local Differential Privacy Protocols: A Survey
Shared title terminologycs.CRXinyu Li, Xuebin Ren, Shusen Yang et al.
A Persuaded Agent Cannot Persuade the Checker: Verified Differential Privacy Configuration by LLM Agents under Malicious Requesters
Shared title terminologycs.CRWenjun Yang, Eyhab Al-Masri, Tianhao Wang
SPAR: Sparse-space Poisoning Attack on Retrieval-Augmented Generation Systems
Shared title terminologycs.CRQingyuan Zheng, Min Ren, Saihui Hou et al.
Parse, Don't Read: Grammar-Based Monitoring and Its Limits for Tracing Untrusted Instructions in AI Agent Actions
Shared title terminologycs.CRAsif Pinjari, Varun Talari, Dileep Kumar Salla et al.
Forensic Visibility of Malicious Model Context Protocol (MCP) Servers: An Empirical Study Across Agent and Kernel Trust Boundaries
Shared title terminologycs.CRCesar R. Beltrán-Hernández