How to Stop Spam Signups on an AI-Built App
AI scaffolding produces a working signup form with none of the gatekeeping a real one needs. The five defences that matter, ordered by how much friction each adds for real users.
Add email verification before the account does anything, rate limit signups by IP and by email domain, and put an invisible challenge on the form. Those three stop most of it. The reason you need them at all is that an AI-generated signup flow is complete in the sense that it works, and empty in the sense that it trusts everyone who fills it in.
Why AI-built apps get hit
Ask a model for a signup form and you get a form, a users table, a password hash and a redirect. That is a correct answer to the question. It is also a list of everything a real signup flow has except the parts that exist to say no.
The scaffold typically ships with no email verification step, no limit on how fast one address can create accounts, no check on whether the domain exists, and an error message that helpfully distinguishes "no such user" from "wrong password". None of those are bugs. They are absences, and absences do not show up in testing because your own signup works fine.
Bots find these forms the ordinary way, by crawling. A form with no gatekeeping is worth filling in at volume whether or not your app is interesting, because accounts are inventory. What you see first is usually not an attack but a slow accumulation of accounts that never log in again.
The five defences, cheapest friction first
Defence | Friction for real users | What it stops |
|---|---|---|
Email verification before use | Low, one click | Fake and mistyped addresses, most bulk signups |
Rate limiting by IP and domain | None, until abused | Bulk creation from one source |
Invisible challenge | None in the normal case | Scripted form submission |
Disposable domain blocking | None, unless you overblock | Throwaway accounts |
Visible CAPTCHA | High | Determined scripted abuse |
Work down that list and stop when the problem stops. Most apps never need the last row, and reaching for it first is how you lose real signups to a puzzle.
Email verification, done properly
The rule that matters: an unverified account can exist, but it cannot do anything that costs you money or is visible to anyone else. Not send an invite, not publish, not call a model on your API budget.
That framing is better than blocking login entirely, because it keeps the flow friendly for a real person who wants to look around, while making the account worthless to someone creating a thousand of them.
Three details that catch people out:
Expire the link. Twenty four hours is standard. An unexpiring verification link is a permanent account-takeover primitive if the email is ever forwarded or leaked.
Single use. Mark the token consumed on first use, or a forwarded link verifies the address twice.
Make sure the email arrives. A verification step that lands in spam is a signup funnel with a hole in it. If your transactional mail is not authenticated, that is why it goes to spam, and SPF, DKIM and DMARC is the fix.
Rate limits that actually bite
Rate limiting the signup endpoint by IP is the obvious move and it is half a defence, because a residential proxy pool defeats it. Limit on three keys at once:
Per IP. Five signups an hour is generous for a real network and useless for a script.
Per email domain. Twenty new accounts an hour from one domain is either a company onboarding a team or a problem. Allow it for domains you know.
Per normalised address. Strip dots and plus-suffixes before comparing. Local-part handling is the mail server's business under RFC 5321, which is exactly why you cannot assume two different strings are two different people.
a.b+1@gmail.comandab@gmail.comare one mailbox, and plus-addressing is the oldest way to turn one inbox into unlimited signups.
That last one is the highest-value line of code in this post, and almost no generated scaffold includes it. If you have not got rate limiting in the app at all yet, start there, because the same middleware covers login and password reset, which are the next two endpoints to get hit.
Disposable domains, carefully
Blocking throwaway email providers works, and it is the defence most likely to cost you a real customer if you are careless. The lists are large, they go stale, and they occasionally include a provider that someone's actual company uses.
Use a maintained list rather than one you curate. Treat a match as a soft signal: require verification and block the free tier, rather than refusing the signup outright with an error that tells the person their email is not good enough. And keep an allowlist you can add to in one line, because the day a paying customer cannot sign up is the day you want that to be a thirty second fix.
What not to do
Do not put a visible CAPTCHA on the form first. It is the most expensive option in real-user terms and it is near the bottom of the list for a reason. Modern invisible challenges such as Cloudflare Turnstile do the same job without the puzzle, and you can escalate to a visible one only for sessions that already look suspicious.
Do not block signups by country unless you have a specific reason. It is a blunt instrument that mostly catches travellers and VPN users.
Do not silently delete suspicious accounts. Flag and quarantine instead. The first time you get it wrong, and you will, a quarantined account can be restored and a deleted one cannot.
Do not leak which half of the login failed. Separate "no such account" and "wrong password" messages turn your login form into a tool for checking which addresses are registered. One message for both.
After the cleanup
Once the flow is defended, go and look at what already got in. Count accounts that verified but never performed a second action, group signups by hour and by domain, and you will usually see the bulk creation as an obvious spike. Quarantine those rather than deleting them, and keep the query, because it doubles as your detection for next time.
Here is the query, in Postgres, that finds the spike. Group by hour and domain and the pattern is usually unmistakable.
select date_trunc('hour', created_at) as hour,
split_part(email, '@', 2) as domain,
count(*) as signups,
count(*) filter (where verified_at is null) as never_verified
from users
where created_at > now() - interval '30 days'
group by 1, 2
having count(*) > 5
order by signups desc
limit 50;A real company onboarding looks like ten accounts from one domain across a working day, most of them verified. Bulk creation looks like sixty accounts from four domains inside one hour, none of them verified. You do not need a heuristic to tell those apart, you need to look once.
If this is the point where you are also adding roles, sessions and password reset properly, adding user accounts to an AI-built app covers the surrounding pieces, and the app building guide covers where this sits in the wider build.
Questions people ask
Why am I suddenly getting hundreds of fake signups?
Your form was found by a crawler. It is rarely targeted. An unprotected signup endpoint is worth filling in at volume regardless of what the app does.
Is a CAPTCHA enough on its own?
No. It stops naive scripts and does nothing about a real address signing up repeatedly, or about accounts created slowly. Verification plus rate limiting does more for less friction.
Should I block all free email providers?
No. You would block a large share of legitimate small-business and freelance customers. Block disposable providers specifically, and treat the match as a reason to require verification rather than to refuse.
What about the accounts already in my database?
Flag anything unverified or inactive since signup, quarantine rather than delete, and keep the query as your ongoing detection.
Does any of this slow down real signups?
Verification adds one click. Rate limits and invisible challenges add nothing in the normal case. Only a visible CAPTCHA has a real cost, which is why it is last.
How did this land?
About the author

Developer Advocate
Steve builds something with Swarmz every week and writes up what worked, what broke, and what he'd do differently. Tutorials and hands-on guides are his lane.


