arXiv:2610.02664cs.AIOct 2026

Manuscript Offprint

arXiv:2610.02664

A GHOST in Long-Horizon Agents: Governance Hazard from Overlooked Safety Constraints across Turns

XinPeng Shen, Lan Zhang, Yixiao Huang, Haoran Cheng, Jiewei Lai, Leilei Chen, Haoxiang Deng

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

Abstract

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.

Introduction

Long-horizon tool-using LLM agents can resume tasks from historical context without requiring users to restate detailed instructions. However, this capability introduces a severe safety challenge: a task may still be executed even when its earlier safety constraints no longer govern execution.

For this failure mode that may occur in daily use, however, existing research has neither paid sufficient attention to it nor offered effective solutions. Recent instruction-following methods have not specifically

Figure

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.

studied scenarios in which a safety constraint is separated from the current task by long interaction histories. They lack mechanisms for reliably locating the relevant safety constraint in context and applying it to later tasks. Consistent with this limitation, our experiments show that these methods offer little to no improvement in safety for the scenarios covered in this paper, unless these methods are oracle-based [Li et al., 2023, Ferraz et al., 2024, Hua et al., 2024, Zhang et al., 2025, Tavakoli et al., 2025, Robinette et al., 2026]. Meanwhile, existing agent-safety benchmarks mainly study attack-driven failures, such as prompt injection and harmful requests [Ruan et al., 2024, Debenedetti et al., 2024, Andriushchenko et al., 2025], rather than unsafe execution during benign interactions.

Maintaining the governance capacity of safety constraints from the interaction history is especially important because their violation may cause severe and irreversible harm and undermine user trust. Such harms are not merely hypothetical: related execution-safety

*Corresponding author: zhanglan@ustc.edu.cn failures have already occurred in practice, including unauthorized email deletion, destructive database operations, and unintended file removal [Edwards, 2025, Sharwood, 2025, Willison, 2026, Bort, 2026].

To characterize the aforementioned problem—namely, the failure of safety governance that arises when long interaction histories separate still-required safety constraints from the current task—this paper provides a systematic empirical and theoretical investigation of this issue, which we term Governance Hazard from Overlooked Safety Constraints across Turns (GHOST). To empirically assess the generality of GHOST across models and task domains, we introduce SCARBench: Safety-Constraint Availability at Reactivation Benchmark, an executable, environment-grounded benchmark comprising 412 instances in 103 scenarios. Across benchmark cases with benign users, non-adversarial intervening dialogue, and no malicious attack, GPT-5.5 exhibits an Unsafe Completion rate of 12.4% on SCARBench, with 11.5% of all instances satisfying our strict definition of GHOST.

Building on the empirical evidence from SCARBench, we further strengthen the case for GHOST in theory. We model safety constraints by mapping them onto hazard regions, where a violation of any constraint corresponds precisely to the agent's action trajectory entering the corresponding hazard region. We show that if conditional entry hazards have non-summable lower bounds, eventual entry into a hazard region occurs almost surely.

Leveraging our theoretical result, we further propose STAR-Guard: Safety-Constraint Tracking, Activation, and Runtime-Audit Guard, a two-layer defense that combines long-horizon safety constraint maintenance and semantic safety restoration with deterministic pre-execution audit. The first layer leverages language models to extract safety constraints governing task execution, preserves them across long interaction histories, and restores those that remain semantically related when a task arrives later. By restoring the relevant safety constraint to the latest context, this layer reduces the likelihood that the target agent proposes an unsafe action. Motivated by the almost-sure reachability result, we introduce a second layer that interrupts residual hazard accumulation by auditing proposed actions before they reach the environment. This layer interposes a deterministic rule auditor between the agent and the environment to address the residual hazard leakage caused by the stochastic generation of LLMs. Across five independent repetitions per model-condition pair, STAR-Guard decreases both Unsafe Completion rate and strict GHOST rate to zero on GPT-5.5 in our evaluation.

Our contributions are as follows:

• We theoretically and empirically identify and formalize Governance Hazard from Overlooked Safety Constraints across Turns (GHOST), showing that non-summable lower bounds on residual conditional hazards imply almost-sure hazard-region entry. In our benign, attack-free evaluation, GHOST occurs in 11.5% of cases on GPT-5.5.

• We propose STAR-Guard, a two-layer defense that couples probabilistic risk reduction with deterministic pre-execution audit, reducing GHOST rate to zero on GPT-5.5.

• We introduce SCARBench, an executable, environment-grounded benchmark for evaluating historical safety-constraint recovery during long-context tasks. It contains 103 unique base scenarios across six tool-use domains, yielding 412 matched condition instances.