arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.09241cs.AI
收藏

计算机智能体中的上下文防御:一项实证研究

In-Context Defense in Computer Agents: An Empirical Study

Show Lab, National University of Singapore(新加坡国立大学Show Lab)

Pei Yang, Hai Ci, Mike Zheng Shou

AI总结:

本文首次系统研究计算机智能体的上下文欺骗攻击防御问题,提出利用上下文学习和思维链推理的上下文防御方法,通过少量示例引导智能体先防御推理再行动规划,显著降低了多种攻击的成功率。

摘要:

由视觉语言模型(VLMs)驱动的计算机智能体显著推进了人机交互,使用户能够通过自然语言指令执行复杂任务。然而,这些智能体容易受到上下文欺骗攻击,这是一种新兴威胁,攻击者将误导性内容嵌入智能体的操作环境中,例如包含欺骗性指令的弹窗。现有防御措施(如指示智能体忽略欺骗性元素)已被证明在很大程度上无效。作为首个关于保护计算机智能体的系统性研究,我们引入了\ extbf{上下文防御},利用上下文学习和思维链(CoT)推理来对抗此类攻击。我们的方法通过向智能体的上下文中加入一小组精心筛选的示例来增强其能力,这些示例同时包含恶意环境和相应的防御性响应。这些示例引导智能体在行动规划之前先进行显式的防御性推理,从而降低其对欺骗性攻击的易感性。实验证明了该方法的有效性:在弹窗攻击上将攻击成功率降低了91.2%,在环境注入攻击上平均降低了74.6%,同时对干扰性广告实现了100%的成功防御。我们的研究结果强调:(1)防御性推理必须先于行动规划才能获得最优性能;(2)极少量的示例(少于三个)就足以诱导智能体的防御行为。

英文摘要:

Computer agents powered by vision-language models (VLMs) have significantly advanced human-computer interaction, enabling users to perform complex tasks through natural language instructions. However, these agents are vulnerable to context deception attacks, an emerging threat where adversaries embed misleading content into the agent's operational environment, such as a pop-up window containing deceptive instructions. Existing defenses, such as instructing agents to ignore deceptive elements, have proven largely ineffective. As the first systematic study on protecting computer agents, we introduce textbf{in-context defense}, leveraging in-context learning and chain-of-thought (CoT) reasoning to counter such attacks. Our approach involves augmenting the agent's context with a small set of carefully curated exemplars containing both malicious environments and corresponding defensive responses. These exemplars guide the agent to first perform explicit defensive reasoning before action planning, reducing susceptibility to deceptive attacks. Experiments demonstrate the effectiveness of our method, reducing attack success rates by 91.2% on pop-up window attacks, 74.6% on average on environment injection attacks, while achieving 100% successful defenses against distracting advertisements. Our findings highlight that (1) defensive reasoning must precede action planning for optimal performance, and (2) a minimal number of exemplars (fewer than three) is sufficient to induce an agent's defensive behavior.

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

↑