API reference
Public API reference for site owners and server developers.
Status: final Fase 3, 20 November 2026. For the step-by-step embed walkthrough, see the embed guide.
Every claim in this document traces to PROTOCOL.md (chapter and section cited inline) or to the implementation in atlys-captcha (file cited inline). All URLs use the production origin https://captcha.atlys.ai.id. No other origin appears in this document.
Endpoint count
The v1 API has 5 core endpoints, 2 agent endpoints, and 7 endpoints that are documented here but return 404 until their feature launches. The table below is the full public surface. Routing below is verified against src/worker.ts.
| Group | Endpoints | Status in v1 |
|---|---|---|
| Core | POST /v1/challenges, POST /v1/challenges/solve, POST /v1/challenges/extend, POST /v1/verify, GET /v1/health | Live |
| Agent | POST /v1/agent-verify, GET /v1/agent-pubkey | Live |
| Pass tokens (Layer 5) | POST /v1/pass-tokens/issue, POST /v1/pass-tokens/redeem | 404, flag OFF (PASS_TOKENS_ENABLED, wrangler.toml) |
| Proof + magic link | POST /v1/proofs/verify, POST /v1/magic-links, GET /v1/magic-links/{token}, GET /v1/magic-links/{id}/status, POST /v1/magic-links/{id}/token | 404, excluded in v1 (V13 undecided) |
GET /widget/frame is the widget iframe route, not an API endpoint. The loader calls it. Embedders never call it directly (Ch. 6 §6.1).
1. Basics
Base URL: https://captcha.atlys.ai.id/v1 (Ch. 5 §5.1).
- Transport: HTTPS only. Plain HTTP is refused, with no redirect.
- Format: JSON for requests and responses. The only exception is the health endpoint (§5.4.5), which may return plain text.
- Challenges and tokens travel as opaque base64url strings from a binary length-prefixed serialization (Ch. 2 §2.2). Clients never decode them.
- Unknown JSON fields in a request are ignored and logged. A missing required field returns 400.
- Versioning: the API version sits in the path (
/v1). A breaking change requires a new version; an old version stays supported through an announced transition period. - Payload size limit: 64 KB target. A larger payload is refused with 400 before further processing. JSON nesting deeper than 10 levels is refused (Ch. 5 §5.8).
- The Atlys server calls no third-party captcha, attestation, or analytics service (T19). The only permitted external dependency is the public reputation feed (Ch. 1 §1.5.1).
Response envelope (Ch. 5 §5.2)
Every response uses the same JSON envelope. The data object in each endpoint section below sits inside this envelope.
Success:
{
"success": true,
"data": { "...": "..." },
"meta": { "timestamp": "2026-11-18T08:00:00Z" }
}
Error:
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "A clear, actionable explanation",
"details": null
},
"meta": { "timestamp": "2026-11-18T08:00:00Z" }
}
meta.timestamp is the server timestamp (ISO 8601, UTC). Clients must not use their own clock for expiry decisions. Error messages never leak internal details (stack traces, table names, key values, specific security reasons).
HTTP status codes (Ch. 5 §5.3)
| Code | Meaning | Used for |
|---|---|---|
| 200 OK | Request succeeded | Solve succeeded, verify succeeded, health OK |
| 201 Created | New entity created | New challenge issued |
| 400 Bad Request | Invalid payload | Malformed JSON, missing required field, wrong format |
| 401 Unauthorized | Authentication failed | Secret key missing or invalid (server-to-server endpoints) |
| 403 Forbidden | Authenticated but not entitled | Valid key without rights to that action or origin |
| 404 Not Found | Endpoint or entity not found | Challenge not found; Layer 5 endpoints before launch (§5.4.4) |
| 422 Unprocessable Entity | Verification failed | Token verification failure uses 422, not 200, because a 200 with success: false is easily misread as "pass" |
| 429 Too Many Requests | Rate limit exceeded | See §7 |
| 500 Internal Server Error | Server error | Never leaks a raw stack trace to the public |
| 503 Service Unavailable | Temporarily unavailable | Degradation or maintenance; clients back off and retry (except verify, see §3.4) |
2. Keys
(Ch. 5 §5.7.)
| Key | Prefix | Nature | Used at |
|---|---|---|---|
| Public key | atlys_pk_ | Public, may appear in HTML and client JavaScript | Widget; challenges and solve endpoints |
| Secret key | atlys_sk_ | Secret, server only | Verify endpoint |
| Agent key | atlys_ag_ | Secret, agent operator server only | Agent-verify endpoint (§4.1) |
Site keys are issued manually by the owner in v1. There is no public registration form and no self-service registration API (§5.7.1). At issuance the owner records the allowed origins for the site key and the value class of each protected action (low/medium/high/very high). An action without a classification counts as MEDIUM. The public key is not a secret: anyone can read atlys_pk_ in page source. Security rests on origin binding, action binding, and session binding enforced by the server (Ch. 2 §2.3), not on public key secrecy. A secret key in client code, HTML, or a public repository voids the verify guarantee.
Key rotation uses dual-key plus kid (key identifier). A new key ships with a new kid; the old key stays accepted through a transition period, then is revoked (§5.7).
3. Core endpoints
POST /v1/challenges: issue a challenge
(Ch. 5 §5.4.1, §5.11.) Called by the widget from the visitor's browser. Embedders normally never call this endpoint directly.
Authentication: public key (atlys_pk_).
Request:
{
"site_key": "atlys_pk_...",
"origin_token": "string-opaque",
"action": "login",
"session_binding": "string (base64url 128-bit)",
"atlys_session_id": "string | null",
"passive_hint": 42,
"client_capabilities": { "wasm": true }
}
client_capabilities is optional. It is an unverified hint the server uses only to pick the starting difficulty table. passive_hint is an optional, untrusted passive score.
Response (201, data):
{
"challenge": "string-opaque",
"challenge_type": "pow",
"difficulty_bits": 10,
"expires_in": 120,
"atlys_session_id": "string",
"pow": {
"salt": "string (base64url)",
"challenge_nonce": "string (base64url 128-bit)",
"difficulty_bits": 10,
"expires_in": 120,
"hash_function": "hashwx"
}
}
The pow field appears only for PoW challenges. It carries server-decoded parameters so the widget can compute without decoding the opaque string itself. hash_function is one of argon2id, hashwx, or sha256, pinned by the server; sha256 means the fallback path (§3.7). challenge_type is pow or interactive.
Notes: challenge issuance writes nothing to D1 (Ch. 2 §2.1), so a challenge flood does not consume write quota. The server reads a signed origin_unverified flag from the origin token on every challenge request; when true, the minimum friction level for the issued challenge is level 2 (medium PoW), enforced at issuance.
POST /v1/challenges/solve: submit completion proof
(Ch. 5 §5.4.2, §5.11.) Called by the widget. Embedders normally never call this endpoint directly.
Authentication: public key (atlys_pk_).
Request (PoW):
{
"site_key": "atlys_pk_...",
"challenge": "string-opaque",
"proof": { "type": "pow", "nonces": ["0", "0", "0", "0"] }
}
Submit the original challenge exactly as received, without rebuilding it. PoW nonces are unsigned 64-bit integers carried as JSON decimal strings, not JSON numbers (JSON numbers lose precision above 2^53). A nonce outside the u64 range, or one sent as a JSON number, returns 400 VALIDATION_ERROR. For interactive challenges:
{ "type": "interactive", "answer": "...", "trajectory_hint": { "mean_speed": 0, "corrections": 0, "variance": 0, "duration_ms": 0 } }
Response (200, data), verified:
{ "status": "verified", "token": "string-opaque", "expires_in": 120 }
Response (200, data), escalated: a new challenge in the same shape as the challenge response in §3.1 (opaque challenge, challenge_type, difficulty_bits, expires_in, echoed atlys_session_id, plus a server-decoded pow field for PoW escalation). An escalation response carries no reason field: the difficulty is visible, but the reason that raised it is never disclosed. The widget shows a generic message ("next challenge") without a server reason.
Atomicity: claiming the challenge nonce and issuing the token happen in one atomic insert. Two simultaneous solves of the same challenge produce one token; the other fails with CHALLENGE_ALREADY_SOLVED (422).
POST /v1/challenges/extend: extend a challenge
(Ch. 5 §5.4.8, §5.11.) Called by the widget.
Authentication: public key (atlys_pk_).
Request: { "site_key": "atlys_pk_...", "challenge": "string-opaque" }. Submit the original challenge exactly as received.
Response (200, data):
{ "challenge": "string-opaque", "expires_in": 240, "extensions": 1 }
The server reissues the same challenge with expires extended by 120 seconds and extensions raised by 1, with a fresh signature. The maximum is 2 extensions; a third is refused with EXTENSION_LIMIT_REACHED (422). A challenge that already expired is refused with CHALLENGE_EXPIRED (422) and cannot be revived. The old challenge stays valid until its own expiry. Extension is stateless (no D1 write), like challenge issuance, and counts as a challenge request for rate limiting (§7).
POST /v1/verify: verify a token (server-to-server)
(Ch. 5 §5.4.3, §5.11.) This is the endpoint embedders call. Call it from your server only, never from the browser.
Authentication: secret key (atlys_sk_) in the header Authorization: Bearer <key>.
Request (every field required; a missing field means failure):
{
"token": "string-opaque",
"action": "login",
"session_binding": "string (base64url 128-bit)",
"origin": "https://your-site.example"
}
Send session_binding from your own server session store, not from the client. Send origin from your own server configuration.
Response (200, data):
{ "valid": true, "via": "standard", "action": "login" }
A 200 means pass: all checks in Ch. 2 §2.5.1 succeeded, and the token nonce is atomically marked used. via names the completion path (standard / magic-link / pass-token) so you can enforce action value limits (§4.8.1). action echoes the action bound to the token; check that it matches the action you are processing.
Response (422): the §1 error envelope with code TOKEN_VERIFICATION_FAILED. The specific reason is never disclosed in the public response (server logs only). The three token codes (TOKEN_INVALID, TOKEN_EXPIRED, TOKEN_REUSED) are masked into this one public code (§5.2).
Grace window: a successful verify result is kept for 30 seconds (keyed by nonce + site key + action). A re-verify inside that window with the same nonce/site key/action returns the same success result. Outside the window, TOKEN_REUSED applies. Retry verify only inside this grace window and only for timeouts/5xx, never for 422 (422 means the token is genuinely invalid).
Embedder contract, 5 conditions (§5.4.3): call verify from the server, not the browser; keep the secret key off the client; check the result explicitly (200 means pass, anything else means fail); route every path to the protected action through one central gate; retry only inside the grace window and only for timeouts/5xx.
GET /v1/health: service health
(Ch. 5 §5.4.5.) Public endpoint, no authentication.
Response (200): service status plus the server timestamp. The response carries no deployment version, no key status, no traffic statistics, and no internal details. Use it for monitoring (Ch. 9 §9.8) and to check availability before calling verify.
Response (503): the worker is alive but D1 is unreachable (code VERIFICATION_UNAVAILABLE). Monitoring can tell that case apart from a dead worker, which does not respond at all. Rate limit: 60 requests/hour per IP.
curl https://captcha.atlys.ai.id/v1/health
4. Agent endpoints
POST /v1/agent-verify: honest AI agent path
(Ch. 5 §5.4.7, §5.11.) Registered agents verify their actions without a captcha, inside a strict rate limit. Status: live in v1.
Authentication: agent key (atlys_ag_) in the header Authorization: Bearer <key>. A User-Agent claim plus reverse DNS, without a valid API key, is refused. rDNS alone is never enough.
Request:
{ "action": "crawl", "request_id": "..." }
request_id is the agent's idempotency identifier for one request of its action. The embedder uses the same value to match the allow-token (below).
Response (200, data):
{ "allow": true, "quota_remaining": 97, "allow_token": "string-opaque" }
When allow is false, no allow_token is returned. The allow-token is an Ed25519 token signed by the Atlys operator. Its wire format is base64url(payload).base64url(signature-64-byte), where the payload is the canonical serialization (§2.2.1 rule 9) of (atlys-allow-v1, agent_key_id, key_id, site_key, action, request_id, expires, nonce). expires is 5 minutes. The embedder verifies: the signature against the public key whose key_id matches (from §4.2); expires has not passed; site_key and action match the request being processed; and request_id matches the request_id of the request being processed. That last check is the replay protection: one allow-token is valid for one request_id only. A claim of allow without a valid allow-token is refused. The nonce only makes the signature unique; it is not a replay control and its uniqueness is never checked.
Quota: 100 requests/day per agent by default (§5.6). Exceeding it returns AGENT_RATE_LIMITED (429). Abuse leads to key revocation (Ch. 11 §11.9). Without a valid agent key, an agent faces the full captcha like any other traffic.
GET /v1/agent-pubkey: agent signing public keys
(Ch. 5 §5.4.7, §5.11.) Public endpoint, no authentication. Embedders fetch this to verify allow-tokens locally.
Response (200, data):
{
"keys": [
{ "key_id": "...", "public_key": "string (base64, Ed25519)",
"algorithm": "Ed25519", "status": "current" }
],
"algorithm": "Ed25519"
}
The response is always an array, including outside rotation (then it holds one key). Cache-Control: public, max-age=3600 (1 hour). During the 1-hour rotation overlap the old key keeps signing, so an embedder with a stale cache never receives a token signed by a key it does not know yet. Embedders must refresh the public key when verification fails (fetch again, try once more) before refusing. Rate limit: 60 requests/hour per IP.
5. Endpoints not yet launched (404)
These endpoints are fully specified and documented here so integrators can plan, but every one of them returns 404 in v1. Do not build against them yet. Routing verified in src/worker.ts: pass-token routes return 404 while PASS_TOKENS_ENABLED is not "true"; magic link and proof routes return 404 explicitly.
POST /v1/pass-tokens/issue and POST /v1/pass-tokens/redeem
(Ch. 5 §5.4.4, §5.11.) Layer 5 pass tokens, post-launch (Ch. 12 §12.2). Until Layer 5 launches, both endpoints return 404, not 501 and not an empty response.
Issue: called by the widget after a full interactive challenge is solved. Request: { "token": "string-opaque" } (the standard token just issued from the interactive challenge). Response (200, data): { "pass_tokens": ["string-opaque", ...], "count": 5, "expires_in": 259200 }. Five pass tokens, HMAC with a separate key, valid 72 hours. This is not blind-RSA RFC 9578; RFC 9578 is the target design, not the v1 implementation. The server issues only when the token carries challenge_type: interactive and via: standard. PoW tokens, magic link tokens, and redeemed tokens are refused with PASS_TOKEN_NOT_ELIGIBLE (422). The standard token is not consumed by /issue: the endpoint only reads and verifies it. One standard token issues pass tokens once; a second /issue on the same token is refused with PASS_TOKEN_ALREADY_ISSUED (422).
Redeem: swaps one pass token for one verification token, with atomic anti-double-spend enforcement in D1. Request: { "pass_token": "string-opaque", "action": "login", "session_binding": "string (base64url 128-bit)", "origin": "https://your-site.example" }. Response (200, data): { "token": "string-opaque", "expires_in": 120 }. The redeemed token carries via: pass-token, challenge_type: pow, and challenge_nonce: redeem:<redeem_id>. A redeemed token cannot issue pass tokens.
POST /v1/proofs/verify
(Ch. 5 §5.4.6, §5.11.) Verifies a PoW proof without issuing a token. Request: { "site_key": "atlys_pk_...", "challenge": "string-opaque", "proof": { "type": "pow", "nonces": ["0", "0", "0", "0"] } } (nonce as decimal string, as in §3.2). Response (200, data): { "proof_receipt": "string-opaque", "expires_in": 60 }. The receipt is an HMAC receipt (atlys-proof-v1), valid 60 seconds, single-use, bound to challenge_nonce + session_binding. The challenge nonce is not consumed, but one challenge issues at most one receipt; a second request for the same challenge is refused with PROOF_RECEIPT_ALREADY_ISSUED (422). A bad proof returns PROOF_INVALID (422).
Magic link endpoints
(Ch. 5 §5.4.6, §5.11.) Fully designed (Ch. 4 §4.8.1); launch waits on the email delivery provider decision (V13). All five return 404 until launch.
POST /v1/magic-links: request a magic link. Request:{ "site_key": "atlys_pk_...", "email": "[email protected]", "proof_receipt": "string-opaque" }. The proof receipt from §5.2 is required (anti email-bombing); a raw challenge is not accepted. Response (202,data):{ "id": "ml_...", "status": "pending" }.GET /v1/magic-links/{token}: the link clicked from the email, opened in any browser. The server verifies the HMAC tag, the 15-minute expiry, and single use, then marks the origin challenge "inbox-verified" and shows a confirmation page. It does not issue a token to this browser.GET /v1/magic-links/{id}/status: polled by the origin widget (adaptive: every 5 seconds for the first 60 seconds, then every 15 seconds; 15 minutes maximum, about 68 polls per flow). Read-only, no D1 write. Response (200,data):{ "id": "ml_...", "status": "pending|verified|expired|invalid" }. It never returns a token.POST /v1/magic-links/{id}/token: called by the origin widget after statusverified. Request:{ "site_key": "atlys_pk_...", "session_binding": "string (base64url 128-bit)" }. Response (200,data):{ "token": "string-opaque", "expires_in": 120, "via": "magic-link" }. A second issuance for the same record is refused withMAGIC_LINK_TOKEN_ALREADY_ISSUED(422).
Rate limits for magic links: 3/day per email address, 3/day per session, 100/day global (§7).
6. Error codes
(Ch. 5 §5.5.) The spec table holds 22 codes. That count comes from counting the table rows directly, and the §5.5 text confirms it ("This table contains 22 error codes"). The old figure of 21 was wrong (P12 correction, 19 November 2026).
| Code | Meaning | HTTP | Where it appears |
|---|---|---|---|
VALIDATION_ERROR | Invalid payload (format, missing field, out-of-range value) | 400 | All endpoints |
AUTHENTICATION_ERROR | Key missing or invalid | 401 | Server-to-server endpoints |
AUTHORIZATION_ERROR | Valid key but not entitled to this action/origin | 403 | Server-to-server endpoints |
NOT_FOUND | Challenge/endpoint not found | 404 | All endpoints; also the response of not-yet-launched endpoints (§5) |
CHALLENGE_EXPIRED | Challenge already expired (server clock) | 422 | Solve, extend |
CHALLENGE_FAILED | Wrong completion proof | 422 | Solve |
CHALLENGE_ALREADY_SOLVED | Challenge already used to issue a token | 422 | Solve |
TOKEN_VERIFICATION_FAILED | Token invalid / expired / already used. One public code for all three (masking decided; distinguished only in server logs) | 422 | Verify |
MAGIC_LINK_INVALID | Magic link invalid / expired / already used | 422 | Magic link endpoints (§5.3, not launched) |
MAGIC_LINK_RATE_LIMITED | Magic link send limit exceeded (per address / per session / global) | 429 | Magic link endpoints (§5.3, not launched) |
PROOF_INVALID | PoW proof for POST /v1/proofs/verify invalid (challenge HMAC failed or wrong hash proof) | 422 | Proofs verify (§5.2, not launched) |
RECEIPT_INVALID | Proof receipt invalid / expired / already consumed | 422 | Magic link request (§5.3, not launched) |
EXTENSION_LIMIT_REACHED | Challenge already extended 2x (maximum, Ch. 4 §4.8.2) | 422 | Extend |
PASS_TOKEN_NOT_ELIGIBLE | Standard token not from a full interactive challenge (challenge_type is not interactive), cannot issue pass tokens | 422 | Pass-token issue (§5.1, not launched) |
PASS_TOKEN_ALREADY_ISSUED | Standard token already issued pass tokens | 422 | Pass-token issue (§5.1, not launched) |
MAGIC_LINK_TOKEN_ALREADY_ISSUED | Token already issued for this magic link record | 422 | Magic link token (§5.3, not launched) |
PROOF_RECEIPT_ALREADY_ISSUED | Proof receipt already issued for this challenge | 422 | Proofs verify (§5.2, not launched) |
AGENT_NOT_REGISTERED | Agent key unknown / revoked | 401 | Agent-verify |
AGENT_RATE_LIMITED | Agent daily quota exceeded | 429 | Agent-verify |
ATTEMPT_LIMIT_EXCEEDED | Attempt limit exceeded (3/challenge, 5/session) | 429 | Challenge flow |
RATE_LIMITED | Rate limit exceeded | 429 | All endpoints |
VERIFICATION_UNAVAILABLE | Verification component unreachable (fail-closed) | 503 | Verify, health |
The codes TOKEN_INVALID, TOKEN_EXPIRED, and TOKEN_REUSED exist only in server logs for audit. Public responses always use TOKEN_VERIFICATION_FAILED (§5.2, masking decided).
7. Rate limits
(Ch. 5 §5.6.1b, DEFAULT values.) The per-site-key limit for the challenge group is 200/hour. An older figure of 400/hour was lowered (F2-22/D8) and no longer applies. The 200/hour value is confirmed in code (src/lib/rate-limit.ts).
| Endpoint | Per session | Per site key | Per IP | Global |
|---|---|---|---|---|
| POST /v1/challenges | 30/hour | 200/hour | 300/hour | n/a |
| POST /v1/challenges/solve | 30/hour | 200/hour | 300/hour | n/a |
| POST /v1/challenges/extend | 30/hour | 200/hour | 300/hour | n/a |
| POST /v1/proofs/verify | 30/hour | 200/hour | 300/hour | n/a |
| POST /v1/verify | n/a | 2,000/hour | 1,000/hour (embedder server) | n/a |
| GET /v1/health | n/a | n/a | 60/hour | n/a |
| GET /widget/frame (iframe navigation) | n/a | n/a | Edge rule §5.6.1d only | n/a |
| POST /v1/magic-links | 3/day | 100/day | 30/day | 100/day |
| POST /v1/magic-links/{id}/token | 3/day | 100/day | 30/day | 100/day |
| GET /v1/magic-links/{id}/status | 250/day | 10,000/day | 1,000/day | n/a |
| GET /v1/magic-links/{token} | n/a | n/a | 30/day | n/a |
| GET /v1/agent-pubkey | n/a | n/a | 60/hour | n/a |
| POST /v1/agent-verify | n/a | n/a | n/a | 100/day per agent |
| All endpoints (emergency) | n/a | n/a | n/a | 80,000/day (80% of the Workers quota) |
Calibration notes from the spec: the per-session limit (30/hour) sits far above human behaviour (under 10 challenges/hour) and above the session attempt limit (5 challenges/session). The per-site-key limit (200/hour, about 4,800/day) approaches the capacity ceiling (about 4,600-5,000/day, Ch. 9 §9.4): at the worst-case end of the ceiling, one site at the full cap CAN consume the ceiling alone — accepted in v1 owner-only (the sites are the owner's own; a recalibrated per-site-key daily quota is a pre-public-launch action), while staying well above the default volume (about 1,000/day). The per-IP limit (300/hour) stays loose for CGNAT, where one IP can sit in front of thousands of users. When the global cap is reached, challenge issuance is held back first and verify is prioritized (Ch. 9 §9.9.2). The iframe navigation route has no in-worker counter; its quota protection is the edge threshold of 100 requests per 10 seconds per IP (§5.6.1d).
Attempt limits are separate from rate limits: 3 attempts per challenge, 5 per session. After the session limit is hit the session locks for 15 minutes (DEFAULT K1).
429 responses and backoff (§5.6.3)
A 429 response carries a Retry-After header (seconds until the client may try again). Clients must use exponential backoff with jitter after a 429: wait 2 seconds, then 4 seconds, then 8 seconds, plus a random delay. Retrying without backoff worsens server load and can trigger a higher rate limit layer. Exception: verify is retried only inside the 30-second grace window and only for timeouts/5xx (§3.4). Backoff applies to challenges and solve, and to verify retries inside the grace window.
8. Lifetimes
All lifetimes run on the server clock. Token storage for replay detection (15 minutes or less, T15) is a separate number from the 2-minute use window: a token cannot be used after 2 minutes.
| Item | Lifetime | Source |
|---|---|---|
| Verification token | 2 minutes (120 seconds) | T13; TOKEN_TTL_SECONDS = 120 in src/lib/tokens.ts |
| Challenge, levels 1-3 | 120 seconds | Ch. 2 §2.2.2 |
| Challenge, level 4 | 300 seconds | Ch. 2 §2.2.2 |
| Challenge extension | +120 seconds per extension, maximum 2 | Ch. 5 §5.4.8 |
| Origin token | 60 seconds | Ch. 2 §2.3.2 |
| Proof receipt | 60 seconds | Ch. 5 §5.4.6 |
| Magic link | 15 minutes | Ch. 4 §4.8.1 |
| Pass token | 72 hours | Ch. 5 §5.4.4; PASS_TOKEN_TTL_SECONDS in src/lib/pass-tokens.ts |
| Agent allow-token | 5 minutes | Ch. 5 §5.4.7 |
| Verify grace window | 30 seconds | Ch. 5 §5.4.3 |
| Session lock after attempt limit | 15 minutes | K1; Ch. 6 §6.3 |
9. Honest limits
(Ch. 5 §5.10, Ch. 1 §1.4.) The API cannot force a careless integrator to follow the contract. An integrator who skips verify, or reads a 200 status as "pass" without checking the body, stays vulnerable. No captcha fully stops human farms, C++-level stealth browsers, PoW relay, or interactive relay. The service raises attacker cost above the value of the protected action.
10. Traceability index
| Document section | Spec source | Code source |
|---|---|---|
| §1 Basics, envelope, status codes | Ch. 5 §5.1, §5.2, §5.3 | n/a |
| §2 Keys | Ch. 5 §5.7, §5.7.1 | n/a |
| §3.1 Challenges | Ch. 5 §5.4.1, §5.11 | src/worker.ts (POST /v1/challenges) |
| §3.2 Solve | Ch. 5 §5.4.2, §5.11 | src/worker.ts (POST /v1/challenges/solve) |
| §3.3 Extend | Ch. 5 §5.4.8, §5.11 | src/worker.ts (POST /v1/challenges/extend) |
| §3.4 Verify | Ch. 5 §5.4.3, §5.11 | src/worker.ts (POST /v1/verify); src/lib/tokens.ts (TOKEN_TTL_SECONDS = 120) |
| §3.5 Health | Ch. 5 §5.4.5 | src/worker.ts (GET /v1/health) |
| §4.1 Agent-verify | Ch. 5 §5.4.7, §5.11 | src/worker.ts (POST /v1/agent-verify) |
| §4.2 Agent-pubkey | Ch. 5 §5.4.7, §5.11 | src/worker.ts (GET /v1/agent-pubkey) |
| §5.1 Pass tokens | Ch. 5 §5.4.4, §5.11 | src/worker.ts (404 while flag OFF); src/lib/pass-tokens.ts |
| §5.2 Proofs verify | Ch. 5 §5.4.6, §5.11 | src/worker.ts (explicit 404) |
| §5.3 Magic links | Ch. 5 §5.4.6, §5.11 | src/worker.ts (explicit 404) |
| §6 Error codes (22) | Ch. 5 §5.5 (row count verified) | src/lib/pass-tokens.ts (TOKEN_VERIFICATION_FAILED) |
| §7 Rate limits | Ch. 5 §5.6.1b, §5.6.3 | src/lib/rate-limit.ts (200/hour per site key) |
| §8 Lifetimes | Ch. 2 §2.2.2, §2.3.2; Ch. 4 §4.8.1, §4.8.2; Ch. 5 §5.4.3-§5.4.7 | src/lib/tokens.ts; src/lib/pass-tokens.ts |
| Loader URL, widget sizes, JS API | Ch. 6 §6.1, §6.2, §6.4.1 | src/loader/loader.ts; src/loader/types.ts; public/widget/v1/widget.js; wrangler.toml |