Webwright: Why AI Web Agents Should Write Code, Not Click

| Source: Towards Data Science

Tags: Microsoft Research, web agents, browser automation, GPT-5.4, agentic AI, Webwright, CodeAct

Microsoft Research's Webwright switches web agents from click-by-click browser control to terminal code generation, pushing the same GPT-5.4 model from 33.5% to 60.1% success on long-horizon tasks while producing reusable CLI tools instead of ephemeral click sequences.

Details

Webwright, a framework from Microsoft Research and the University of Hong Kong released in May 2026, proposes a fundamental shift in how AI web agents operate. Rather than predicting one browser action at a time — click, type, scroll — Webwright gives the model a terminal and instructs it to write a complete program that accomplishes the task from start to finish. The improvement is substantial: the same underlying GPT-5.4 model jumps from 33.5% task success to 60.1% on long-horizon benchmarks when switched from click-by-click mode to code-writing mode. The article traces a lineage from CodeAct through to Webwright, positioning terminal code generation as the next evolution beyond frameworks like browser-use, Skyvern, Stagehand, and LaVague. The key practical difference is what the agent leaves behind. A conventional click-trace agent completes a task and produces no artifact. Webwright produces a command-line tool — a program that can be re-run, inspected, versioned, and shared. This matters for enterprise deployments where repeatability and auditability are requirements. The article is a detailed analysis (20+ minute read) from Towards Data Science rather than a primary lab release. Performance numbers cited are specific and the architectural argument is well-reasoned, but verify claims against the original paper before making architectural decisions.