Repository navigation
Turnstile
Cloudflare Turnstile is a free check that tells a person from a script, usually without the visitor noticing. HelpPuff uses it in two places once it is on:
- every new chat, so a script cannot start chats and use up your daily cap (Settings → Advanced);
- the dashboard's sign-in, so a script cannot keep trying passwords.
It is off by default, so you can try HelpPuff (and an AI agent can set it
up) without it. Turn it on before real visitors arrive: until then, only the
rate limits slow a script down. The dashboard's Home
page shows Before you go live until it is on, and helppuff doctor warns.
It takes about five minutes, and one part has to be done by you in the
Cloudflare dashboard: HelpPuff and AI agents work through wrangler login,
whose permissions do not include Turnstile (that is true for everyone, not
something about your account).
-
Open the Cloudflare dashboard, choose your account, and open Turnstile (search for it if you do not see it in the sidebar). Select Add widget.
-
Widget name: anything, for example
HelpPuff. -
Hostnames: every hostname the chat is on, and the dashboard's. The dashboard's Home page lists them under Before you go live, ready to copy. Typically:
- your site, with and without
www(example.com,www.example.com); - the Worker, which serves the dashboard and the preview page
(
knowtific-helppuff-<site>.<you>.workers.dev, or your custom domain).
A widget takes up to 10 hostnames.
- your site, with and without
-
Widget mode: Managed (recommended): most people see nothing or a single tick; only suspicious traffic is asked to click. Invisible never shows anything, at the cost of letting a little more through.
-
Pre-clearance: leave it off.
-
Create it, then copy the Site Key and the Secret Key.
In the project folder, with the two keys from step 1:
helppuff config set security.captcha '{"provider":"turnstile","siteKey":"<Site Key>","secret":{"env":"TURNSTILE_SECRET"}}'
helppuff secret set TURNSTILE_SECRET # paste the Secret Key when asked
helppuff deployOr edit helppuff.json by hand:
"security": {
"captcha": { "provider": "turnstile", "siteKey": "<Site Key>", "secret": { "env": "TURNSTILE_SECRET" } }
}The Site Key is public (the widget shows it to browsers). The Secret Key is
never written into helppuff.json: secret set keeps it in .env and as a
Worker secret. An AI agent can do this step: give it the Site Key, and paste
the Secret Key into helppuff secret set yourself.
-
helppuff doctorshows turnstile: pass, and the dashboard's Home page no longer shows Before you go live. - Open your site (or the preview page from
helppuff deploy) and start a chat: it works as before. - Sign out of the dashboard (your name at the bottom of the sidebar → Sign out) and back in: the sign-in form now shows the Turnstile check.
From now on scripted chats are refused, including helppuff chat and
helppuff ask (they answer captcha_failed). Test in the preview page, or on
your site.
-
Sign-in without Turnstile: Settings → Advanced → Turnstile on the
sign-in form, or
security.signIn.captcha: false. New chats are still checked. -
Trying the flow locally: Cloudflare's test keys
always pass: Site Key
1x00000000000000000000AAwith Secret Key1x0000000000000000000000000000000AA. Never use them on a public site. -
Turning it off: remove
captchafromsecurityinhelppuff.jsonand deploy.
| What you see | Why, and what to do |
|---|---|
| Every new chat fails with "We could not verify that you are human" | The page's hostname is not on the widget. Add it in Cloudflare (step 1.3); it applies within a minute |
| The dashboard sign-in says "Turnstile did not load" | Something blocks challenges.cloudflare.com (an ad blocker, a network filter). Allow it, or sign in with a one-time link |
| Locked out of the dashboard |
npx @knowtific/helppuff dashboard in the project folder makes a one-time sign-in link, which does not need Turnstile |
helppuff chat answers captcha_failed
|
Expected once Turnstile is on: scripts are what it stops. Test in the preview page |
See Security for what Turnstile does and does not stop.
Start
Tutorials
- All tutorials
- Order tracking
- Send chats to your CRM
- Nearest store
- Verified account changes
- Logged-in customer support
- Product and stock
- Hot leads to Slack
- Knowledge base or tool?
- Testing and monitoring
- Why the AI never books
Configure
- Configuration
- Configuration reference
- CLI reference
- Knowledge base
- Prompt and instructions
- Tools: your APIs in the chat
- Agent files: import and export
- Signed-in visitors
- The widget
- The playground
- Leads and callbacks
- Jobs
- Photos and files
- Bookings and the calendar
- Integrations
- Live chat
- Telegram
- Webhooks
- Email notifications
API
API reference
- Overview
- Account
- Chat
- Conversations
- Live chat
- Labels and notes
- Leads
- Callbacks
- Jobs
- Appointments
- Integrations
- Knowledge
- Prompt
- Tools
- Settings
- Webhooks
- Analytics
- Team
- API keys
- Audit
Providers
- Overview
- Models and providers
- Custom model
- Custom knowledge base
- Workers AI (default)
- AI models: speed, quality, cost
- Cloudflare AI Search
- OpenAI
- Gemini
- Anthropic Claude
- Retell
- Your own API
Operate
- Deployment
- Turn on Turnstile
- Upgrading
- Costs and limits
- Cloudflare Free plan limits
- Security
- Troubleshooting
Build