# CrawlDex browser-use Pack

Canonical: https://crawldex.com/agents/browser-use
Markdown: https://crawldex.com/agents/browser-use.md
Harness id: browser_use
Channel: adapter-browser-use

## Why this exists

Preflight helps the planner decide whether to attempt the route, keep the user present, or switch to an easier site before the browser starts.

## When to call CrawlDex

Immediately before launching the browser-use task loop.

## Install or paste

```python
# No browser-use PR merge is required. Install the CrawlDex reporter SDK directly:
# python -m pip install crawldex-report
# export CRAWLDEX_CHANNEL=adapter-browser-use

import os
import requests

def crawldex_preflight(site: str, task: str) -> dict:
    response = requests.post(
        "https://crawldex.com/api/v1/preflight",
        headers={"x-crawldex-channel": os.getenv("CRAWLDEX_CHANNEL", "adapter-browser-use")},
        json={
            "site": site,
            "task": task,
            "agent_profile": {
                "stack": "browser-use",
                "browser_runtime": "chromium",
            },
        },
        timeout=20,
    )
    response.raise_for_status()
    return response.json()

preflight = crawldex_preflight("netflix.com", "subscriptions.cancel")
if preflight["decision"]["recommendation"] in {"avoid_until_fresh_evidence", "collect_evidence_first"}:
    raise RuntimeError(preflight["agent_instruction"])
```

## Preflight call

```bash
curl -sS -X POST https://crawldex.com/api/v1/preflight \
  -H "content-type: application/json" \
  -H "x-crawldex-channel: adapter-browser-use" \
  -d '{"site":"netflix.com","task":"subscriptions.cancel","agent_profile":{"stack":"browser-agent","browser_runtime":"chromium"}}'
```

## Report redacted outcome after eligible public work

Do not report private account data, payment data, messages, screenshots with sensitive content, tokens, cookies, raw traces, local files, or logged-in-only pages.

```bash
curl -sS -X POST https://crawldex.com/api/v1/runs \
  -H "content-type: application/json" \
  -H "x-crawldex-agent-key: $CRAWLDEX_AGENT_KEY" \
  -H "x-crawldex-channel: adapter-browser-use" \
  -d '{"site":"netflix.com","task":"subscriptions.cancel","outcome":"success_with_handoff","friction":["login_required"],"source_tier":"anonymous_report","evidence":{"artifact_types":["redacted_agent_report"]}}'
```
