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

Zhijie Zheng, Yu Li, Chen Qian, Yuqian Fu, Yanwei Fu +3 more
8/25/2026
cs.AIcs.CR

No official code found. Best implementation: zheng977/StepGuard (3 stars, last commit 2026-08-26).

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.

View on arXivView PDF

Code Implementations(1)

zheng977/StepGuardCommunity70%

[EMNLP 2026] StepGuard: Learning Step-Level Guardrails with Scalable Supervision and Safety-Utility Balancing

30Jul 23, 20261 months ago

Similar Papers

Cite this paper

@article{zheng2026stepguard,
  title  = {StepGuard: Learning Step-Level Guardrails with Scalable Supervision and Safety-Utility Balancing},
  author = {Zhijie Zheng and Yu Li and Chen Qian and Yuqian Fu and Yanwei Fu and Lu Sheng and Jing Shao and Dongrui Liu},
  year   = {2026},
  eprint = {2608.24777},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.24777v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.24777.svg)](https://codeofpaper.com/paper/2608.24777)

Discussion