StepGuard is a guard model designed to improve the safety of LLM-based agents by auditing their actions at the step level. It monitors agent behavior before tools are executed and evaluates completed trajectories to prevent risks such as unauthorized file modifications, information leakage, and harmful tool usage.
Addressing the Safety-Utility Gap
A primary challenge in deploying agent guardrails is the "defense bias," where models either block too many benign actions (over-defense) or fail to catch enough unsafe ones (under-defense). Existing methods often struggle to balance these outcomes. StepGuard addresses this by using a training approach that dynamically adjusts to the accuracy gap between safe and unsafe actions, ensuring that the guard remains effective without unnecessarily hindering the agent's ability to complete tasks.
Data Generation with StepGen
To overcome the scarcity of high-quality, step-level safety data, the researchers developed StepGen, an automatic data engine. StepGen creates "prefix-aligned" trajectories, meaning it generates both safe and unsafe versions of a task that share the same starting context. By branching from a common point, the model learns to distinguish between safe and unsafe actions within the same scenario. The engine also generates benign trajectories that use similar tools to ensure the guard does not mistakenly flag a tool as unsafe simply because it is being used.
Training with Balance-GRPO
StepGuard is trained in two stages. First, it undergoes supervised fine-tuning on data generated by StepGen. Second, it uses a method called Balance-GRPO, which extends standard reinforcement learning techniques to reduce defense bias. During training, Balance-GRPO monitors the accuracy of the model on both safe and unsafe examples. If the model performs worse on one class, the training process automatically increases the weight of those examples, forcing the model to improve its performance on the weaker category.
Performance and Results
Experiments show that StepGuard achieves the highest average accuracy among open-weight guard models, with performance comparable to the closed-source GPT-5.4. When deployed in agent environments like AgentDojo and AgentDyn, StepGuard reduced the mean attack success rate by 77.3% compared to using no guard at all. Notably, this safety improvement came with a minimal impact on task utility, which dropped by only 2.8 percentage points. Ablation studies confirmed that the Balance-GRPO method was effective in reducing the accuracy gap between safe and unsafe classifications while maintaining high performance.
Comments (0)
to join the discussion
No comments yet
Be the first to share your thoughts!