StepGuard:通过可扩展监督与安全-效用平衡学习步骤级护栏
研究论文 · 2026/08/31
基于LLM的智能体可通过工具调用与外部环境交互,但也带来文件修改、信息泄露等安全风险。现有防护措施通常评估完整轨迹,缺乏对步骤级动作的预执行监控。我们提出StepGuard,一种步骤级防护模型,可审计已完成轨迹并在工具执行前检查动作。为训练StepGuard,我们引入StepGen自动数据引擎,生成相同上下文但风险步骤动作不同的安全与不安全轨迹。为减少过度防御和防御不足,我们提出Balance-GRPO,根据观测准确率动态平衡安全与不安全动作的学习。实验表明,StepGuard在开放权重防护模型中平均准确率最高,性能可与GPT-5.4媲美。在AgentDojo和AgentDyn上,StepGuard将平均攻击成功率相对降低77.3%,而平均效用仅下降2.8个百分点。
该文针对LLM智能体安全防护的空白,提出步骤级防护模型,并设计自动数据生成和平衡学习算法,实验验证了显著降低攻击成功率且效用损失小,对智能体安全部署有重要价值。
LLM-based agents can interact with external environments through tool invocation, but this capability also introduces security risks such as file modification, information leakage, and unauthorized actions. Existing guardrails often evaluate completed trajectories, leaving pre-execution monitoring of step-level actions underexplored. We propose StepGuard, a step-level guard model that can audit completed agent trajectories and check tool actions before they are executed. To train StepGuard, we introduce StepGen, an automatic data engine that generates safe and unsafe trajectories with the same context but different actions at the risky step. To further reduce over-defense and under-defense, we propose Balance-GRPO, which dynamically balances learning between safe and unsafe actions based on their observed accuracy. Experiments show that StepGuard achieves the highest average accuracy among open-weight guard models, with performance comparable to GPT-5.4. When used to guard agents on AgentDojo and AgentDyn, StepGuard reduces mean attack success rate by 77.3% relative to the no-guard setting, while mean utility drops by only 2.8 percentage points.