# Security

> Security is the handful of things people skip: secret keys left in code, data with no access rules, forms bots can flood, and old code with known holes. Most fixes take minutes.

Web page: https://buildladder.com/concepts/security

## Do I need it?

**Do I need to worry about security for my product?** Yes, as soon as anyone can reach it. Two things matter most: secret keys stay out of your code, and access rules guard the data you save. Forms and old code come next.

- If your product uses secret API keys, like an AI or payments key: Keep them in your .env file and your host’s settings. Never put one in code a browser or phone downloads.
- If you save data that belongs to people: Turn on access rules for every table or collection before real data goes in. The Databases concept shows how to test them.
- If you have a sign-up, sign-in or contact form: Bots can fill it with fake accounts and spam. Add a captcha, and make sure your server checks every pass.
- If your site is plain pages with no forms, keys or saved data: There is less to protect. Run the check-up prompt on this page once before you put it online.

## What’s the fastest way to add it?

**What’s the fastest way to secure my product?** Paste the prompt below into your AI tool. It checks your keys, access rules, forms and dependencies, and changes nothing until you say yes.

- If it finds a secret key in your code or Git history: Replace that key first. The answer “I shared a secret key by mistake. What do I do now?” lists the steps for each service.

Prompt to copy:

```text
Give this product a security check-up. Use plain words, because I may never have coded before. Don’t change anything until I say yes, and never print the value of any key.

Check these, one at a time, and tell me what you find:
1. Secret keys: search the code and the saved Git history for anything that looks like a secret key. Show file names and commits only.
2. The .env file: confirm it exists and Git ignores it. Flag any secret key whose name starts with NEXT_PUBLIC_, VITE_ or EXPO_PUBLIC_, because those reach every visitor.
3. Access rules: if I use Supabase or Firebase, check that Row Level Security or Security Rules protect every table or collection.
4. Forms: list every sign-up, sign-in, password reset and contact form. Say which have a captcha, and whether my server checks each pass.
5. Costly actions: list anything a bot could repeat to run up my bill, like calling an AI service or sending email. Say whether each has a rate limit.
6. Dependencies: run npm audit and explain what it finds. Don’t run npm audit fix --force, because it can install breaking versions.
7. GitHub: tell me whether Dependabot security updates are turned on for this repository, and where to turn them on.

Then give me a short list of fixes, most urgent first. Ask me before you install anything, sign in to anything or do anything that costs money.
```

## Which one?

**reCAPTCHA, Turnstile or hCaptcha: which captcha should I use?** It depends on what your visitors should see and which sign-in service you use. A captcha is the one part of security with a tool to pick, and it only guards forms.

- If you use Clerk for sign-in: Clerk already challenges suspicious sign-ups in new apps. Your other forms still need a captcha.

- Google reCAPTCHA: Pick reCAPTCHA if you already use Google Cloud or Firebase, or you want a risk score for each visit. Steps: https://buildladder.com/tools/recaptcha.md
- Cloudflare Turnstile: Pick Turnstile if you want visitors to see no puzzles, with no monthly limit on the free plan. Steps: https://buildladder.com/tools/cloudflare-turnstile.md
- hCaptcha: Pick hCaptcha if you use Supabase sign-in and want a captcha that isn’t from Google or Cloudflare. Steps: https://buildladder.com/tools/hcaptcha.md

|  | Google reCAPTCHA | Cloudflare Turnstile | hCaptcha |
| --- | --- | --- | --- |
| What visitors see | Challenge keys show an “I’m not a robot” checkbox that can lead to picture puzzles. Score-based keys show nothing. | Usually nothing. In Managed mode, some visitors tick a box. It never shows picture puzzles. | On the free plan, every visitor gets a challenge, which can mean picking pictures. |
| Sign-in service it connects to | Firebase. Firebase App Check uses reCAPTCHA to protect Firebase services. | Supabase. You paste the secret key into Supabase, and Supabase checks each pass. | Supabase. You paste the secret into Supabase, and Supabase checks each pass. |
| Testing on your computer | Make a second key with localhost as its domain. Google advises keeping localhost off your live key. | Cloudflare’s test keys work on localhost and always pass or fail on purpose. | Real keys don’t work on localhost. Use hCaptcha’s test sitekey and secret. |
| How your server checks a pass | It asks Google Cloud to check the pass, using an API key and your Google Cloud project ID. | It sends the pass and your secret key to Cloudflare’s Siteverify API. | It sends the pass and your secret to hCaptcha’s siteverify endpoint. |

## Now or later?

**Should I add security now or after I put my product online?** Now, before you share the link. Only paid protection can wait.

- If you’re about to save your code to GitHub for the first time: Check that .env is in .gitignore first. A key saved in Git history is hard to take back.
- If your code is on GitHub: Turn on Dependabot security updates. It takes a minute and suggests fixes when a dependency has a known hole.
- If your product calls an AI service or sends email: Add a rate limit to those actions. A bot repeating one request can cost you real money.

## Free or paid?

