SEAD:基于状态的工具使用智能体攻防视角
研究论文 · 2026/09/30
语言模型智能体日益使用工具对外部系统进行操作。先前动作可能改变文件、权限、数据库记录或其他状态,使后续看似常规的动作变得有害。然而,可见的交互可能无法揭示评估该动作所需的底层状态。我们在SEAD中将攻防形式化为部分可观测的状态控制,并从这一共享执行过程推导出设计需求。由于攻击者提供指令而目标选择具体动作,DART将有害目标分解为局部合理的步骤,并利用实际工具执行的反馈来引导轨迹搜索。防御者必须在执行前基于不完整的状态证据做出决定。因此,SAGE可以在允许或阻止每个动作之前,通过只读查询调查相关状态,包括在阻止后提出的动作。我们构建了一个环境可验证的数据集,整合了受控初始状态、可重放的工具环境和任务特定的可执行检查。在四个目标模型上,DART相比竞争基线将语义攻击成功率提高了18.8至35.9个百分点,在可执行验证下也有一致提升。在记录的轨迹上,SAGE在危害使能边界前拦截了92.73%的有害路径,同时保留了95.79%的良性轨迹。在在线攻防评估中,它将DART的可执行攻击成功率从48.0%降低到4.0%。SAGE在四种攻击方法下均保持有效,并能泛化到域外环境。我们的代码和数据可在https://github.com/EverywhereSafety/SEAD获取。
该研究针对工具使用智能体因状态变化导致的安全隐患,提出了统一的攻防框架和具体方法,实验证明能显著提升攻击成功率和防御效果,并提供了可复现的数据集和代码,对智能体安全领域具有重要参考价值。
Language-model agents increasingly use tools to act on external systems. Earlier actions can alter files, permissions, database records, or other state, making a later routine-looking action harmful. Yet the visible interaction may not reveal the underlying state needed to assess that action. We formulate attack and defense as partially observed state control in SEAD, deriving their design requirements from this shared execution process. Because attackers supply instructions while the target chooses concrete actions, DART decomposes harmful goals into locally plausible steps and uses feedback from actual tool execution to guide trajectory search. The defender must decide before execution with incomplete state evidence. SAGE can therefore investigate relevant state through read-only queries before allowing or blocking each action, including those proposed after a block. We construct an environment-verifiable dataset integrating controlled initial states, replayable tool environments, and task-specific executable checks. Across four target models, DART improves semantic attack success by 18.8--35.9 percentage points over the competing baseline, with consistent gains under executable verification. On recorded trajectories, SAGE preserves 95.79% of benign trajectories while intercepting 92.73% of harmful paths by the harm-enabling boundary. In online attack-defense evaluation, it reduces DART's executable attack success from 48.0% to 4.0%. SAGE remains effective across four attack methods and generalizes to out-of-domain environments. Our code and data is available at https://github.com/EverywhereSafety/SEAD.