# How to test bot protection on your website, honestly

> A live bot gate on someone else's site tells you whether one visit was served. To test bot protection on your own website, read your vendor's logs.

Source: https://mosaicbrowser.com/blog/test-bot-protection-on-website

## Commercial bot gates are not test sites

A live bot gate on someone else's site tells you whether one visit was served. To test bot protection on your own website, read your vendor's logs.

![11: Eleven live gates, and not one of them renders a score](https://mosaicbrowser.com/covers/test-bot-protection-on-website.webp)

To test bot protection on your website, point traffic you can name at a copy of the site and read your vendor's log entry for each request. Somebody else's shop behind the same vendor won't do. Its rules were tuned for its own customers, it prints no score, and it changes without notice, so all it can tell you is whether one visit got the page.

We know where that line sits because we built the "Live gates" group of our detection catalogue, and most of what follows is copied from the notes on its rows.

## What a live gate actually reports

The catalogue lives in `src/shared/detection-tests.ts`, and eleven of its rows carry `category: 'waf'`. The comment at the top of the file sets the rule for every one of them: "A WAF test has no score to read." Cloudflare does not tell a visitor it rated them 0.3. It serves the page or it serves a challenge, so the pass line on most of those rows is a sentence about rendering: "Loads without a device-check interstitial", "Content renders without a 429 or an integrity page".

Five rows point at big commercial sites, each picked because it sat behind one vendor when the row was written: Akamai Bot Manager, F5's Shape, Kasada, Imperva and HUMAN (PerimeterX). DataDome and Qrator get rows on their own marketing sites, which run the product they sell. And the pass lines disagree with each other because the sites behave differently. The `akamai` row warns that Akamai "often serves once and blocks on the second navigation", so one page load proves nothing there. The `perimeterx` row only counts after several pages, because HUMAN weights mouse and scroll behaviour over time ([behaviour tests score your mouse](https://mosaicbrowser.com/blog/behavioral-bot-detection-test) has what that scoring reads).

Nobody set those shops up for us. Their owners picked the strictness for their own traffic and can tighten it tomorrow. A pass on the `kasada` row is a fact about one browser, on one IP, on one visit to one hotel chain's homepage. A fail is a fact of exactly the same size.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: REST API](https://mosaicbrowser.com/features/rest-api)

## Three ways a gate misleads a tester

### The demo that passes everyone

We had to mark the Turnstile demo row `verdict: 'reference'` instead of `'automatic'`. When we measured it, the page handed out the token `XXXX.DUMMY.TOKEN.XXXX`, which is the reply Cloudflare documents for its always-passes test sitekey, `1x00000000000000000000AA`. No widget iframe was ever created and no challenge ever ran. A script got the same string a person did. Counting that as a pass would have been the catalogue lying in the flattering direction, so the row now says it measures nothing and sends the reader to `cloudflare-challenge`, which does ([what nowsecure.nl can tell you](https://mosaicbrowser.com/blog/what-nowsecure-tells-you)).

### The score that arrives late

The reCAPTCHA v3 demo prints a number, which almost nothing else does, and our row passes at 0.7 or above. Early on we read it at 20 seconds. On one run of three the score wasn't there yet; at 30 and 35 seconds it was. So we waited 35, and a full catalogue run still came back `unread` while a stock browser in the same session read `score 0.9`. We had taken three timings and none of them described the site. Now the row polls for the score itself and gives up after 90 seconds.

### The page that renders before it has measured

This one isn't only a gate problem. A bot test its author has retired can still answer HTTP 200. One scoring page we read printed "Bot score 0/100" while its hash field still said `collecting…` ([a dead detector that returns 200](https://mosaicbrowser.com/blog/dead-detector-returns-200)). Read the status code, or the first number on the page, and you'd log both as passes.

## How to test bot protection on your own website

On your own site you can read the vendor's record of each decision, which no outside page will ever show you. Everything below is built around that log.

1. Use a staging host, or a test path that carries the production rules. Then a challenge lands on you instead of a customer, and real visitors don't end up in the numbers.
2. Wire the widget up with the vendor's test keys before anything else. For Turnstile that's the `1x00000000000000000000AA` key from the demo above. A test key tells you the integration works, and it is built to tell you nothing about detection.
3. Name every kind of traffic you send: Chrome by hand, the same Chrome under Playwright or Puppeteer, a headless run, `curl`. Then send each one again from a datacentre address. Change one of those per run.
4. Pull the log entry for every request. You want the decision or score, the rule that fired and the signals the vendor cited. A rendered page only says the request got through.
5. Run each case more than once. Akamai's habit of serving the first page and blocking the second is the reason. Our runner has a `--rounds` flag for this, and a row whose verdict moves between rounds is stored as `flaky`, which counts as neither pass nor fail.

Put a stock browser in every batch as the control. Each row in our catalogue is held to that: when a stock Chrome gets the same verdict, the verdict says nothing about the client under test. On your own gate it works the same way. If plain Chrome, driven by hand, gets challenged from a datacentre address, your address rule fired, and your bot detection still hasn't been tested.

## Where our catalogue fits

We point the live gates at Mosaic profiles because a profile meets these gates on ordinary sites and should be served like the Chrome it claims to be. `run-detection-tests.mjs` records a gate that served nothing as `unreachable`, never as a pass, and the same catalogue can be run through a stock Chrome as a control. That is useful for grading a browser. It grades nobody's bot protection, and if we ran a shop we would not grade ours on somebody else's.

How each group of the catalogue is read is in [49 browser fingerprint detectors](https://mosaicbrowser.com/blog/forty-nine-detectors). What a browser that keeps its values consistent can and cannot promise against a gate is in [what an anti-detect browser is](https://mosaicbrowser.com/guides/what-is-an-anti-detect-browser).

## Questions

### How do I test bot protection on my own website?

Point Chrome by hand, Chrome under an automation tool, a headless run and curl at a staging copy, from a home line and from a datacentre address. For each request, read your vendor's log: the decision, the rule that fired, the signals cited. The page itself only shows that the request got through.

### Can I use a big retail site to test whether my browser looks like a bot?

It answers one question: did that shop serve that browser, from that address, that time. Its owner tuned the rules for their own customers and can change them tonight, and the page never says why it let you in or kept you out.

### Do bot protection vendors give test keys?

Yes, for the integration. Cloudflare documents an always-passes Turnstile sitekey, 1x00000000000000000000AA, and its public demo page runs on it: we measured the demo handing out XXXX.DUMMY.TOKEN.XXXX with no challenge at all. So that demo grades nobody.

### Why does my site sometimes let a bot through and sometimes not?

Because the browser is only part of what a gate weighs. The address, the request rate and behaviour across pages count too. Our catalogue notes that Akamai often serves the first page and blocks the second, so one visit is one sample.

## Related

[What nowsecure.nl can and can't tell you about Cloudflare](https://mosaicbrowser.com/blog/what-nowsecure-tells-you): nowsecure.nl is one site on one aggressive Cloudflare setting, and the page loading is the pass. It says nothing about another site's rules.

[49 browser fingerprint detectors, and how we read them](https://mosaicbrowser.com/blog/forty-nine-detectors): Our browser fingerprint detectors list: 49 public test pages in five groups, 40 read by a script and 9 kept as reference because they print no verdict.

[Behaviour tests score your mouse, not just your browser](https://mosaicbrowser.com/blog/behavioral-bot-detection-test): A behavioral bot test like Incolumitas BotOrNot scores mouse paths, scrolling and dwell from 0 (bot) to 1 (human). Touch nothing and it rates stillness.

[A retired bot test can still answer 200 and look like a pass](https://mosaicbrowser.com/blog/dead-detector-returns-200): Antoine Vastel's fp-scanner demo now serves his homepage with HTTP 200, which a challenge reader scores as a pass. His tests moved; here is where.

[What is an anti-detect browser?](https://mosaicbrowser.com/guides/what-is-an-anti-detect-browser): An anti-detect browser gives each profile its own fingerprint, proxy and cookies, so sites see separate visitors. What it changes, how, and its limits.



[A fresh browser for every test run, and why it should be cheap](https://mosaicbrowser.com/blog/fresh-profile-per-test-run): Leftover cookies and storage are where flaky browser tests come from. A one-time profile gives each run a clean jar and trashes itself when its browser closes.



## Mosaic, on your own computer

The browser this blog is about: its own Chromium, fingerprints from real machines and a proxy IP per profile. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
