cs.AIAug 25, 2026

StepGuard: Learning Step-Level Guardrails with Scalable Supervision and Safety-Utility Balancing

Authors: Zhijie Zheng, Yu Li, Chen Qian, Yuqian Fu, Yanwei Fu, Lu Sheng, Jing Shao, Dongrui Liu

Organizations: Shanghai Artificial Intelligence Laboratory · Beihang University · Fudan University · Renmin University of China · 

Abstract

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.

Figures & tables

Appendix figures & tables14 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. DreamGuard: Efficient Runtime Guardrail for LLM Agents via Risk-Aware World Model

    Aug 6, 2026Wenhao Lin, Chenyu Yu, Xingwei Lin +6LLM World ModelsLLM Guardrails

  2. From Risk Classification to Action Plan Remediation: A Guardrail Feedback Driven Framework for LLM Agents

    Jun 4, 2026Yuhao Sun, Jiacheng Zhang, Shaanan Cohney +3LLM GuardrailsLLM Agent Training

  3. StepSafe: Learning Timely Intervention with Context-Aware Safety Reasoning

    Oct 14, 2026Siyi Gu, Kunhan Gao, Chao Peter Yang +3AI Agent SafetyLLM Agent Safety