MemHarmBench: Evaluating Cross-Session Prompt Injection in Memory-Persistent AI Agents
Zhihua Wang, Yunhao Feng, Yifeng Gao, Rui Pan, Baiheng Zhao, Zixing Chen, Xingjun Ma
Abstract
AI agents often rely on persistent memory to retain user preferences and operational rules across sessions. However, this capability introduces a new safety risk: malicious instructions from messages, documents, or Web content can be retained in memory and influence future tasks even after the original attack content is removed. Existing attack success metrics, however, fail to capture who is affected and how attacks translate into downstream harm during otherwise normal task execution. We introduce MemHarmBench, a victim-centric benchmark for evaluating cross-session prompt injection in memory-persistent AI agents. MemHarmBench considers three categories of potential victims: users, workspace/project owners, and external stakeholders. Our evaluation first exposes an agent to malicious instructions and tests whether they are retained in memory. We then remove the attack content and initiate a new session with a legitimate task while preserving the agent's memory. We jointly evaluate whether the agent follows the attacker's intent, completes the legitimate task, and exhibits observable execution anomalies. Across multiple agent systems, we find that cross-session attacks can remain behaviorally stealthy: agents often complete tasks normally and exhibit no detectable anomalies while still making critical decisions aligned with the attacker's intent. By connecting malicious memory retention to downstream decisions and affected parties, MemHarmBench provides a systematic framework for exposing safety risks that conventional attack- and task-success metrics may overlook. We publicly release MemHarmBench at https://github.com/Kirito14IT/MemHarmBench.
Create a lesson
Related papers
Delivered, Not Used: Evaluating Agent Memory at Its Point of Use
Changran Xu, Zeju Li, Qiang Xu
Route-Guided CBF-QP Repair for Safe Vision-Language-Action Models
Chan Park, Sunwoo Hong, Kirak Kim et al.
Just-in-Time Skill Retrieval via Long-Horizon State Tracking
Xin Lin, Ziheng Wang, Zerui Chen et al.
SPAR: Experience-Driven Strategy Evolution in Multi-Session B2B Sales
Hangming Zhang, Yao Zhao, Haotian Kuang et al.
Xiaomi Auto World Model 2.0: Causal World Models for Real-World Driving and Embodied Intelligence
Zhenxin Zhu, Zhijian Huang, Cheng Chi et al.
Local or Escalate? Post-Training Expert Routing for Real-Time Duplex Speech Models
Ruoyu He, Jisen Li, Anthony Ji et al.