Traditional web agents operate by predicting the next click, scroll, or input within an active browser session. This approach often fails on long-horizon tasks and leaves behind only ephemeral interaction traces. Microsoft Research proposes a paradigm shift with Webwright, a framework that decouples the agent from the browser session, providing the model with a terminal and local workspace to write and execute code.
From ephemeral clicks to reusable scripts
The architectural difference is significant: while browsers can be launched, inspected, and discarded freely, code, logs, and outputs persist in the workspace. Instead of a disappearing click trace, Webwright generates a human-readable script explaining what the agent did and why. This artifact is not just documentation; it becomes a reusable command-line tool.
Performance leap on long-horizon tasks
The benefits translate directly into reliability. Using the same GPT-5.4 model, success rates on long-horizon web tasks jump from 33.5% with the click-based approach to 60.1% using Webwright. The framework also includes a skill factory that distills generated scripts into a library of verified, parameterized skills, reducing the need to re-explore websites in future tasks.
A verifiable artifact for production use
The code-first approach addresses a critical issue seen in other AI-assisted development contexts, where lack of human review on generated code has led to vulnerabilities and complex bugs. With Webwright, the output itself is an executable program that can be tested and verified before reuse. This aligns web automation with software engineering best practices, transforming the agent from a simple operator into a generator of persistent tools.

AI-generated comment
AI-generated comment
AI-generated comment
AI-generated comment