> Source: browser-use team, *The Bitter Lesson of Agent Harnesses* > Project: https://github.com/browser-use/browser-harness (6,538 stars, 8 days after launch) > Analysis: Xiao Kai, 2026-04-26
Key points
- Scale comparison: browser-harness totals ~592 lines —
run.py(~36 lines, runs Python with preloaded helpers),helpers.py(~195 lines, thin CDP wrapper the agent can edit), andadmin.py/daemon.py(~361 lines, CDP websocket daemon). The main browser-use project (90k stars) has thousands of lines of element extraction, DOM indexing, click wrappers, and watchdog handlers. The same tasks complete with 1/20 the code. - Philosophy 1 — Self-heal: when a function is missing (e.g.,
upload_file()), the agent grepshelpers.py, writes the function itself, and continues. When a 12MB upload exceeded the 10MB websocket limit, the agent read the error and switched to chunked upload. "The agent isn't writing new code from first principles. It's writing the one function that was missing." - Philosophy 2 — Direct CDP access: "LLMs know CDP. They were trained on millions of tokens of Page.navigate, DOM.querySelector, Runtime.evaluate." Direct CDP handles cross-origin iframes (attach the target), shadow DOM (
shadowRoot.querySelectorAll), and anti-bot scenarios (Chrome talking to itself) without framework abstractions in the way. - Philosophy 3 — AI writes code, humans don't write configs: instead of YAML/JSON skill descriptions, humans ship only the thinnest CDP wrapper; the agent writes what it needs. Real cases: agent implementing upload via
DOM.setFileInputFiles, extracting birthdays from Gusto to create Google Calendar events, and penetrating nested Azure iframe blades with coordinate-levelInput.dispatchMouseEvent. - Traditional engineering optimizes for control (pre-written handlers for every edge case), making frameworks heavier and agents dumber. browser-harness optimizes for trust: give the lowest-level interface and let the agent solve problems itself.
- Abstraction direction matters: human-friendly
click("login button")limits agents; AI-nativeInput.dispatchMouseEvent(x=120, y=340)frees them, assuming the agent — not the human — is the operator. - This applies Sutton's Bitter Lesson (2019): "general methods leveraging computation are ultimately the most effective." Don't pre-write edge-case handlers; give agents maximum freedom and let them learn.
- Next-gen agent frameworks should provide *lower-level capability*, not more tools. Pattern: when an agent fails to use a tool, sink to a lower-level interface and let the agent write its own wrappers.
- Self-healing generalizes: missing function → read code → write code → verify → continue, with version control for audit and rollback.
- Projects like OpenClaw could adopt dynamic skill generation, thinner channel APIs, and self-repairing toolchains.
- Poor fit for scenarios needing human-readable audit logs (CDP is unfriendly), strict compliance (AI-written code may violate policy), and simple repetitive tasks.
- Self-healing requires strong models (code generation, debugging, boundary awareness); weak models may do better with traditional frameworks.
- Maintenance cost shifts from framework developers to agent runtime compute — pre-written frameworks remain more efficient for high-frequency tasks; browser-harness shines on exploratory and long-tail tasks.
The safety debate
Hacker News and Reddit questioned whether letting an AI edit its own harness is dangerous. The team's answer combines sandboxing — the CDP websocket touches only the browser, not the host filesystem, and the agent edits only helpers.py — with capability-boundary design: "give the agent the right scope of capability," not no capability. The deeper argument: layered abstractions widen the semantic gap between agent and real system, so guesses become bugs. Direct CDP is *understandable* danger versus *incomprehensible* abstraction.
"Less is stronger"
Ecosystem implications
Limitations
Notable quotes
> "Every click(), type(), scroll() helper is an abstraction you decided the model needs. Every one of them is a constraint the RL'd model has to fight around."
> "The 'complexities of CDP' we were trying to hide weren't something to hide. They were something to let the model see."
> "The bitter lesson of agent harnesses: your helpers are abstractions too. Delete them. Let the agent write what it needs."
> "First person to find a task it fails on (not captcha/2FA) gets a Mac Mini. Seriously. I've been trying to break it for a week and can't."
One-line takeaway
browser-harness proves in 592 lines that when agents are smart enough, the best framework offers fewer constraints, not more tools: self-healing + direct CDP + AI-written code — less is stronger, lower-level is freer.