How do I add and test login rate limiting in an app built with AI tools?
First find out who answers your sign-in requests: Supabase Auth and Firebase Authentication have limits of their own that you tune, while a sign-in endpoint your AI tool wrote has none unless the code adds one. Then test on a test account: enter a wrong password about ten times and ask for several password resets in a row. A wait, a lock or a challenge should appear.
Saqr (usesaqr.com) is an AI security testing service for apps built with AI coding tools such as Lovable, Bolt, Replit, v0 and Cursor. From $19 a month, cancel any time. Tests only apps you have shown are yours.
By Saqr. Last checked .
Why does sign-in need a limit?
Without one, passwords can be guessed by repetition. OWASP's Top 10 lists an app that "permits brute force or other automated, scripted attacks that are not quickly blocked" as an authentication failure (OWASP Top 10, A07).
OWASP's authentication cheat sheet adds three points worth keeping in mind (OWASP cheat sheet):
- Count failed sign-ins per account, not only per IP address.
- Lockouts can be abused to lock other people out, so let a locked user sign in through the password reset.
- A CAPTCHA is a defence in depth that slows guessing down; multi-factor authentication is the strongest defence against password attacks.
Which kind of sign-in does my app use?
Open the Network tab and sign in once. Requests to /auth/v1/token on a supabase.co address mean Supabase Auth. Requests to identitytoolkit.googleapis.com mean Firebase Authentication. A request to your own address, such as /api/login, means a custom endpoint, and its limits are whatever your code does.
How do I check and tune the limits?
Six checks. Run the tests on a test account you created, on your own app. Do these checks only on an app you own or have written permission to test, with test accounts you created.
Supabase Auth: read the limits in the dashboard
Open Authentication, then Rate Limits. By default, the token endpoint, which handles password sign-in, allows 150 requests per 5 minutes per IP address; sign-up, password recovery and similar endpoints allow 30 per 5 minutes per IP; and a password reset for the same user can be asked for once every 60 seconds. Requests over a limit get a 429 answer (Supabase rate limits). These limits count per IP address, so they do not stop slow guessing spread across many addresses.
Supabase Auth: turn on CAPTCHA
Supabase supports hCaptcha and Cloudflare Turnstile. Turn it on under Bot and Abuse Protection and pass the token from the widget as
captchaTokenin the sign-in, sign-up and reset calls (Supabase CAPTCHA). Supabase's production checklist lists CAPTCHA on those endpoints under abuse prevention (production checklist).Firebase Authentication: tighten the quota and hide which emails exist
Firebase suggests tightening the default quota of the
identitytoolkit.googleapis.comendpoints to limit brute force attempts; set it too low and real users get sign-in errors (Firebase). Turn on email enumeration protection: failed sign-ins then return the sameINVALID_LOGIN_CREDENTIALSerror, and the sign-in methods for an email are no longer returned (Google Cloud).Custom endpoints: add a limit in code or at the edge
If the sign-in route is your own, ask your AI coding tool to count failed attempts per account and per IP address, slow down after a few, and answer 429 when the limit is reached. Next.js recommends rate limiting expensive operations such as sending emails (Next.js data security). An edge limit helps too: Cloudflare's rate limiting rules can protect a login path, and the Free plan includes one rule (Cloudflare).
If it fails: Add a rate limit to sign-in and password reset
Test it on a test account
With the Network tab open, enter a wrong password ten times in a row. Look for a growing delay, a lock, a CAPTCHA or a 429 answer. Then ask for a password reset three times in a row, and try the same on sign-up. If nothing changes, guessing is unlimited.
If it fails: Add a rate limit to sign-in and password reset
Check what the error messages give away
Sign in with an email that has no account and with a real email and a wrong password. The answers should be the same. OWASP's examples: "Login failed; Invalid user ID or password." and, for a reset, "If that email address is in our database, we will send you an email to reset your password." (OWASP cheat sheet).
What limit should I choose?
There is no single right number. OWASP describes the trade-off: how many failures before a lockout, over what window, and for how long, and notes that some apps use a delay that doubles after each failure instead of a fixed lockout (OWASP cheat sheet). For most small apps, a delay that grows per account, a CAPTCHA after a few failures and a password reset that still works are a sensible start. Offer multi-factor authentication, at least for admin accounts, then repeat the test.
Facts worth knowing, with sources
- Supabase Auth's token endpoint allows 150 requests per 5 minutes per IP address by default, and over-limit requests get a 429 answer. Source
- Supabase Auth supports hCaptcha and Cloudflare Turnstile for CAPTCHA protection. Source
- OWASP recommends counting failed logins per account rather than per source IP address. Source
- Firebase suggests tightening the default quota of the identitytoolkit.googleapis.com endpoints to limit brute force attempts. Source
Questions
Does Supabase Auth have rate limiting built in?
Yes. It limits sign-in, sign-up, password recovery and other endpoints per IP address by default, answers 429 over the limit, and lets you change the limits under Authentication, Rate Limits. Add CAPTCHA for sign-in, sign-up and password reset as well.
Should I lock accounts after failed logins?
A temporary lock or a growing delay helps, but OWASP warns that lockouts can be used to lock other people out. Let a locked user sign in through the password reset, and avoid permanent locks.
Is a CAPTCHA enough to stop password guessing?
No. OWASP describes CAPTCHA as a defence in depth that makes guessing slower. Combine it with a limit per account and, for important accounts, multi-factor authentication.
Where does Saqr fit?
These checks cover what is on the list, on the pages you think to try. Saqr runs this kind of test on the live app for you, in a real browser and including signed-in pages, and shows the proof for each finding with a fix prompt for your AI coding tool. After you fix something, ask it to recheck. Plans are Starter at $19 a month and Pro at $49 a month, and you can cancel any time.
Every task ends in three PDFs. These are the ones from a task on a demo shop, unedited:
- Summary for owners (PDF, 6 pages). What was found and what to fix first.
- Technical report for developers (PDF, 29 pages). Every finding, with its proof and the steps to fix it.
- AI fix pack (PDF, 10 pages). A ready-to-paste fix prompt for every finding.
No test can promise an app is secure. A task tells you what Saqr found that day, with proof.
Which other guides should I read?
- Is my Lovable app secure?
- Is my Bolt app secure?
- Is my Replit app secure?
- Is my v0 app secure?
- Is my Cursor-built app secure?
- Is my Supabase app secure?
- Is my Firebase app secure?
- How do I check if my vibe-coded app is secure?
- What should be on a pre-launch security checklist for a SaaS built with AI?
- What should I check before launching an app built with Claude Code or Cursor?
- What is the OWASP Top 10, in plain words?
- How do I test my own app for broken access control (IDOR)?
- How do I test Supabase row level security?
- Supabase anon key vs service_role key: which one is safe in the browser?
- How do I check if a Supabase storage bucket is public?
- How do I check my Firebase security rules?
- My Firebase API key is public. Is that safe?
- I exposed an API key in my frontend. What do I do now?
- Are my session cookies secure, and how do I check them?
- Which security headers should my Next.js or Vite app set?
- Is my CORS configuration safe, and how do I check it?
- Security fix prompts for your AI coding tool
- Saqr, automated scanners and a manual penetration test
- Questions about securing an app built with AI tools
To see what a finished test looks like, open the sample reports.
Sources
The statements above were checked against these pages on 24 November 2026. Products change; follow the links for the current wording.
- Supabase documentation: Auth rate limits
- Supabase documentation: Enable CAPTCHA protection
- Supabase documentation: Production checklist
- Firebase documentation: API keys
- Google Cloud documentation: Email enumeration protection
- OWASP cheat sheet: Authentication
- OWASP Top 10:2025, A07 Authentication Failures
- Cloudflare documentation: Rate limiting rules
- Next.js documentation: Data security
Saqr is independent and is not affiliated with Supabase, Firebase, Next.js or Cloudflare. Each name is a trademark of its owner.