Baya: Protecting Web Agents with a Compile-Then-Execute ParadigmSecuring Web Agents with the Compile-Then-Execute Paradigm
Translation in progress — untranslated text is omitted.
Researchers propose Baya, a compile-then-execute Web Agent that by design prevents prompt injection from hijacking control flow. Before visiting live websites, Baya first compiles the user request into a Python program that calls Trusted Website APIs; the planning model does not come into contact with live webpage content, and untrusted data can only determine program values or choose among branches defined at compile time, and cannot rewrite the user task or make the model synthesize new website operations at runtime. On 581 valid WebArena Verified tasks, Baya achieves 77.8% overall utility, higher than pure-browser ReAct's 55.1% and API-enabled ReAct's 66.7%; on the Web Agent security benchmark WASP, Baya's attack success rate is 0%, while the two ReAct baselines are 16.2% and 25.5%, respectively.
- ReAct web agents mix trusted and untrusted content at runtime when deciding the next action, making them susceptible to control-flow hijacking via indirect prompt injection in web pages; the authors focus on how to prevent control-flow hijacking while maintaining utility.
- Baya adopts compile-then-execute: first, a sandboxed coding agent compiles the user task into a Python program that calls the Trusted Website API and verifies it with mock tests; then an isolated execution engine runs it on the real website; the planning model does not access live web content, and on failure it replans using only restricted error diagnostics, at most three times.
- On 581 valid tasks of WebArena Verified, Baya achieves an aggregate utility of 77.8%, higher than ReActweb + API's 66.7% and ReActweb's 55.1%; on WASP, Baya's intermediate and end-to-end ASR are both 0%, versus 16.2% and 25.5% for the two ReAct baselines; the cost is 327.15 seconds of latency and about 1.37M tokens per task.
- The authors note: compilation overhead is high; only tasks whose control flow can be determined before execution are supported; the Trusted Website API is currently built manually and must be maintained as websites evolve, with automated construction being future work; result manipulation, error messages, DoS, and compromise of trusted components are all outside the scope of protection.
Related events and news
1 events · 1 news mentions
News that mentions this paper
大模型安全周报:智能体安全边界在签名、授权与上下文
- 公众号 大模型安全研究cites the paper's id or link大模型安全周报:智能体的安全边界在签名、授权与上下文三层防线里
Securing Web Agents with the Compile-Then-Execute Paradigm(https://arxiv.org/abs/2611.06039)
Related papers
Show 3 more papers
- Towards Safe Autonomy for Computer UseDefensesarXiv