Cloudflare
If your site runs behind Cloudflare, you can run Agent Detection there. One Cloudflare Worker sits in front of your site. It adds the script tag to your pages for you, and it can block agents before a request reaches your servers.
This suits teams who want edge-level blocking while the script tag rolls out across their platforms.
What the Worker does
On a protected path
Blocked requests get a 403 with an x-rad-edge header that names the reason. API calls get JSON:
The edge sees a request’s headers and network, but not how the visitor behaves. AI browsers and computer-use agents run a real browser and pass the check page. They’re blocked on their next protected request once Agent Detection calls the visit an agent, usually within its first few seconds. Protect the actions that matter, such as sign-in, sign-up and payment, so that block lands before them.
Install
Get your key and secret
In the Resemble app, open your Agent Detection integration. Copy the publishable key (pk_live_...) and the identity secret (sk_ident_...) from the Identify panel. The Worker uses the secret to prove it’s yours. Keep it out of your pages and your source code.
Deploy the Worker
The Worker lives at resemble-ai/agent-detection-cloudflare. Click Deploy to Cloudflare there, sign in, and enter your key and secret when asked. Then add a route for your site under Workers & Pages → resemble-agent-detection → Settings → Domains & Routes.
To deploy with Wrangler instead:
Settings
Native mobile apps
Native apps call your APIs directly and never load a web page, so they never get a pass. Don’t protect API paths that your iOS or Android apps use.
What leaves your site
- Sent to Resemble: a fixed list of request headers (user agent, client hints, fetch metadata, language and signature headers), the method and URL, and the visitor’s IP address. Resemble hashes the address, keeps only the URL’s path, and uses the full URL only to check a signature.
- Never sent: cookies, authorization headers, or page content.
- Set on your pages:
__Host-rad_pass(the pass),__Host-rad_n(proof that a page came through the Worker, 10 minutes), andrad_pr(a random id that links the request to the visit, 2 minutes). Check them against your consent rules.
If something fails
The Worker never stops a page from loading. If it throws an error, your page is served as normal. If Resemble can’t be reached within 1.5 seconds, the request goes through. The added time is about 10 ms on HTML pages and about 2 ms on other files.
