# Web Agents Should Adopt the Compile-and-Execute Paradigm

DevFeed: [Web Agents Should Adopt the Compile-and-Execute Paradigm](<https://devfeed.tech/articles/web-agents-should-adopt-the-compile-and-execute-paradigm-101344.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2605.14290>)

Author: Julien Piet, Annabella Chow, Yiwei Hou, Muxi Lyu, Sylvie Venuto, Jinhao Zhu, Raluca Ada Popa, David Wagner

Published: 2026-10-27T04:00:00Z

Content type: opinion

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>), [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [computer-use](<https://devfeed.tech/topics/computer-use.md>), [Web](<https://devfeed.tech/topics/web.md>), [Zero Trust](<https://devfeed.tech/topics/zero-trust.md>), [Declarative programming](<https://devfeed.tech/topics/declarative-programming.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [apis](<https://devfeed.tech/tags/apis.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [browser-tools](<https://devfeed.tech/tags/browser-tools.md>), [compile](<https://devfeed.tech/tags/compile.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [interface](<https://devfeed.tech/tags/interface.md>), [planning](<https://devfeed.tech/tags/planning.md>), [prompt](<https://devfeed.tech/tags/prompt.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [static](<https://devfeed.tech/tags/static.md>), [web](<https://devfeed.tech/tags/web.md>)

## AI overview

The authors argue web agents should default to compile-and-execute: commit to a task-specific program before seeing runtime page content, then run it. ReAct feeds mixed, partly untrusted web content into decisions about the next action, creating a path for prompt injection to steer control flow. A predefined execution graph can let that data affect values or branches without letting it redefine the task or generate new actions. In their WebArena analysis, all tasks were compatible with this approach and 81% could use static programs without runtime LLM calls. Adoption is hindered by browser tools such as click, type, and scroll, whose meanings depend on the page and expose only current-page actions during planning. The authors say the needed infrastructure is typed, complete, auditable website APIs that expose task-level operations and known effects.

## Source excerpt

arXiv:2605.14290v2 Announce Type: replace 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 compile-and-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. Compile-and-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 compile-and-execute, while 81% can be completed with a purely static program, without any runtime LLM subroutine. We identify the main barrier to adopting compile-and-execute on the web: For it to work well, tools must map cleanly to semantic actions, with effects known before execution, so a compiler has enough information to emit a program. 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.