GET /v1/clearance/keys; Heretic is never in the request path. Heretic signs what it measured, including a contradicted verdict, and never withholds or reads back the token.
A probe-only token is typically about 1.1 KB; a ceremony adds its device record. Each measurement session opened counts as a probe, and each ceremony minted counts as a challenge against your plan. Reading a clearance cookie does not start another measurement.
Hosted page
Redirect an uncleared request to the hosted page. It runs the probe, escalates per the site’s clearance settings, and returns to your URL withheretic_clearance=<jwt> appended to the query.
return must be https://, or loopback http://, on the site’s registered domain. Any other value is refused on the page and never redirected.
Start with the complete Cloudflare Worker gate in examples/cloudflare-worker/. Its README and configuration template cover installation on an existing website. The download also includes Node, Python and PHP verifiers for an application gate.
- Create a site and verify its domain in the dashboard.
- Set the hosted page’s lifetime and escalation settings on that site’s panel.
- Configure the gate with the site’s public key and protected routes, then choose your admission rule.
- Deploy the gate at your edge or in your application. Heretic hosts the verification page; your gate handles redirects and cookies.
Background
Loadguard.js with data-clearance="true". The embed starts the probe automatically; it may display a ceremony according to your escalation settings. Then data-clearance-callback receives the JWT. Post it to your own endpoint, which verifies it and sets the cookie for the next request.
heretic.getClearance(id) reads the JWT of a widget rendered with the script API.
Guarded action
For a fresh single-use check, a form keeps the five-minute proof and siteverify. To reuse clearance, verify its cookie and apply your rule in the form handler instead. Clearance JWTs are not accepted by siteverify. Keep authentication, CSRF checks and action deduplication in your application. Configure the widget on the challenge widget page.What the token contains
Header:alg is EdDSA, typ is JWT, and kid is site_<id>/<version>.
When a ceremony ran:
device is the device the ceremony cleared: the desktop in a QR hand-off, otherwise the phone. Its identity hashes are in the challenge scope. Compare them only with other ceremony devices, never with probe.identity.
Your rule
Verify the signature,iss, aud, iat, exp and site key, then apply your own rule. This example accepts an uncontradicted probe without concealment, or a passed ceremony, and requires the live request to come from the measured address and network. It is this site’s rule, not a Heretic threshold.
Facts
The hosted page is the only placement that gates the first request. It adds a wait of a few seconds for each fresh probe; a ceremony takes longer. The page is distributed globally, and measurements currently run against the Warsaw sensor. A client that does not run the collector is never cleared. That includes search crawlers. What happens to an uncleared request is your rule. Findings and concealment indicators are not in the token. The visitor can read the token. Read them with your secret key atGET /v1/verdict/{request_id}.
Dashboard settings
On the site’s panel in the dashboard:Verifiers
The server examples includenode/clearance.mjs, python/clearance.py, php/Clearance.php, and a Cloudflare Worker gate at examples/cloudflare-worker/clearance-gate.js.