Drop-in agent rule
Playwright
This adds a cheap public route-risk check before scripted browser work and gives the script a consistent reporting closeout.
Install or paste
Playwright wrapper
Playwright wrapper
typescript
import { test } from "@playwright/test";
const CRAWLDEX_CHANNEL = process.env.CRAWLDEX_CHANNEL ?? "adapter-playwright";
async function preflight(site: string, task: string) {
const res = await fetch("https://crawldex.com/api/v1/preflight", {
method: "POST",
headers: {
"content-type": "application/json",
"x-crawldex-channel": CRAWLDEX_CHANNEL
},
body: JSON.stringify({
site,
task,
agent_profile: { stack: "playwright", browser_runtime: "chromium" }
})
});
return res.json();
}
test("public route stays agent-readable", async ({ page }) => {
const gate = await preflight("netflix.com", "subscriptions.cancel");
test.skip(!gate.decision.should_attempt_autonomously, gate.agent_instruction);
await page.goto("https://www.netflix.com/");
});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.
Preflight call
bash
curl -sS -X POST https://crawldex.com/api/v1/preflight \
-H "content-type: application/json" \
-H "x-crawldex-channel: adapter-playwright" \
-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-playwright" \
-d '{"site":"netflix.com","task":"subscriptions.cancel","outcome":"success_with_handoff","friction":["login_required"],"source_tier":"anonymous_report","evidence":{"artifact_types":["redacted_agent_report"]}}'