Web Agents Should Adopt the Plan-Then-Execute Paradigm
Julien Piet, Annabella Chow, Yiwei Hou, Muxi Lyu, Sylvie Venuto, Jinhao Zhu, Raluca Ada Popa, David Wagner · 2026
Read Web Agents Should Adopt the Plan-Then-Execute Paradigm by Julien Piet, Annabella Chow, Yiwei Hou, Muxi Lyu, Sylvie Venuto, Jinhao Zhu, Raluca Ada Popa, David Wagner (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-14290.txt.
Introduction
Piet and seven co-authors argue plan-then-execute, not ReAct, should be the default for web agents. Web content mixes inputs from many parties. Under ReAct, all such content reaches the model at decision time, opening a path for prompt injections to steer control flow. Plan-then-execute redraws this line: untrusted data may sway values or branches inside a predefined graph, but cannot redefine the user task. WebArena analysis finds all tasks compatible with plan-then-execute, while 80 percent need only a purely programmatic plan.
Catalog record
| CREATOR | Julien Piet, Annabella Chow, Yiwei Hou, Muxi Lyu, Sylvie Venuto, Jinhao Zhu, Raluca Ada Popa, David Wagner |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 46281 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.14290
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Web Agents Should Adopt the Plan-Then-Execute Paradigm Julien Piet, Annabella Chow, Yiwei Hou, Muxi Lyu, Sylvie Venuto, Jinhao Zhu, Raluca Ada Popa, David Wagner Abstract ReAct has become the default architecture across LLM agents, and many existing web agents follow this paradigm. We argue that it is the wrong default for web agents. Instead, web agents should default to plan-then-execute: commit to a task-specific program before observing runtime web content, then execute it. The reason is that web content mixes inputs from many parties. An e-commerce product page may combine a seller’s listing, customer reviews, sponsored advertisements, and platform-generated recommendations. Under ReAct, all of this content flows into the model when deciding on the next action, creating a direct path for prompt injections to steer the agent’s control flow. Plan-then-execute changes this boundary: untrusted data may influence values or branches inside a predefined execution graph, but it cannot redefine the user task or cause the model to synthesize new actions at runtime. We analyze WebArena, a popular web agent benchmark, and find that all tasks are compatible with plan-then-execute, while 81.28% can be completed with a purely programmatic plan, without any runtime LLM subroutine. We identify the main barrier to adopting plan-then-execute on the web: For it to work well, tools must map cleanly to semantic actions, with effects known before execution, so agents have enough information to plan. The web does not naturally expose that interface. Browser tools such as click, type, and scroll have page-dependent meanings. Planning at this layer is near-sighted: the agent can only see actions on the current page, and later actions appear only after it acts. Closing this gap requires typed interfaces that turn website interactions from clicks and keystrokes to task-level operations. This is an infrastructure problem, not a modeling problem. Web tasks do not need reactivity by default; they need typed, complete, auditable website APIs. We outline a research agenda for building those APIs, planners, and benchmarks needed to make plan-then-execute practical for web agents. 1 Introduction Figure 1: ReAct exposes action selection to untrusted content, creating a direct path for prompt injections to steer the agent’s control flow. Plan-then-execute expresses tasks as programs over website SDKs, optionally using LLM subroutines to process data, isolating planning from content. Agents are autonomous systems that use large language models to translate user intent into executable actions that transform the environment toward a desired state. Many agents follow a reasoning-and-acting (ReAct) loop react : they observe the environment, query a language model for the next action, execute that action, and repeat. Modern web agents commonly instantiate this paradigm by observing the current webpage and selecting browser actions online. This design is attractive because it requires little site-specific engineering, works with existing websites, and has become a common paradigm for browsing agents ye2026agentfold ; xie2024openagents . Despite this utility and low engineering overhead, applying ReAct to web agents is dangerous because web content is, by nature, a mixture of inputs from many parties. A single page may contain site-provided interface elements, user comments, product reviews, forum posts, ads, embedded widgets, generated recommendations, hidden DOM nodes, accessibility metadata, and rendered images. As a result, untrusted content is pervasive in the agent’s ordinary observation stream. This differs from many other tool-calling settings, where untrusted data often enters through a smaller number of explicit channels: on the web, an attacker can often publish malicious content where agents are likely to encounter it, without compromising the website or the user debenedetti2024agentdojo ; zhan2024injecagent ; wang2025webinject . At the same time, many web tasks require reading precisely this kind of untrusted content. An agent comparing reviews, summarizing an issue, or selecting a product cannot simply ignore user-supplied text webarena ; deng2023mind2web . The mixed nature of web pages therefore makes it hard to draw a secure boundary around what the model may read without sacrificing utility chen2024struq ; debenedetti2025camel ; beurer2025design-patterns . In a ReAct loop, attacker-controlled web content is presented to the model exactly when it chooses what to click, type, submit, copy, or visit next, often while acting with the user’s logged-in authority react ; debenedetti2024agentdojo ; liu2024formalizing . This introduces fundamental and unavoidable vulnerabilities to ReAct-loop web agents liu2024formalizing ; debenedetti2024agentdojo ; wang2025webinject . We argue that web agents should use a plan-then-execute (PTE) architecture by default . As shown in Fig. 1 , plan-then-execute agents commit to a task-specific program before executing it, interacting with the website through trusted APIs . Untrusted runtime web-content is only processed through static code, and optionally by quarantined LLM subroutines which cannot change the plan. This treats each agent run as a program whose control flow is fixed during planning and whose data values are supplied during execution. Untrusted web content may therefore influence the data consumed by the program, but it cannot cause the model to synthesize new actions while the task is running. In a PTE web agent, the model first produces a task-specific program (the plan). An executor then runs that program. During execution, the program is able to invoke APIs to interact with the target web site or to call quarantined LLMs for extraction and classification. Runtime web content may fill parameters, determine branch outcomes, or influence local LLMs. However, it cannot add new actions, select new tools, trigger replanning, or rewrite the user’s objective. This separates untrusted data flow from control-flow generation. Not every web task can be reduced to a static script. We do not claim that reactive agents have no role. Some tasks require open-ended exploration, depend on instructions discovered only during execution, or span sites for which no trustworthy API exists. Our claim is that reactive replanning should be reserved for tasks that actually require it. When the control flow of a web task can be determined from the user request, the agent should plan before execution rather than repeatedly choosing actions on the fly based on untrusted web observations. This paper argues for that architectural shift. We first introduce the threat model and related work in Section 2 . Next, we analyze why ReAct is not suitable for web agents, focusing on its security and efficiency limitations, in Section 3 . Building on this critique, we describe how PTE can be enabled for web agents through site APIs, planning, and constrained execution in Section 4 and 5 . To assess the practical scope of this approach, we analyze a popular web agent benchmark, evaluate how many tasks can be planned, and draw lessons about both the applicability of our proposal to web agents and the remaining gaps in deploying PTE in Section 6 . Finally, we discuss alternative designs and state our research agenda in Section 7 . 2 Background Web Agents. Web agents interact with websites through a browser (DOM, events, screenshots, coordinates) or through structured APIs. Their goal is to browse and interact with web resources much as a human would. Web agents are still in their infancy: benchmarks such as WebArena webarena report that even strong LLM-based agents can still struggle to match human end-to-end success, underscoring the importance of robustness and systems design. 1 1 1 WebArena evaluates agents’ ability to perform tasks on self-hosted websites such as