ADR-069: Jurisdiction-Pluggable Bot-Protection Seam (none default)

Status

Accepted (2026-08-29). Implements the 2026-08-16 steer decision on #1331.

Context

Cloudflare Turnstile entered the codebase as a silent config default inside the Phase-12 mega-commit (no ADR; provenance audit on #1331): verify_url defaulted to the vendor’s siteverify endpoint, vendor-branded contract tests and doc claims accreted around it — while the SHIPPED state never rendered a widget at all. Enabling the config bricked the public form outright (the backend demanded a captcha_token no form produced), the strict CSP would have blocked the vendor script anyway, and the verifier client followed redirects carrying the secret. Meanwhile the protections that actually ship — the honeypot field, the per-IP rate limit, input sanitization — carried the real load.

Bot protection is genuinely jurisdiction-shaped: some deployments will mandate a specific vendor, some prohibit third-party embeds on government forms, some will accept the honeypot + rate-limit posture. CRAIG cannot decide this for them, and a silent vendor default is the worst of every world (an undecided vendor presented as a NIST control; a latent foot-gun; Kerckhoffs-adjacent credential handling nobody reviewed).

Comparison (judgment-protocols; ≥3 alternatives)

Option For Against

Hosted vendor widgets (Turnstile / hCaptcha / reCAPTCHA)

Mature bot-detection signal; near-zero operational cost; the three mainstream vendors share one integration shape (script + container class
sitekey → token in a hidden input → server-side siteverify POST)

Third-party script on a government child-abuse reporting form (privacy
availability coupling); per-vendor terms; CSP loosening; anonymous-reporter fingerprinting concerns are jurisdiction-legal territory

Self-hosted verifier (e.g. ALTCHA-class PoW/behavioral, self-run)

No third-party data flow; same siteverify-shaped protocol; deployment owns the availability story

Operational burden CRAIG cannot absorb for every deployment; weaker signal than the hosted graph-backed products

A CRAIG-embedded PoW library

Zero external anything

CRAIG becomes the maintainer of an anti-bot arms race far outside a CCWIS’s mandate; PoW alone is a weak gate against real farm abuse

None (honeypot + per-IP rate limit + sanitization, which always ship)

Zero friction for legitimate — often distressed — reporters; zero third-party exposure; the shipped state for every deployment to date

Weakest automated-abuse posture; unacceptable to some jurisdictions

Decision: none of these is CRAIG’s to make. Every option above is the same INTEGRATION once the vendor branding is stripped: a widget mount + a siteverify-shaped remote check, or nothing. So CRAIG ships the seam.

Decision — the seam contract

Two postures, CRAIG_INTAKEBOT_PROTECTIONMODE:

  • none (first-class AND the default). No token demanded, no widget markup rendered, no verifier client built (no egress possible), the strict CSP ships byte-unchanged. Honeypot + rate limiting + sanitization remain.

  • remote_verify. The deployment supplies ALL of: verify_url (HTTPS), secret (via the ADR-064 store — never inline), sitekey, widget_script_src (HTTPS), widget_class, token_field. A PARTIAL config refuses the boot loudly — the pre-seam failure mode (silent vendor default + no widget = a form every submission of which 400s) is unrepresentable. Optional: expected_hostname (token↔site binding), csp_frame_src / csp_connect_src lists.

The TYPED provider contract (BotVerifier):

  • Protocol: POST secret + response (form-encoded) → JSON { success: bool, hostname?: string } — the de-facto siteverify shape every mainstream hosted vendor and self-hosted verifier serves.

  • Secret handling: SecretString (zeroize-on-drop, Debug-elided), exposed only at the HTTP-call boundary; config Debug logs the MODE only.

  • Egress hardening: a DEDICATED client (never the shared pool): redirects DENIED (the pre-seam client followed redirects with the secret), https_only(true), fixed 10 s timeout (#1160 fixed-bound precedent), response body size-checked against a 64 KiB bound before parsing (a chunked body without Content-Length is buffered within the 10 s timeout, then length-refused). The host allowlist is the verify_url itself — the client can address nothing else, and refusing redirects closes the only escape.

  • Outcome classes: token rejection (missing/empty/refused/hostname mismatch) → the client’s typed 400 (captcha-failed problem type, retained for wire stability); verifier OUTAGE (transport, non-2xx, oversized, unparseable) → 503 retryable — a deployment’s verifier being down never blames the reporter, and fails CLOSED (no bypass).

  • Single-use/replay: token single-use is the VERIFIER’s contract (every siteverify implementation consumes tokens on first check); CRAIG forwards each token exactly once per submission attempt and treats a second use’s success: false as a rejection. CRAIG adds no token cache of its own.

Widget mount (vendor-neutral, config-driven): the report page renders <script defer src="{widget_script_src}"> + <div class="{widget_class}" data-sitekey="{sitekey}"> only under remote_verify; the vendor JS drops a token into the hidden input named token_field; report-form.js copies it into the wire captcha_token (the field name arrives via window.CRAIG_CONFIG.botTokenField, JSON-encoded server-side). The vestigial captchaSiteKey plumbing died.

CSP per posture (build_public_csp): the strict base (script-src 'self'; style-src 'self'; …) is EXTENDED, never replaced. remote_verify adds the widget script’s ORIGIN to script-src, and the deployment’s explicit csp_frame_src/csp_connect_src lists add those directives — every third-party origin is consciously recorded config (absent lists = the base’s default-src 'self' keeps governing).

Consequences

  • Pre-1.0 BREAKING config: CRAIG_INTAKE__CAPTCHA_SECRET / CAPTCHA_VERIFY_URL / CAPTCHA_SITE_KEY / REQUIRE_CAPTCHA are REMOVED (the vendor default dies; `require_captcha’s production-guard role is subsumed — the jurisdiction turns the seam on, and a partial config cannot boot).

  • The captcha_token wire field and the captcha-failed problem type keep their names (wire stability; the vocabulary is generic enough).

  • Vendor-branded doc claims corrected fleet-wide (security, NIST mapping — which presented the undecided vendor as a control — ATO readiness, configuration reference, quality-gates marker vocabulary, coverage matrix, roadmap); the vendor-live contract tests died with the vendor default, replaced by the seam-generic verifier battery against a local mock (success/rejection/outage classes, redirect refusal, body bound, hostname binding, https-only egress) + CSP construction pins + fail-loud config pins.

  • A jurisdiction adopting a hosted vendor documents its choice in ITS deployment config (and accepts the recorded CSP additions); CRAIG’s tree stays vendor-free.

Edit this page · latest