For Security Review
For the Content Security Policy entries, see Set Up baselayer.js.
Record Types
baselayer.js sends four types of record, each with anevent_type. Each carries a record ID, when it happened, the visit’s cookie value and the page’s path template.
At most 200 records are sent for one page. A
page_exit always goes, and carries the number dropped past that limit as dropped_count.
Path Templates
A record carries a path template, never the URL. The query string and fragment are removed, and each segment shaped like an identifier becomes{id}: a UUID, a number of 4 or more digits, a long hex or mixed-case token, or anything holding @. /orders/8812/items is sent as /orders/{id}/items.
Other segments are sent as they are. If your paths can hold a name or another personal value in a lowercase segment, pass your route templates in routes or exclude those pages with excludePaths. See Options.
What Is Never Sent
- Typed text, form values, query strings and fragments.
- The text, value or
hrefof an element anyone clicks. - Anything at all from a page that matches
excludePaths. - Anything at all when
initgetsconsent: false.
Cookies
The snippet keeps one first-party cookie on every page,baselayer_visit: 32 random hex characters, SameSite=Lax, Secure on https pages, 30 minutes from the last record. It is not HttpOnly. Its value travels inside the records and checks, never as a cookie sent to Baselayer.
When an agent’s credential passes a step-up, the snippet also sets baselayer_recognition: a signed token Baselayer issues that names the agent’s key and its customer ID at your site, never personal details. It is SameSite=Lax, Secure on https pages, lives 10 minutes and is not HttpOnly. The snippet sends it with the page’s next checks so the agent isn’t asked again.
Detection
The snippet loads a detection script from your application’s collect host,https://<application id>.collect.baselayer.com. The detection result stays with Baselayer, and the snippet uses it in its own checks; nothing needs forwarding.
The snippet never receives a verdict about a visitor. On each page it asks Baselayer for the page’s decision under your rules, and the answer carries only the decision: never the verdict, kind, score or detection session. On a step you enforce, it shows a step-up overlay or a block page; otherwise it changes nothing on your page. See What Your Visitors See.
Only Automated Visitors Are Stored
KYA records agent traffic only. The snippet can’t tell a person from an agent, so it sends the same records for every visit. Baselayer holds a visit’s records for up to 2 minutes while detection decides, and drops them unwritten when detection finds no automated visitor or gives no answer in time. To see browser records while you set up, test on staging.Delivery
Records are sent to the API origin you passed asapiOrigin every 5 seconds, sooner when 50 are queued, and when the page is hidden or closed. A failed send is retried with backoff. A record carries a unique ID, so a retried record is never counted twice.