How We Optimized Browser Use for Deep Agents
Tool design dominated cost and speed for browser agents: across seven toolsets on 100 WebVoyager tasks, pass rates ranged 78–90%, but Stagehand passed 90% for $1.98 total while Playwright MCP passed 78% for $26.71 at three times the latency. The gains came from code mode (one `run` call batches many actions and keeps intermediate page data out of context, averaging 10 steps versus 26), compact accessibility-tree snapshots with element IDs instead of raw HTML or screenshots, and running inside the browser to avoid per-action CDP round trips. Accepting Playwright-style code beat Stagehand's native API by 5.3 points, and truncating snapshots after the fact didn't help because agents just re-fetched. Replacing fixed sleeps with a 500 ms network-quiet settle wait cut median HardBench time from 182 s to 124 s with no accuracy loss, all validated through trace-driven iteration and evals.
Related posts
- Browser Use in Managed Deep Agents
LangChain mediumAdeptManaged Deep Agents in LangSmith now runs a remote browser in its own sandbox and gives agents Stagehand-based tools: browser_snapshot (accessibility tree with element IDs), browser_run (batched actions or Playwright-style JavaScript in one call to keep page content out of context), browser_screenshot, and browser_handoff for letting a human sign in without exposing credentials. Sessions can be scoped per thread or per user so logins persist, and a private localhost bridge lets the browser reach apps running in the agent's sandbox for end-to-end testing, with passing runs exportable as Playwright scripts. On 100 WebVoyager tasks the toolset passed 90% for $1.98 total, versus 89% at 9x the cost for Browserbase's MCP server.
- Agentic Testing: Where Agents Fit in the E2E Testing Stack
Slack Engineering mediumAdeptAcross 200+ agent-driven E2E runs against Slack test workspaces, agents using Playwright MCP were the most reliable (0% failures on a simple thread-reply flow, ~12% on a longer search flow). Playwright CLI agents failed 12–20%, mostly from auth, navigation timing and session instability. Agent-generated Playwright tests ran fastest (~3 min including generation, ~30–45 s raw) but failed ~48% on the complex flow. Agent runs cost $15–30 each, driven by turn count and retransmitted context such as accessibility-tree snapshots rather than model choice; CLI took ~85 turns versus MCP's ~40. The recommendation is to keep deterministic tests for CI and add agentic testing as a top pyramid layer for exploration, debugging and bug reproduction.
- Harness design for long-running apps
Anthropic Engineering mediumAdeptA GAN-inspired multi-agent harness separates generation from evaluation so Claude can produce distinctive frontend designs and build full-stack apps autonomously over multi-hour sessions. For frontend work, a generator and a Playwright-equipped evaluator iterate 5-15 times. The evaluator grades against four weighted criteria (design quality, originality, craft, functionality) and is calibrated with few-shot score breakdowns, which pushes output away from generic 'AI slop'. For full-stack apps, the harness has three agents: a planner expands a short prompt into a spec, a generator builds in sprints against negotiated sprint contracts, and an evaluator QA-tests the running app with hard per-criterion thresholds. A retro game maker built this way cost about $200 over 6 hours, against $9 and 20 minutes for a solo agent, and produced dramatically better results; tuning a standalone skeptical evaluator proved more tractable than making a generator critique itself.
- The Most Common Questions About Agent Evals, Answered
LangChain mediumAdeptAgent evals score agent runs to handle nondeterminism, multiple valid answers and variable execution paths: start by reading traces, pick one behavior, build a 10-20 example dataset from real traces, run a baseline experiment, and fold new failures back in. Offline evals compare versions against datasets before shipping, while online evals score sampled production traces without reference outputs. Use code evaluators where possible, LLM judges with narrow binary questions calibrated against human review, and pairwise comparison for choosing variants. Container-based benchmarks like Terminal-Bench (run via the open-source Harbor harness) score the end state of an environment for long multi-step tasks, and online costs can be controlled through sampling, filters, code checks and cheaper judge models.
- 2,000 robots walk into a shop...
Shopify Engineering hardMasterSimGym runs simulated A/B tests on Shopify storefronts by sending up to 2,000 concurrent LLM-driven shopper agents through Browserbase cloud browsers. Because browsers bill per minute, inference latency directly drives cost: a ~20% latency cut lowered cost per merchant run by ~10%. The team self-hosted gpt-oss-120b on 48 B200 GPUs with vLLM and FlashInfer, using MXFP4 experts, an FP8 KV-cache, custom long-context speculative decoding kernels (EAGLE-3) and combined async/guided/speculative decoding. MIG partitioning cut latency ~20% and prefix-cache-friendly prompts added ~12% throughput, while lowering reasoning effort was rejected because error rates rose to as much as 10.9%.