攻击大模型代理的结束判断,让其无限循环计算。
LoopTrap: Termination Poisoning Attacks on LLM Agents

- 通过恶意提示污染上下文,诱导代理误判任务未完成。
- 平均使计算步数增加3.57倍,最高达25倍。
- 自动构建攻击策略,适合安全测试和红队演练。
现代大模型代理通过迭代执行循环完成复杂任务,反复推理、行动并自我评估进度以决定任务是否结束。本文揭示,这种自主循环虽提升灵活性,却引入关键风险:攻击者可通过向代理上下文注入恶意提示,扭曲其终止判断,使其误认为任务仍未完成,导致无限计算。我们定义并系统分析该威胁为终止毒化(Termination Poisoning),设计了10种代表性攻击策略。通过对8个主流大模型代理与60个任务的实证研究发现,不同代理表现出独特的行为特征,决定攻击策略的有效性。这些可迁移模式可指导对未知代理和任务的高效攻击,实现规模化红队测试。基于此,我们提出LoopTrap自动化红队框架:先通过轻量探测构建目标代理在四个脆弱维度上的行为画像;再自适应合成陷阱,通过自评分机制选择最优注入策略;成功陷阱被抽象为可复用技能库,失败尝试则通过自我反思持续优化。大量实验表明,LoopTrap在8个主流代理上平均实现3.57倍步数放大,峰值达25倍。
原文摘要 · Abstract (English)
Modern LLM agents solve complex tasks by operating in iterative execution loops, where they repeatedly reason, act, and self-evaluate progress to determine when a task is complete. In this work, we show that while this self-directed loop facilitates autonomy, it also introduces a critical risk: by injecting malicious prompts into the agent's context, an adversary can distort the agent's termination judgment, making it believe the task remains incomplete and leading to unbounded computation.To understand this threat, we define and systematically characterize it as Termination Poisoning and design 10 representative attack strategies. Through a empirical study spanning 8 LLM agents and 60 tasks, we demonstrate that different LLM agents exhibit distinct behavioral signatures that determine which strategies succeed. These transferable patterns can serve as principled guidance for crafting effective attacks against previously unseen agents and tasks, enabling scalable red-teaming beyond manually designed templates. Building on these insights, we introduce LoopTrap, an automated red-teaming framework that synthesizes target-specific malicious prompts by exploiting agent behavioral tendencies. LoopTrap first constructs a behavioral profile of the target agent along four vulnerability dimensions via lightweight probing. It then performs adaptive trap synthesis, routing to the most effective strategy and selecting optimal injections via a self-scoring mechanism. Finally, successful traps are abstracted into a reusable skill library, while failed attempts are refined through self-reflection, ensuring continuous improvement. Extensive evaluation shows that LoopTrap achieves an average of 3.57$\times$ step amplification across 8 mainstream agents, with a peak of 25$\times$.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。