BrowserTrace

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.

Improving an adapter note or docs example? Use the First PR Recipe to keep the first contribution small and reviewable.

Browser Use Stagehand Skyvern Playwright + LLM Computer Use
BrowserTrace timeline preview for AI browser-agent debugging

AOS mapping research

This is research-only mapping, not an AOS compliance claim. BrowserTrace is tracking how browser-agent artifacts could map to OWASP Agent Observability Standard concepts while upstream browser/GUI artifact guidance is still open.

Tracker: BrowserTrace issue #237.

BrowserTrace field Closest AOS shape Status Current note
Run id and step id Step context plus tool execution or correlation id partially mapped BrowserTrace has run ids and ordered steps; an export-level AOS correlation convention is still needed.
Action label or tool call steps/toolCallRequest partially mapped Action labels and integration method metadata exist, but normalized tool ids and execution ids are not standardized yet.
Status and error steps/toolCallResult with isError partially mapped Document the research-only toolCallResult result shape as run status, step status, error message/type when available, action/tool label, step id, and public export/redaction state; this remains a research mapping, not an AOS compliance claim.
Screenshot or future video artifact FileWithUri preferred over inline FileWithBytes research gap BrowserTrace keeps screenshots as local artifacts; browser screenshot/video examples are still unresolved upstream.
Current browser URL Separate event or resource attribute research gap Keep URL separate from screenshot evidence so future mappings can redact each field independently; the AOS attribute placement is still open.
Model input and output Message, reasoning, or linked model-message summary research gap Use compact summaries where possible, but do not force full prompt or model I/O into every tool-result payload.
Public export redaction state Artifact and field-level metadata research gap Future mappings should preserve explicit omitted or redacted markers instead of silently dropping sensitive evidence.

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, public-safe 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, public-safe 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,
    )