Long-horizon agents are now playing an increasingly significant role in assisting humans with complex problem-solving. However, it is exactly their extended interaction history that introduces an underexplored execution-safety concern. Under benign interaction conditions, an agent may execute an action that violates a safety constraint specified many turns earlier. We term this failure mode Governance Hazard from Overlooked Safety Constraints across Turns (GHOST), which may cause irreversible damage. Our experiments reveal that GHOST events are not isolated cases: this failure mode, occurring precisely under benign interaction conditions, yields an occurrence rate of 11.5% on GPT-5.5. Furthermore, we theoretically show that if the residual conditional violation hazard along each safe prefix is bounded below by a non-summable sequence, the execution enters the hazard region almost surely. Leveraging this theoretical insight, we further propose STAR-Guard, a two-layer defense coupling historical semantic safety constraint restoration with pre-execution audit. STAR-Guard restores applicable safety constraints to reduce unsafe proposals, while its deterministic audit layer prevents residual violations from reaching the environment. Consistent with this two-layer design, we observe no GHOST events in our experiments under the GPT-5.5 setup.
Figures & tables
Figure 1: Illustration of GHOST. Initially, the user asks the agent to clean the inbox under a safety constraint requiring explicit approval before any email deletion, and the agent executes the task safely. After multiple benign interactions, the user resumes the inbox-cleaning task without restating the approval requirement and the agent starts to delete emails without requesting approval.
Figure 2: Overview of STAR-Guard. The restoration layer extracts and stores historical safety constraints, retrieves the constraints applicable to a resumed task, and semantically restores them to the current context. The audit layer checks the agent’s proposed environment-facing actions before execution and prevents noncompliant actions from reaching the environment.
SE
SI
LE
LI
GHOST
Target
SC
UC
SC
UC
SC
UC
SC
UC
[95% CI]
API-served models
GPT-5.5
89.3
1.0
90.3
1.0
88.7
1.0
76.3
12.4
11.5 [6.4, 17.1]
DeepSeek-V4-Pro
80.6
1.9
79.6
1.0
85.6
1.2
79.6
9.7
8.7 [4.9, 13.0]
GLM-5.2
84.9
0.0
87.2
0.0
84.3
0.2
73.6
8.9
8.9 [4.5, 14.0]
Kimi-K2.6
80.6
0.0
82.5
0.0
75.7
2.9
68.9
9.7
6.8 [3.3, 11.4]
Table 1: Strict GHOST in our evaluation. All values are percentages averaged over five independent repetitions of the same 103 canonical cases. Strict GHOST is computed over 515 matched case–repetition pairs per model, with case-clustered 95% confidence intervals.
Figure 3: The difference-in-differences metric (SCLI−SCLE)−(SCSI−SCSE) . The vertical axis is measured in percentage points.
Model / Method
SC
UC
GHOST
GPT-5.5
76.3→94.0
12.4→0.0
11.5→0.0
DeepSeek-V4-Pro
79.6→88.5
9.7→0.2
8.7→0.2
GLM-5.2
73.6→84.9
8.9→0.0
8.9→0.0
Kimi-K2.6
68.9→85.4
9.7→0.0
6.8→0.0
Qwen-3.6
76.7→86.6
9.5→1.2
9.1→1.2
Qwen3.5-4B
47.0→81.2
31.1→1.9
27.8→1.9
Table 2: STAR-Guard effectiveness and component ablations. Arrows denote No Defense → Full STAR-Guard. Changes across arrows are measured in percentage points (pp). Model rows use five independent repetitions.
Method
SC ↑
UC ↓
GHOST ↓
No Defense
47.0 ± 2.6
31.1 ± 1.0
27.8 ± 1.5
Prompt Reminder
50.5 ± 6.2
28.0 ± 4.3
23.3 ± 4.1
BM25 Top-3 (2009)
57.5 ± 5.9
16.5 ± 2.1
14.0 ± 2.6
DeCRIM (2024)
44.3 ± 3.2
31.8 ± 3.3
25.2 ± 3.3
TrustAgent † (2024)
54.2 ± 3.8
5.2 ± 1.8
4.7 ± 2.0
DVR † (2025)
75.1 ± 3.0
0.4 ± 0.5
0.4 ± 0.5
Table 3: Comparison on Qwen3.5-4B under the Long Implicit condition of SCARBench. Results are percentages reported as mean ± sample standard deviation over five independent runs. DVR † and TrustAgent † assume that the applicable constraint is already known.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Property
Value
Canonical executable cases
103
Matched conditions
4
Instances per model
412
Unique benign long-history streams
103
Long-history condition instances
206
Independent repetitions
5
Appendix
Table 4: SCARBench confirmatory-suite profile. Each of the 103 canonical cases has one unique benign long-history stream, which is reused unchanged in its paired LE and LI instances. Token and turn counts describe one such stream, not the sum across turns or conditions.
“Please resume the earlier task and delete the file temp/experiment_data.csv , but first create a backup of it.”
Appendix
Table 5: Representative SCARBench case. All requests, slots, tool arguments, environment objects, and evaluator targets bind to the same concrete path.
Target
SC
UC
SN
UA
EF
GPT-5.5
76.3
12.4
10.9
0.0
0.4
DeepSeek-V4-Pro
79.6
9.7
10.7
0.0
0.0
GLM-5.2
73.6
8.9
16.5
0.0
1.0
Kimi-K2.6
68.9
9.7
16.5
0.0
4.9
Qwen-3.6
76.7
9.5
11.5
0.0
2.3
Qwen3.5-4B
47.0
31.1
8.3
0.0
13.6
Appendix
Table 6: Long Implicit full-denominator outcomes (%). Entries are means over five repetitions of 103 cases. The very high EF rate for Llama-3.1-8B indicates substantial task-execution incapability in addition to unsafe completion.
Method
Adaptation used in SCARBench
Privileged information
Prompt Reminder
Adds one general instruction to recover and follow still-valid historical requirements before tool use.
None.
BM25 Top-3
Ranks raw history turns against the resumed request and appends the top three positive-score turns. Uses k1=1.2 and b=0.75 .
None.
DeCRIM
Generates an initial tool proposal, decomposes the complete conversation into requirements, critiques the proposal, and refines it based on the critique.
None; the auxiliary model sees raw history.
TrustAgent
Renders the benchmark safety slot as an Agent Constitution, then applies pre-planning regulation prompting, inspection, and refinement.
Ground-truth applicable constraint.
DVR
Divides the instruction into atomic constraints, checks the proposal with the benchmark executable verifier, and refines from exact verifier feedback.
Ground-truth executable verifier.
LIGHT Three-Memory
Constructs an adapted episodic memory and persistent scratchpad and retains the last 12 historical messages as working memory.
None.
Appendix
Table 7: Baseline configurations. TrustAgent and DVR are oracle-information comparators; their access is intentionally stronger than that of STAR-Guard.
Agent safety is moving from content moderation toward preventing operational failures before tool-using agents act. We propose Janus, a foresight-oriented framework for long-horizon agent safety that trains guards to anticipate delayed risks from partial trajectories. Janus synthesizes diverse agent trajectories via multi-agent simulation and learns a shared policy with two coupled tasks: an anticipation task that forecasts safety-relevant futures and an adjudication task that decides safety from both the observed prefix and anticipated future. The two tasks are jointly optimized with CoAA-RL, which rewards forecasts by their utility for downstream safety judgment. The resulting guard model, Vanguard, blocks unsafe actions before execution. Across four agent-safety benchmarks, Vanguard improves average protection by 15.9 percentage points over baseline guards while increasing benign task completion by 5.1 percentage points.
Yuan Xiong, Linji Hao, Shizhu He +3
The Key Laboratory of Cognition and Decision Intelligence for Complex Systems, Institute of Automation, Chinese Academy of Sciences, Beijing, China · School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing, China · Peking University, Beijing, China +2
Computer-use agents increasingly interact with browsers, terminals, file systems, and external services, introducing safety risks that emerge through runtime behavior rather than generated content alone. Existing guard models target static prompts and responses and are poorly suited to agent execution; existing executable safety platforms produce evaluation verdicts rather than the normalized supervision a guard model needs to learn across heterogeneous agent frameworks. We introduce HazardAuditor, an execution-grounded framework that closes both gaps. Its infrastructure runs heterogeneous agents (Claude Code, Codex, Hermes, and OpenClaw) in controlled environments and normalizes their interactions into a canonical event representation for cross-framework supervision. We further observe that token-level post-training objectives create a structural mismatch for generative guards, causing longer rationales to dominate gradient updates. Guard Policy Optimization (GuardPO) addresses this by converting deterministic safety outcomes into sequence-level advantages and normalizing rationale and verdict regions, making the safety decision the effective unit of optimization. Across multiple benchmarks and heterogeneous computer-use systems, HazardAuditor improves accuracy by up to 16.5 percentage points over the strongest prior guard. Code, models, and evaluation artifacts will be available at https://yunhao-feng.github.io/HazardAuditor/.
Yunhao Feng, Ruixiao Lin, Ming Wen +5
Ant Group · Hunan Institute of Advanced Technology · Zhejiang University +3
As large language model (LLM) agents increasingly invoke external tools and interact with real-world systems, unsafe actions may cause irreversible consequences on external states, user data, and downstream services. Recent runtime guardrails mitigate such risks by checking proposed actions before execution, but many remain reactive: they primarily assess the apparent safety of the current action, lacking an explicit model of how risk evolves across the trajectory. This limitation creates a critical blind spot for long-horizon risks, where individually benign-looking actions can gradually drift the agent toward hazardous states. In response, we propose DreamGuard, a proactive guardrail for LLM agents built around a risk-aware world model. The world model maintains a compact recurrent latent state over the trajectory and predicts future latent states from which DreamGuard derives immediate-hazard and prefix-risk evidence. It then fuses these multi-horizon signals into intervention decisions before execution. Experiments across four benchmarks and an online guardrail evaluation show that DreamGuard outperforms generic, reactive, and proactive guardrail baselines, achieves the best safety-utility trade-off among evaluated guardrails, and maintains an average end-to-end latency of 25 ms per call.
Wenhao Lin, Chenyu Yu, Xingwei Lin +6
Zhejiang University · Nanjing University of Posts and Telecommunications · Sun Yat-sen University