What the Vercel Firewall Is Made Of
“The firewall” in the Vercel dashboard is several things stacked together, and they behave differently enough that it's worth knowing which one you're touching:
- DDoS mitigation. Always on, every plan. You don't configure it and it doesn't care about good or bad bots, only floods.
- Custom rules (the WAF). Your own if-this-then-that rules. Match on path, user agent, IP, country, headers, method and more, then log, deny, challenge, rate limit, redirect, or bypass.
- Managed rulesets. Rules Vercel maintains for you. The two that matter here are Bot Protection, which challenges traffic that doesn't look like a real browser, and AI Bots, which logs or denies known AI crawlers.
- Attack Challenge Mode. The panic button. Every visitor gets a challenge until you turn it off.
There's also BotID, an invisible check you add in code to specific routes. It lives in your app, not in the dashboard rules, and I'll come back to it for API routes.
The Good Bots You're About to Block
Before touching any setting, write down who is supposed to be able to read your site without a browser. For a portfolio or a small business site, the list is longer than it looks:
- Search crawlers: Googlebot, Bingbot, Applebot. Also Google's testing tools, like the live test in Search Console and the Rich Results Test.
- AI search and assistants: OAI-SearchBot and ChatGPT-User, Claude-SearchBot and Claude-User, PerplexityBot and Perplexity-User. The “-User” ones fetch a page right now because a person asked about it.
- Link previews: Slackbot, LinkedInBot, facebookexternalhit, Twitterbot, Discordbot, WhatsApp. They fetch your Open Graph tags and image to build the card.
- Feed readers polling your RSS feed.
- Monitoring: uptime checkers, PageSpeed Insights, any cron job you run against your own site.
- Webhooks from services that call your API, like Stripe or GitHub.
None of these run JavaScript the way a browser tab does. That one fact explains almost every way bot protection goes wrong.
A Challenge Is a Block for Anything That Isn't a Browser
When the firewall “challenges” a request, it answers with a page that runs a script in the visitor's browser, proves a real browser is there, and then lets them through. A person sees a short delay. A crawler that only reads HTML sees a page with no content on it, and that's what gets indexed, previewed, or quoted.
So “challenge” sounds gentler than “deny,” but for the list above it lands the same way. Vercel softens this by letting verified bots skip challenges, which covers the big crawlers. Smaller preview fetchers, feed readers, and your own monitoring often aren't on that list.
The same goes for your own API routes. A fetch() call from your front end can't solve a challenge page. Neither can navigator.sendBeacon, which is how the analytics on this site send events. Put a challenge on /api/* and you've broken your own site for real visitors.
Never Allow a Bot by Its User Agent
The obvious fix for “Bot Protection is catching Googlebot” is a custom rule: if the user agent contains Googlebot, bypass. Don't. A user agent is a string the client picks, and every scraper on the internet already knows to claim it's Googlebot. That rule turns your firewall off for anyone who reads this paragraph.
Verified bots are different. Vercel checks that a request claiming to be Googlebot actually comes from Google's published IP ranges (and for some bots, a cryptographic signature on the request). That's the check you want, and the managed rulesets already do it. If you need to special-case a bot that isn't verified, match on something it can't fake, like the IP ranges the service publishes, and scope the rule to the paths it needs.
The reverse mistake is just as common: blocking any user agent that contains bot. That catches Googlebot, Bingbot, Slackbot, and LinkedInBot in one go.
The Setup, in the Order I'd Do It
1. Start every rule in Log mode
Every custom rule and managed ruleset in Vercel can run with a Log action. It records what would have matched and lets the request through. Turn things on in Log, leave them for a week, and read the Firewall tab: which user agents, which paths, which countries. You'll find something you didn't expect. Then switch to the real action.
2. Bypass the files that exist for machines
Some URLs on your site are there only for bots, and challenging them makes no sense. On this site that's /robots.txt, /sitemap.xml, /rss.xml, /llms.txt, and the images in /images/ that link previews pull in. One custom rule covers them:
Rule: "Machine-readable files"
If Request Path equals /robots.txt
or Request Path equals /sitemap.xml
or Request Path equals /rss.xml
or Request Path equals /llms.txt
or Request Path starts with /images/
Then BypassBypass skips the rest of the WAF for those requests. DDoS mitigation still applies, so this doesn't open a hole anyone can flood. Keep the list short: static, public files only, nothing that runs code.
3. Block the junk you're sure about
A Next.js site has no /wp-login.php. Scanners ask for it anyway, along with /xmlrpc.php, /.env, /.git/config and a long tail of PHP admin panels. Nobody legitimate ever requests these on your site, so a deny rule here has no false positives. Check your Log data for the paths that actually show up and add those.
Rule: "Scanner paths"
If Request Path starts with /wp-
or Request Path ends with .php
or Request Path starts with /.env
or Request Path starts with /.git
Then DenyIf your site really is WordPress, skip this one, obviously.
4. Turn on Bot Protection, after a week of logs
With the bypass rule in place, set the Bot Protection managed ruleset to Log and read what it catches. You want to see curl, Python scripts, headless browsers and scrapers. If you see a preview fetcher, a feed reader, or your uptime monitor, add a narrow exception for it before switching to Challenge.
5. Decide what you actually want from AI bots
The AI Bots ruleset can deny known AI crawlers in one switch. Before you flip it, split them into three groups, because they do different things:
- Training crawlers (GPTBot, ClaudeBot, CCBot, Google-Extended) collect pages for model training.
- Search crawlers (OAI-SearchBot, Claude-SearchBot, PerplexityBot) build the index that AI search answers come from.
- User fetchers (ChatGPT-User, Claude-User, Perplexity-User) load your page because someone typed a question and the assistant went to read you.
Denying all of them takes you out of ChatGPT, Claude, and Perplexity answers. For a portfolio that's the opposite of the goal: I spent a whole post on making this site readable to AI search, and the analytics here track visits that come from AI assistants. So this site leaves the AI Bots ruleset off, and its robots.txt explicitly allows those bots.
If you don't want your writing in training data but do want to show up in answers, you can do that in robots.txt: disallow the training crawlers, allow the search crawlers and the user fetchers. The big AI companies document that their bots respect it. The firewall is for crawlers that ignore robots.txt, and those you can find in your logs and deny one at a time.
6. Rate limit API routes instead of challenging them
For /api/*, use a rate limit rule: a number of requests per IP per time window, and a 429 response when someone goes over. The chatbot on this site already limits itself in code, but a firewall limit stops the request before the serverless function starts, which means you don't pay for the function run either.
Rule: "Chat API rate limit"
If Request Path equals /api/chat
and Method equals POST
Then Rate Limit 10 requests / 60 seconds per IP → 429Set the firewall limit a little looser than the one in your code, so the friendlier app-level error message is what real users see, and the firewall only catches floods.
For an endpoint that costs real money per call, like an AI chat, BotID is worth a look. You add it to the specific routes you want protected, it checks the browser silently, and the server rejects requests that fail. Crawlers never call your chat endpoint, so it can't hurt your SEO.
7. Keep Attack Challenge Mode for emergencies
If you're getting hammered, Attack Challenge Mode is the right button. Verified bots still get through, so Google won't drop you for an afternoon of it. Preview fetchers, feed readers, and anything unverified will fail the whole time it's on. Turn it off as soon as the attack stops, and put a reminder somewhere so you don't forget it for a month.
How to Check You Didn't Break Anything
Pretending to be Googlebot from your laptop is a useful test, because it should not work. Your laptop isn't coming from Google's IPs, so a protected page should challenge you. The machine-readable files should still answer with 200:
# Fake Googlebot: should be challenged or denied on protected pages
curl -I -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" \
https://www.example.com/blog
# Bypassed files: should return 200
curl -I https://www.example.com/robots.txt
curl -I https://www.example.com/rss.xmlThen test the real bots with their own tools:
- Google Search Console, URL Inspection, “Test live URL.” If the rendered HTML shows a challenge page, Googlebot is being blocked. My Search Console guide walks through where that is.
- The LinkedIn Post Inspector, plus pasting a link into a Slack or Discord message to yourself. You want a title, description, and image.
- Your feed reader, refreshed by hand.
Over the next few weeks, keep an eye on two things. Crawl stats in Search Console should not show a jump in 403 responses. And if you track where visits come from, referrals from ChatGPT and Perplexity shouldn't suddenly drop to zero. If either one moves the week you changed the firewall, you know where to look.
The Short Version, as a Checklist
- List the bots you need before changing any setting.
- Run every new rule in Log for about a week first.
- Bypass
robots.txt, the sitemap, the RSS feed,llms.txt, and Open Graph images. - Deny scanner paths your stack doesn't have.
- Never allow or block a bot by user agent alone. Rely on verified bots.
- Choose AI bots by group: training, search, user fetchers.
- Rate limit API routes. Never challenge them.
- Attack Challenge Mode only during an attack.
- Test with a fake Googlebot, Search Console's live test, and a real link preview.
Frequently Asked Questions
Does Vercel Bot Protection block Googlebot?
Not if Googlebot is verified. Vercel keeps a list of known bots and checks that a request claiming to be Googlebot really comes from Google before letting it skip the challenge. The bots that get hurt are the legitimate ones that aren't on that list or don't run JavaScript, like some link preview fetchers, RSS readers, and uptime monitors. Run the ruleset in Log mode first to see who it would catch.
Should I block AI crawlers with the Vercel AI Bots ruleset?
Only if you don't want to appear in AI answers. AI bots come in three kinds: training crawlers like GPTBot and ClaudeBot, search crawlers like OAI-SearchBot and PerplexityBot, and fetchers like ChatGPT-User that load a page because a person asked about it. Blocking all of them removes you from ChatGPT, Claude, and Perplexity results. If you only object to training, disallow the training crawlers in robots.txt and leave the others alone.
Why shouldn't I put a challenge on my API routes?
A challenge is a page that has to run in a browser tab. A fetch() call from your own front end, a sendBeacon analytics request, or a webhook from another service can't solve it, so the request just fails. For API routes, use a rate limit rule that returns 429, or a deny rule for traffic you are sure about.
What is the difference between robots.txt and a firewall rule?
robots.txt is a request. Well-behaved crawlers read it and follow it, and everything else ignores it. A firewall rule is enforced at Vercel's edge before the request reaches your app, so it works on bots that don't care what you asked. Use robots.txt to tell good bots what you want, and the firewall for the ones that don't listen.
