arXiv:2610.20960cs.AIOct 2026

Manuscript Offprint

arXiv:2610.20960

StepSafe: Learning Timely Intervention with Context-Aware Safety Reasoning

Siyi Gu, Kunhan Gao, Chao Peter Yang, Sukanta Ganguly, Rex Ying, Arman Cohan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Safety in agentic systems is inherently sequential: whether an action is safe depends on prior actions, tool outputs, information disclosures, and interactions among agents. Recent work has shifted agent safety guardrails from post-hoc trajectory-level assessment toward step-level action diagnosis and proactive risk prediction, yet existing training objectives provide limited supervision for how step evidence accumulates over time and when it becomes sufficient to justify intervention. We propose Adaptive Stage-Aligned Policy Optimization (ASPO): a training framework for step-level timely intervention. Pre-fix level stage alignment allows crediting each decision at its own step: it compares each response with the other responses sampled at the same prefix and rewards the action that fits the stage, continuing before the risk is visible, asking while clarification can still avert harm, and stopping before harm is irreversible. Adaptive feedback self-distillation further credits the reasoning behind each decision, with the model itself as a teacher that sees the step annotations on intervention steps and rules mined from its own false alarms on safe steps. Its training data carry a violation taxonomy and an intervention window at every step and are extended through self-evolving multi-agent red-teaming. Finally we present STEPSAFE, a step-level reasoning guardrail with timely intervention, that achieves the state-of-the-art performance among open-source guardrails across five agent-safety benchmarks on safety-utility pareto curve with Youden's J of 53.0 (4B) against 46.2. Code is available at https://github.com/carriegu0818/StepSafe.

1 INTRODUCTION

Large language model agents now carry out long, multi-step tasks, calling tools (Yao et al., 2023), reading and moving data, and coordinating with other agents (Wu et al., 2023). Their safety therefore extends beyond the text they generate: every tool call, data transfer, or delegation can cause harm, such as releasing personal records to an external party (Zhang et al., 2024). A safety monitor for such agentic system therefore needs to monitor the task step by step and decide, before each proposed action executes, whether the action is safe to proceed (Mou et al., 2026), or intervene before the harm is realized (see Figure 1).

Agent safety monitors have progressed from judging completed trajectories to judging each action before it executes, and from training-free judges to post-training with reinforcement learning. Trajectory-level auditors retrieve reasoning demonstrations or adapt their checks from experience (Luo et al., 2025a,b), or are fine-tuned to diagnose the risk source,

Write report

Sharing personal details requires approval.

Figure

Read & summarize

Authorized internal use

Continue

Propose case details

Separate approval?

s · signal

ASK

If earlier intervention is missed

Package case details

Approval missing

b · boundary

STOP

Send report.pdf

Approved recipient

h · last chance

STOP

Delivered: too late to prevent

Too early → task blocked

Too late → data disclosed

Figure 1: An example of realized harm to agentic system without timely intervention.

†^{\dagger}Equal advising.

failure mode, and harm (Liu et al., 2026b). Step-level monitors

judge each proposed action before it executes, by predicting its consequences (Chen et al., 2026), by estimating risk over trajectory prefixes (Li et al., 2026a), or, as in Safiron, TS-Guard, and Step-Guard, by reinforcement learning on verdict and risk rewards (Huang et al., 2026; Mou et al., 2026; Zheng et al., 2026). These monitors learn whether an action is unsafe, but not when to act on it: their labels say which trajectory or step is unsafe, not where the risk first becomes visible or the last step at which intervening still prevents harm (Figure 1).

Training such a step-level monitor that intervenes at the right time before the harm becomes irreversible raises three challenges: Challenge 1: Reasoning about when and why to intervene. Existing agent-safety datasets label outcomes only: a binary safe/unsafe label at trajectory level, with few providing risk taxonomy Liu et al. (2026b). In complex agentic tasks, violations take many forms, from indirect prompt injections hidden in files to agent's mis-communications that look harmless on their own, and their risk may accumulate over steps which requires the monitor to look back at prior actions. An outcome label says neither which step warrants intervention nor which earlier evidence justifies it, so learning when and why to intervene requires labels at the step level. Challenge 2: Intervening in time. Training a monitor to decide at every step requires assigning reward to individual decisions and specifying when intervention becomes warranted; a single reward for the whole trajectory does not distinguish these decisions. A trajectory-level reward penalizes every decision for a later miss, including a correct CONTINUE before any risk appears, and cannot express that the appropriate action changes as harm approaches. A step-level reward avoids the first problem, but the routine safe steps outnumber intervention steps, wrongly dominating its update by these trivial decisions. Challenge 3: Learning when not to intervene. Building a safety taxonomy explains why to stop, but safe steps have nothing to annotate, so nothing teaches the monitor when it is safe to proceed. In Figure 1, flagging the personal data early at steps 1–2 would wrongly block the authorized report.

To address these challenges, we propose Adaptive Stage-Aligned Policy Optimization (ASPO) to train STEPSAFE, a step-level reasoning guardrail (Figure 2). ASPO provides two training signals that an outcome reward cannot offer. Stage-aligned policy optimization (SAPO) addresses Challenge 2 by crediting each decision at its own step: it compares each response only with the other responses sampled at the same prefix, scores it with a time-aware intervention schedule, and gives each decision class a fixed share of the update. Adaptive feedback self-distillation (AFSD) credits the reasoning behind each decision (Challenges 1 and 3): the monitor, acting as its own teacher, sees the step annotations on intervention steps and, on safe steps, rules mined from its own false alarms, which supply the explanations that safe steps lack. Both components read step-level annotations that we build from existing corpora and extend through red-teaming (Section 2.2).

Our contributions are:

• We present STEPSAFE, an open-sourced guardrail that achieves state-of-the-art safety–utility pareto curve over five agent-safety benchmarks with a Qwen3-4B backbone.

• We construct a rich annotation dataset with a safety taxonomy and intervention windows via multi-agent red-teaming, enabling dense supervision signal over diverse violation types.

• We propose ASPO with two supervision signals: 1) SAPO credits each decision against alternatives at the same prefix, according to when intervention is warranted and scores it with a time-aware intervention schedule, 2) AFSD further guides the monitor’s reasoning with a teacher that sees the annotations on intervention steps and, on benign steps, a rubric mined from the monitor’s own false alarms.