# Turn on bot protection > Add a Cloudflare Turnstile challenge to the Orchard sign-in pages and to password-protected apps. Source: https://docs.orchard.hackclub.com/operate/bot-protection/ Bot protection adds a Cloudflare Turnstile challenge to sign-in with an email code or a password, and to [password-protected apps](/deploy/protection/), so that scripts cannot request sign-in codes or guess passwords in bulk. Passkeys and single sign-on do not get a challenge. Turnstile checks the visitor in the background and usually does not ask them to solve a puzzle. Bot protection stays off until you set both keys. ## Prerequisites - The superadmin role. - A Turnstile widget in your Cloudflare account. The widget provides a site key and a secret key. ## Turn on bot protection 1. Go to **Instance admin** > **Configuration**. 2. In **Bot protection**, enter the **Site key** and the **Secret key**. 3. Keep **Challenge the sign-in pages** turned on. 4. (Optional) Turn on **Refuse sign-in when Cloudflare is unreachable**. 5. Select **Save**. > **Caution** > > After you save the keys, Orchard refuses a sign-in that cannot solve the challenge. Test the sign-in page in a private browser window before you sign out. | Setting | Default | Description | | ------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Challenge the sign-in pages** | On | Orchard ignores this setting until both keys are set. Turning it off removes the challenge from sign-in and from password-protected apps, and keeps the keys. | | **Refuse sign-in when Cloudflare is unreachable** | Off | When this is off, Orchard allows sign-ins without a challenge if it cannot reach Cloudflare, and logs the event. | ## Set keys with environment variables Each field has an environment variable. A value in the environment overrides the dashboard, and the field shows `Set by the environment`. | Field | Environment variable | | ------------------------------------------------- | ---------------------- | | **Site key** | `TURNSTILE_SITE_KEY` | | **Secret key** | `TURNSTILE_SECRET_KEY` | | **Challenge the sign-in pages** | `TURNSTILE_ENABLED` | | **Refuse sign-in when Cloudflare is unreachable** | `TURNSTILE_STRICT` | ## Recover from wrong keys If the keys are wrong, you cannot sign in to change them. To turn off the challenge, set `TURNSTILE_ENABLED` to `false` on the server. On an installer host, run the following command: ```sh sudo orchardctl env set TURNSTILE_ENABLED false --apply ``` On a Helm install, set the variable in your values file. ## Related resources - [Configuration](/operate/configuration/) - Set instance settings in the dashboard or with environment variables. - [Host commands](/operate/host-commands/) - Change environment variables on an installer host with `orchardctl`. - [Rate limits and client addresses](/operate/client-addresses/) - Make sign-in limits apply to each visitor.