**Are captchas and DDoS protection free?** Yes, to start. All three captchas have a free plan, and Vercel, Netlify and Cloudflare include DDoS protection.

- If you worry a flood of traffic will run up your bill: Set a spending limit where your host offers one.

|  | Google reCAPTCHA | Cloudflare Turnstile | hCaptcha |
| --- | --- | --- | --- |
| Free plan | 10,000 checks a month, across all your sites. | Unlimited checks, up to 20 widgets, 10 domains each. | The Basic plan is free. Every visitor gets a challenge. |
| When you outgrow free | $8 a month for 10,001 to 100,000 checks, then $1 per 1,000. You add a billing account. | Enterprise, priced by Cloudflare’s sales team. | Pro is $99 a month billed yearly, or $139 month to month, with 100,000 checks included. |

## What changes when you grow?

**What changes about security when my product grows?** More people means more bots, more data to protect, and more people with access to your accounts. The basics stay the same, but you check them more often.

- If you add a new table, collection or form: Give it access rules or a captcha before real people use it. Run the check-up prompt again.
- If a DDoS attack slows your site down: On Vercel, turn on Attack Mode, which is free on every plan and challenges every visitor for a while.
- If Dependabot keeps opening update requests: Merge the security ones first. If you ignore them for a long time, Dependabot pauses its updates.
- If someone joins or leaves your team: Invite people with their own accounts instead of sharing passwords. When someone leaves, make new keys for anything they could see.

## How does it work underneath?

**How do captchas and DDoS protection work underneath?** A captcha runs a quick check in the visitor’s browser and adds a one-time pass to the form. Your server sends that pass with a secret key to the captcha service, which says yes or no. DDoS protection sits in front of your site and drops floods.

- If your site has no server code: A page-only captcha is not enough. Your server, or a service that handles the form, must check each pass before accepting the action.
- If a pass is old or used twice: Turnstile passes expire after 5 minutes and work once. reCAPTCHA and hCaptcha passes also need fresh verification. Ask your AI tool to request a fresh pass for each send.
- If a rate limit kicks in: Your host counts requests from one visitor over a short time. Past the limit, it refuses them for a while, often with a 429 error.

## Sources

Updated 2026-11-10.

- [Turnstile widgets](https://developers.cloudflare.com/turnstile/concepts/widget/)
- [OpenAI: limits on each person’s use](https://developers.openai.com/api/docs/guides/rate-limits)
- [Wappalyzer: websites using reCAPTCHA](https://www.wappalyzer.com/technologies/security/recaptcha/)
- [Wappalyzer: websites using Cloudflare Turnstile](https://www.wappalyzer.com/technologies/security/cloudflare-turnstile/)
- [Wappalyzer: websites using hCaptcha](https://www.wappalyzer.com/technologies/security/hcaptcha/)
- [npm downloads: @marsidev/react-turnstile, last month](https://api.npmjs.org/downloads/point/last-month/@marsidev/react-turnstile)
- [npm downloads: @hcaptcha/react-hcaptcha, last month](https://api.npmjs.org/downloads/point/last-month/@hcaptcha/react-hcaptcha)
- [npm downloads: react-google-recaptcha, last month](https://api.npmjs.org/downloads/point/last-month/react-google-recaptcha)
- [Cloudflare Turnstile: get started](https://developers.cloudflare.com/turnstile/get-started/)
- [Cloudflare Turnstile: validate the token](https://developers.cloudflare.com/turnstile/get-started/server-side-validation/)
- [Cloudflare Turnstile plans](https://developers.cloudflare.com/turnstile/plans/)
- [Google reCAPTCHA: create keys](https://cloud.google.com/recaptcha/docs/create-key-website)
- [Google reCAPTCHA: tiers and prices](https://cloud.google.com/recaptcha/docs/compare-tiers)
- [hCaptcha developer guide](https://docs.hcaptcha.com/)
- [hCaptcha pricing](https://www.hcaptcha.com/pricing)
- [Supabase: enable CAPTCHA protection](https://supabase.com/docs/guides/auth/auth-captcha)
- [Clerk: bot protection](https://clerk.com/docs/guides/secure/bot-protection)
- [Firebase App Check with reCAPTCHA](https://firebase.google.com/docs/app-check/web/recaptcha-provider)
- [Cloudflare DDoS protection](https://developers.cloudflare.com/ddos-protection/about/)
- [Vercel DDoS mitigation](https://vercel.com/docs/vercel-firewall/ddos-mitigation)
- [Vercel WAF rate limiting](https://vercel.com/docs/vercel-firewall/vercel-waf/rate-limiting)
- [Netlify: secure access to sites](https://docs.netlify.com/manage/security/secure-access-to-sites/overview/)
- [Netlify rate limiting](https://docs.netlify.com/manage/security/secure-access-to-sites/rate-limiting/)
- [Cloudflare rate limiting rules](https://developers.cloudflare.com/waf/rate-limiting-rules/)
- [GitHub: Dependabot security updates](https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates)
- [npm audit](https://docs.npmjs.com/cli/v11/commands/npm-audit)
