仅一次交互即可操控大模型记忆系统输出,威胁隐私与安全。
InjecMEM: Memory Injection Attack on LLM Agent Memory Systems

- 用锚点+对抗指令实现单次注入,无需访问记忆存储
- 在多种模型和记忆系统上成功引导目标话题生成
- 适合研究模型安全、内存机制的学者与工程师
记忆正成为部署中大语言模型代理的标配子系统,以实现持久化个性化和连续性。这自然引发一个问题:记忆系统是否会引入新漏洞?为此我们提出 InjecMEM,一种新型内存注入攻击范式,仅需一次交互(无需读写访问内存存储)即可将后续相关查询的输出导向预设内容。基于记忆系统的检索-生成机制,我们设计了与检索器无关的锚点和对抗性指令:锚点包含高召回的主题线索,确保下游检索始终关联目标主题;指令是一段短序列,经梯度优化,能在不确定融合上下文、变量插入位置和长提示条件下保持有效性,一旦被检索即可靠引导输出。我们通过坐标搜索学习指令,对合成提示模板和插入位置进行平均,并扩展至多骨干模型联合优化以研究迁移性。在多个记忆系统和骨干模型上评估,InjecMEM 实现了可靠的条件化检索与目标生成,对记忆漂移具有鲁棒性,且不影响非目标查询。结果凸显强化记忆系统防护的必要性,并提供可复现的研究框架。
原文摘要 · Abstract (English)
Memory is becoming a default subsystem in deployed LLM agents to provide persistent personalization and continuity. This naturally prompts a question: will memory system introduce new vulnerabilities into agents? Thus we propose InjecMEM, a novel memory injection attack paradigm that requires only a single interaction (no read/edit access to memory store) to steer later responses of related queries toward a pre-specified output. Guided by the retrieval-then-generate mechanism of memory systems, we craft the injection with a retriever-agnostic anchor and an adversarial command. The anchor contains high-recall topical cues so that downstream retrieval consistently associates the record with the target topic. The command is a short sequence optimized to remain effective under uncertain fused contexts, variable placements, and long prompts so that it reliably steers outputs once retrieved. We learn the command via gradient-based coordinate search, averaging over synthetic prompt templates and insertion positions, and extend it to joint optimization across backbones to study transfer. Evaluated across multiple memory systems and backbone models, InjecMEM achieves reliable topic-conditioned retrieval and targeted generation, remains effective under memory drift, and leaves non-target queries unaffected. Our results underscore the need to harden memory systems and provide a reproducible framework for studying agent memory.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。