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

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

arXiv:2608.24777 · 2026-08-31 공개 · arXiv · PDF

llm-agents security-risks tool-invocation supervised-learning agentdyn balance-grpo trajectory-audit step-level-guardrails

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.

한국어 요약

한 줄 요약

StepGuard는 실행 전 단계에서 도구 행동을 점검하는 스텝 레벨 가드 모델로, AgentDojo와 AgentDyn에서 77.3%의 공격 성공률 감소를 달성했다.

핵심 기여도

핵심 아이디어

기존 가드레일은 완료된 트래젝토리만 점검하는 데 초점을 맞추어 실행 전 단계의 행동을 모니터링하지 못하는 한계가 있었다. StepGuard는 실행 전 단계에서 도구 행동을 점검하고, 완료된 트래젝토리도 감사하는 스텝 레벨 가드 모델로, 실행 전 보호와 사후 진단을 동시에 수행한다. StepGen은 동일한 컨텍스트에서 단계별로 안전/위험 행동을 생성하여, 대규모 스텝 레벨 감독 데이터를 자동화한다. Balance-GRPO는 GRPO 알고리즘을 확장하여, 안전/위험 행동의 정확도 격차를 기반으로 학습 가중치를 동적으로 조정함으로써 과방어 및 미방어 문제를 완화한다.

기술적 접근법

주요 결과

의의 및 한계

StepGuard는 실행 전 단계에서 행동을 점검함으로써 기존 가드레일의 사후 점검 중심 한계를 극복하며, 실시간 보호와 사후 진단을 결합한 새로운 접근법을 제시한다. Balance-GRPO는 학습 과정에서 안전/유틸리티 균형을 조정함으로써 과방어 및 미방어 문제를 완화하는 데 기여한다. 그러나 AgentHarm 데이터셋에서는 상대적으로 낮은 성능을 보이며, 더 복잡한 위험 상황에 대한 일반화 능력이 제한적이라는 한계가 있다.

실용적 활용

StepGuard는 파일 수정, 정보 유출, 비인가 행동 등이 발생할 수 있는 LLM 기반 에이전트 시스템에 적용 가능하다. 특히, AgentDojo와 AgentDyn과 같은 에이전트 환경에서 실시간 보호와 사후 진단을 동시에 수행할 수 있어, 보안 감사 및 위험 관리에 유용하다.