Trace the browser-agent stack you already use
BrowserTrace records the screenshots, URLs, actions, model inputs, model outputs, statuses, and errors around failed browser-agent runs.
Browser Use
Attach BrowserTrace to a Browser Use agent through its step callback surface.
Open the Browser Use debugging guide for a focused quickstart, export commands, and public-safe trace workflow.
from browser_use import Agent
from browsertrace import Tracer
from browsertrace.integrations.browser_use import attach_tracer
tracer = Tracer()
agent = Agent(task="...", llm=ChatOpenAI(model="gpt-4o"))
with attach_tracer(agent, tracer, name="browser-use run"):
await agent.run()
Stagehand
Wrap a Stagehand page so high-level browser-agent calls become trace steps.
Open the Stagehand debugging guide for the wrapper quickstart, export commands, and adapter feedback link.
from stagehand import Stagehand
from browsertrace import Tracer
from browsertrace.integrations.stagehand import wrap_stagehand
tracer = Tracer()
stagehand = await Stagehand(...).init()
page = wrap_stagehand(stagehand.page, tracer, name="stagehand run")
await page.goto("https://example.com")
await page.act("click the login button")
await page.extract("get the headline")
page.bt_run.close()
Skyvern
Wrap a Skyvern-shaped client to record task and workflow calls without adding a hard Skyvern dependency.
Open the Skyvern debugging guide for task/workflow tracing, export commands, and adapter feedback link.
from skyvern import Skyvern
from browsertrace import Tracer
from browsertrace.integrations.skyvern import wrap_skyvern
tracer = Tracer()
skyvern = wrap_skyvern(Skyvern(...), tracer, name="skyvern run")
await skyvern.run_task(
url="https://example.com",
prompt="extract the invoice total",
wait_for_completion=True,
)
skyvern.close()
Playwright + LLM
Use snapshots around the points where your LLM chooses the next browser action.
Open the Playwright + LLM debugging guide for a focused trace workflow and public-safe export commands.
from browsertrace import Tracer
tracer = Tracer()
async with tracer.run("playwright agent") as run:
await page.goto("https://example.com")
await run.snapshot(page, action="opened example.com")
decision = await llm_choose_next_action(...)
await page.click(decision["selector"])
await run.snapshot(
page,
action="clicked selected element",
model_input=decision["prompt"],
model_output=decision,
)
Custom computer-use agents
Place snapshots at the observe, decide, and act points in your own browser-agent loop.
Open the computer-use debugging guide for a generic wrapper pattern, export commands, and public-safe trace workflow.
from browsertrace import Tracer
tracer = Tracer()
async with tracer.run("custom computer-use agent") as run:
await page.goto("https://example.com")
await run.snapshot(page, action="opened task page")
observation = await describe_page(page)
decision = await model.choose_next_action(observation)
await page.click(decision["selector"])
await run.snapshot(
page,
action=f"clicked {decision['selector']}",
model_input=observation,
model_output=decision,
)