Drop-in agent rule
Stagehand
Stagehand can use CrawlDex as a route gate so it does not start a brittle flow without blocker and user-presence context.
Install or paste
TypeScript guard
TypeScript guard
typescript
/*
No Stagehand PR merge is required. Install the CrawlDex reporter SDK directly:
npm install crawldex-report
export CRAWLDEX_CHANNEL=adapter-stagehand
*/
async function crawldexPreflight(site: string, task: string) {
const response = await fetch("https://crawldex.com/api/v1/preflight", {
method: "POST",
headers: {
"content-type": "application/json",
"x-crawldex-channel": process.env.CRAWLDEX_CHANNEL ?? "adapter-stagehand"
},
body: JSON.stringify({
site,
task,
agent_profile: { stack: "stagehand", browser_runtime: "playwright" }
})
});
if (!response.ok) throw new Error("CrawlDex preflight failed");
return response.json();
}
const preflight = await crawldexPreflight("netflix.com", "subscriptions.cancel");
if (!preflight.decision.should_attempt_autonomously) {
throw new Error(preflight.agent_instruction);
}Privacy boundary
Keep CrawlDex public-only.
Do not submit private account data, payment data, messages, screenshots with sensitive content, cookies, tokens, raw traces, local files, or logged-in-only pages. Stop before irreversible work unless the user is present and explicitly authorizes it.
Direct API call
bash
curl -sS -X POST https://crawldex.com/api/v1/preflight \
-H "content-type: application/json" \
-H "x-crawldex-channel: adapter-stagehand" \
-d '{"site":"netflix.com","task":"subscriptions.cancel","agent_profile":{"stack":"browser-agent","browser_runtime":"chromium"}}'Report redacted outcome
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-stagehand" \
-d '{"site":"netflix.com","task":"subscriptions.cancel","outcome":"success_with_handoff","friction":["login_required"],"source_tier":"anonymous_report","evidence":{"artifact_types":["redacted_agent_report"]}}'