Troubleshooting and FAQ

Symptoms, causes and fixes for the widget, siteverify and the gateway, with the error codes you will see and answers to common questions.

Start with the error code: the SDK rejects with err.code, siteverify answers error, and the gateway sets X-AgentGate-Reason. Every code is on Error codes; the common ones are below.

Widget and SDK

SymptomCodeLikely causeFix
Nothing happens, console shows AgentGate is not definedthe script did not loadcheck the src URL and CSP script-src
Verification fails at onceorigin_deniedthe page's origin is not allowed for the site keyadd the exact origin (scheme, host, port) to the site; use testing keys on localhost
Verification fails at oncesite_invalidwrong or missing site keycopy the key from the console
Verification fails at onceaction_invalidthe action is not configured for the siteadd the action to the site, or fix data-action
Verification failsnetworkoffline, DNS, TLS, or CSP connect-src blocks the endpointallow the endpoint in connect-src (CSP)
People are asked for the check more than expectedinit() is not called at page load (agentgate:sdk:late_init), the instrumentation script is blocked by CSP, or rules are strictcall AgentGate.init() early; allow the endpoint in script-src; review the decisions in monitor mode
The check dialog never closescanceled after Escapethe person closed itoffer a retry
Verification stops after a whiletimeoutslow network or a long visible checkraise timeout or checkTimeout
Frequent failures from one networkrate_limitedmore than 60 challenges or 120 verifications per minute from one addresswait for Retry-After (60 s); the per-address limits are fixed
Automated tests fail or see the checkchallenge_failedbrowser automation is detected, as designeduse site_test_always_pass in tests (Testing)

Server-side validation

SymptomCodeLikely causeFix
Every call failsinvalid_credential (401)wrong, revoked or another site's secret, or Authorization without Bearer check AGENTGATE_SECRET; create a new secret if lost
Every call failsinvalid_request (400)form-encoded body, missing expectedAction, or a bad requestIdsend JSON with token and expectedAction
Tokens rejectedinvalid_token (422)not a token (empty field, truncated), another AgentGate's token, or a test token with a real secretcheck the field name agentgate_token; do not mix test and real keys
Tokens rejectedexpired_token (422)redeemed more than two minutes after issueverify at submit time; redeem promptly
Tokens rejectedaction_mismatch (422)expectedAction differs from the widget's data-actionuse the same action name on both sides
Tokens rejectedorigin_mismatch (422)expectedOrigin differs from the page origin (www, port, http/https)compare with origin in a successful answer
Second submit failstoken_used (409)the token was redeemed already: a double submit, a retry without requestId, or a test with ags_test_token_spentsend requestId and retry with the same one; the widget verifies again for each submission
Occasional failuresunavailable (503)AgentGate's store was unavailableretry once with the same requestId after Retry-After

Gateway

SymptomReasonLikely causeFix
Every request is 403invalid_credentialthe secret in nginx or the middleware is wrongupdate the credential include and reload nginx
Every request is 403invalid_requestthe adapter does not send X-Original-* headersuse the tested configuration (nginx)
Browser routes answer 401receipt_requiredthe page did not send X-AgentGate-Tokensend the token as a header; form fields do not reach auth_request
Browser routes answer 401invalid_tokena test token, or a token for another siteuse a real site key on pages behind a real gateway
Clearance not acceptedorigin_mismatch, expired_clearancethe page and the protected route are on different origins, or the clearance expiredserve both from one origin; verify again
Clients get 503service_unavailableAgentGate unreachable, slow or failing (enforce mode fails closed)check GET /readyz on your AgentGate endpoint (503 while it cannot decide); enforce-mode sites fail closed by design, see When AgentGate fails
Clients get 429rate_limitedover GATEWAY_IP_PER_MINUTE or an agent quotaraise the budget or review the rule

FAQ

Is the widget enough on its own?

No. The widget produces a token; only /v1/siteverify (or the gateway) enforces anything. A request that reaches your backend without being validated is not protected.

Do I need a separate site for staging?

A site can list several origins, so staging can share the production site. A separate site in monitor mode keeps staging decisions out of your production dashboard. For CI, use the testing keys.

Why did a person get the check?

Open the decision in the dashboard (the decisionId is in the SDK result and the siteverify answer): it lists the labels and the rule that asked for the check. Common causes are sdk_late_init, a blocked instrumentation script, VPN or datacenter addresses, and browser extensions that automate the page.

Can people who cannot use a mouse pass the check?

Yes. Press and hold works with Space or Enter held on the focused button, and "Verify another way" needs no pointer, timing or puzzle: the browser does extra work during a ten-second wait.

Does AgentGate work without JavaScript?

The browser check needs JavaScript. For clients without it (APIs, native apps, agents) use the gateway with machine routes and signed agents.

Does AgentGate set cookies?

The widget sets none. The agentgate_clearance cookie is set only for clearance actions when AgentGate's browser API is served from your own origin. The console uses a session cookie for signed-in customers.

What does AgentGate store about visitors?

Timings and counts, never what is typed; see the privacy notice.

How do I report a security issue?

See /.well-known/security.txt and the security testing policy.

View as Markdown