arXiv:2610.29139cs.AIOct 2026

Manuscript Offprint

arXiv:2610.29139

Steering Black-Box Large Language Model Agents with Pitfall Anticipation World Model

Jiongxiao Wang, Han Ding, Youzhi Luo, Yawei Wang, Yun Zhou, Linbo Liu, Panpan Xu

Abstract

Frontier black-box Large Language Model (LLM) agents are proficient at long-horizon reasoning and precise action generation. However, when it comes to a specific agentic task, they have no internalized knowledge of how that particular environment unfolds. A world model offers a natural remedy, providing the agent with environment specific knowledge by foreseeing how the environment will respond to the action it is about to take. Prior world models for LLM agents mainly predict next observations at each step, which is costly and often uninformative because individual observations provide limited task-relevant guidance and not every step requires call for foresight. This raises a key question: what a world model should predict and when should it be invoked for agentic tasks? Our pilot study suggests that world model guidance is most useful when it anticipates pitfalls within a bounded multi-step future. Motivated by this, we introduce Pitfall Anticipation World Model (PAWM), which selectively intervenes when a potential pitfall arises and predicts the impending failure to steer the agent away from it. PAWM is trained in two stages: Supervised Fine-Tuning (SFT) on synthetic data labeled with agent pitfalls, followed by GRPO co-training with a black-box LLM to further optimize it in the target environment. PAWM improves Claude Sonnet 4.5 performance by 24.3% on ScienceWorld and 7.7% on WebArena-Lite, outperforming a range of baselines. These results demonstrate that PAWM provides an effective form of world model guidance for black-box LLM agents.

1 Introduction

Frontier LLMs such as GPT-5 and Claude are increasingly deployed in customized agentic applications (Yao et al., 2023), from enterprise workflow automation (Yao et al., 2024; Barres et al., 2025) to specialized domain assistants (Trivedi et al., 2024; Jimenez et al., 2024). Owing to large-scale training, these models already excel at the core competencies such as instruction following, general reasoning, task planning, long contexts processing, and producing precise, well-formatted actions via function calling or code. What they still lack is not general capability but task-specific reliability for agents. Since these models are black-box, such reliability cannot be instilled by fine-tuning their weights. This has inspired growing interest in steering black-box LLM agents (Li et al., 2024; Asawa et al., 2025; Lingam et al., 2026; Liu et al., 2026a), where an external module injects guidance that shapes the frozen model's behavior at inference time. However, prior steering methods mainly focus on assisting agent planning, such as decomposing the goal into subgoals or laying out high-level action sequences. Advising black-box LLM agents on it reinforces capabilities they already possess, rather than providing the environment knowledge they lack about how a specific agentic environment responds to their actions. We therefore propose to steer black-box LLM agents with world models (Ha and Schmidhuber, 2018; Li et al., 2026), which can supply this missing environment knowledge.

Rather than encoding what to do, a world model captures how the environment behaves, how states transit in response to actions, and how a task trajectory is likely to unfold. A black-box LLM, although capable in general, has never internalized such environment-specific dynamics for the agent task at hand. This makes the world model a natural approach for supplying black-box LLM agents with the grounding they lack. A growing body of work has begun to explore LLM-based world models for agentic tasks, using them to foresee future states and thereby guide action selection. Most of these works, however, employ the world model as a simulator of the environment that rolls out actions to the next observations to support candidates ranking or tree-based search (Zhao et al., 2023; Gu et al.,

∗^{*}Work was done during an internship at AWS AI.

Figure

Figure 1: Illustration for Pitfall Anticipation World Model in steering black-box LLM agents.

2024; Chae et al., 2025; Zheng et al., 2026; Guan et al., 2026). Whether using a world model as a direct source of additional environment knowledge in the agent loop helpful or not remains unclear. For instance, Qian et al. (2026) found that a generative world model provides no consistent benefit for agents, whether invoked adaptively or at every step, with performance sometimes even worse than when acting without a world model.

Therefore, how to effectively deliver a world model’s guidance remains an open problem. Two design decisions are central here, and prior work has left both implicit. First, what should the world model output? Environment knowledge can be surfaced at very different granularities, from the immediate consequence of the current step to a summary of the entire remaining trajectory, and it is not obvious which is most useful to a frozen agent. Second, when should the world model intervene? Guiding at every step supplies the most information but risks overwhelming or misdirecting an already-capable agent, whereas intervening too rarely risks staying silent at the steps that matter. Neither question has a settled answer, and together they define the design space for this work.

To answer these questions, we first conduct a systematic pilot study on the ScienceWorld (Wang et al., 2022) and WebArena-Lite (Zhou et al., 2024) benchmarks, in each case training a world model via SFT on collected agent trajectories to steer a Claude Sonnet 4.5 agent model. Along the world model output axis, we compare guidance of increasing horizon: the next observation alone, the segment up to the next subgoal, and the entire remaining trajectory. Our experiment results reveal that guidance bounded at the next subgoal works best, indicating that a world model should look several steps ahead yet stop at a meaningful boundary. Along the intervention axis, we start from the observation that most guidance leaves the agent's action unchanged, and ask what distinguishes the guidance that does change it. Both a lexical and an LLM-based semantic analysis show that pitfall-related generations dominate the guidance that changes the agent's action. To verify that anticipated pitfalls indeed make a good timing for intervention, we run a gating ablation that routes only pitfall-anticipating guidance to the agent, and find that it nearly matches guiding at every step in performance with far less cost. These studies point to two design principles: guidance is most useful when it forecasts a multi-step future bounded at a meaningful milestone, and its value concentrates at potential pitfalls.

Inspired by our pilot study, we propose Pitfall Anticipatory World Model (PAWM), a world model that steers a black-box LLM agent by anticipating pitfalls only when they are likely to arise. Unlike prior world models that simulate candidate actions or provide guidance at every step, PAWM stays silent while the agent is on a promising trajectory and intervenes only when it foresees an impending failure, at which point it predicts the pitfall ahead and issues a multi-step forward-looking guidance that steers the agent away from the action it is about to take. By stepping in only at these key moments, PAWM avoids unnecessary guidance and acts exactly where the agent would otherwise fail, making it both more efficient and effective.

We obtain PAWM in two stages. First, we perform SFT on a synthetic pitfall dataset in which a separate LLM annotates repeatedly sampled trajectories, contrasting a successful and a failed run of the same task to locate the key pitfall steps and describing the corresponding failure risks. This teaches PAWM both to foresee potential pitfalls and to articulate the guidance needed to avoid them. Furthermore, to optimize the anticipation ability for the agent's downstream task success, we apply GRPO (Shao et al., 2024) to co-train PAWM with the frozen black-box model, adapting its steering to the specific agent and environment. Integrating PAWM with a Claude Sonnet 4.5 agent yields success rates of 78.9% on ScienceWorld and 80.4% on WebArena-Lite, significantly outperforming the black-box Sonnet agent, which reaches only 54.6% and 72.7% respectively. In addition, compared with a range of baselines, including steering black-box LLM agents with pre-task guidance and world models under various settings, PAWM consistently performs best, demonstrating its effectiveness of steering agents with environment-specific pitfall knowledge.