Skip to content

Baya: Protecting Web Agents with a Compile-Then-Execute ParadigmSecuring Web Agents with the Compile-Then-Execute Paradigm

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2611.06039· Annabella Chow, Jinhao Zhu, Sylvie Venuto, Abdulaziz Alharbi, Basel Alomair, Raluca Popa, David Wagner, Julien PietUC Berkeley; KACSTIndexed by this site · 19 days ago· Originally publishedDefenses

Translation in progress — untranslated text is omitted.

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

AI summaryResearchers 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.

Questions
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.
Methods
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.
Experiments and results
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.
Limitations and future work
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

大模型安全周报:智能体安全边界在签名、授权与上下文

Related papers

Show 3 more papers
Read originalarxiv.org