arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.05504cs.CRcs.MA
收藏

基于内存的LLM代理中的内存污染攻击与防御

Memory Poisoning Attack and Defense on Memory Based LLM-Agents

Balachandra Devarangadi Sunil, Isheeta Sinha, Piyush Maheshwari, Shantanu Todmal, Shreyan Mallik, Shuchi Mishra

AI总结:

本文研究了基于内存的LLM代理中的内存污染攻击与防御,通过实验发现预存合法记忆可显著降低攻击效果,并提出两种新的防御机制。

摘要:

配备了持久内存的大语言模型代理容易受到内存污染攻击,其中攻击者通过仅通过查询的交互注入恶意指令,从而破坏代理的长期记忆并影响未来的响应。近期的研究表明,在理想条件下,MINJA(内存注入攻击)可以达到超过95%的注入成功率和70%的攻击成功率。然而,这些攻击在现实部署中的鲁棒性以及有效的防御机制仍处于研究不足的状态。本文通过系统地对内存污染攻击和防御在电子健康记录(EHR)代理中的经验评估来填补这些空白。我们通过改变三个关键维度来研究攻击的鲁棒性:初始内存状态、指示提示的数量和检索参数。我们在使用MIMIC-III临床数据的GPT-4o-mini、Gemini-2.0-Flash和Llama-3.1-8B-Instruct模型上进行实验,发现现实条件下的预存合法记忆显著降低了攻击效果。我们然后提出了并评估了两种新的防御机制:(1)使用多个正交信号的复合信任评分的输入/输出调节,以及(2)使用基于时间衰减和基于模式的过滤的信任感知检索的内存消毒。我们的防御评估表明,有效的内存消毒需要仔细的信任阈值校准,以防止过于保守的拒绝(阻止所有条目)和不足的过滤(遗漏细微攻击),为未来的自适应防御机制建立了重要的基准。这些发现为在生产环境中安全地保护带有内存增强的LLM代理提供了关键见解。

英文摘要:

Large language model agents equipped with persistent memory are vulnerable to memory poisoning attacks, where adversaries inject malicious instructions through query only interactions that corrupt the agents long term memory and influence future responses. Recent work demonstrated that the MINJA (Memory Injection Attack) achieves over 95 % injection success rate and 70 % attack success rate under idealized conditions. However, the robustness of these attacks in realistic deployments and effective defensive mechanisms remain understudied. This work addresses these gaps through systematic empirical evaluation of memory poisoning attacks and defenses in Electronic Health Record (EHR) agents. We investigate attack robustness by varying three critical dimensions: initial memory state, number of indication prompts, and retrieval parameters. Our experiments on GPT-4o-mini, Gemini-2.0-Flash and Llama-3.1-8B-Instruct models using MIMIC-III clinical data reveal that realistic conditions with pre-existing legitimate memories dramatically reduce attack effectiveness. We then propose and evaluate two novel defense mechanisms: (1) Input/Output Moderation using composite trust scoring across multiple orthogonal signals, and (2) Memory Sanitization with trust-aware retrieval employing temporal decay and pattern-based filtering. Our defense evaluation reveals that effective memory sanitization requires careful trust threshold calibration to prevent both overly conservative rejection (blocking all entries) and insufficient filtering (missing subtle attacks), establishing important baselines for future adaptive defense mechanisms. These findings provide crucial insights for securing memory-augmented LLM agents in production environments.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