Best WAF for Vercel
Secure applications deployed on Vercel with a web application firewall. Compare the native Vercel WAF (custom rules, IP blocking, rate limiting, managed rulesets, Attack Mode) against fronting your app with a full third-party WAF such as Cloudflare.
Vercel is a hosting and edge platform used to deploy Next.js, React, Svelte, Nuxt, Astro, and other frontend applications. Because Vercel terminates client traffic on its own global network before it reaches your functions and static assets, the platform is where web application firewall policy is enforced. You do not install WAF software on Vercel the way you would on NGINX or HAProxy; the WAF is a native product tier of the platform.
The Vercel Firewall is a multi-layered system. Every request passes through a platform-wide firewall that provides automatic DDoS mitigation at L3, L4, and L7 on all plans with no configuration, and then through the configurable Vercel WAF. The WAF adds custom rules, IP blocking, rate limiting, and (on Enterprise) managed rulesets. A key operational property: when you apply a firewall change it takes effect globally within 300ms and does not require a redeployment, and any change can be instantly rolled back from the audit log.
This guide covers what the native Vercel WAF can and cannot do at the config
level, how features are gated by plan tier, and when a team needs to front their
Vercel app with a full standalone WAF instead. Rules are configured in the
dashboard, described in natural language, written into vercel.json
via the routes property, or managed through the Vercel CLI, the
Firewall REST API, or the Vercel Terraform provider.
Top WAF Providers for Vercel
Vercel Firewall
Native Platform WAFThe Vercel WAF is the native, and for most teams the correct, way to add firewall policy to an app hosted on Vercel. It requires no proxy or agent: automatic DDoS mitigation runs on every deployment for free, and the configurable layer adds <a href="https://vercel.com/docs/vercel-firewall/vercel-waf/custom-rules">custom rules</a> (actions: log, deny, challenge, bypass, redirect, and rate limit), <a href="https://vercel.com/docs/vercel-firewall/vercel-waf/ip-blocking">IP blocking</a>, and <a href="https://vercel.com/docs/vercel-firewall/attack-mode">Attack Mode</a> on all plans. Changes propagate globally within 300ms with no redeploy and support instant rollback. The main limits are by plan: the OWASP Core Ruleset and bot managed rulesets are Enterprise-only, and rule counts scale from 3 (Hobby) to 40 (Pro) to 1000 (Enterprise).
Key Benefits:
- Built into every Vercel deployment; automatic L3/L4/L7 DDoS mitigation on all plans, no config
- Custom rules (log, deny, challenge, bypass, redirect, rate limit) apply globally in ~300ms with no redeploy
- IP blocking, rate limiting, and Attack Mode on all plans; OWASP Core Ruleset and bot rulesets on Enterprise
- Configure via dashboard, natural language, vercel.json routes, the Vercel CLI, the Firewall REST API, or the Terraform provider
Cloudflare Web Application Firewall
Front-the-App AlternativeIf you need a full independent WAF outside Vercel's Enterprise tier, front your Vercel app with Cloudflare. It provides the complete OWASP-based managed ruleset, a rich custom rule language, mature bot management, and unified policy across Vercel and non-Vercel origins, none of which the native WAF exposes on Hobby or Pro. The trade-offs are real: fronting adds a second CDN/edge hop before Vercel's own network, requires careful origin and proxy configuration, and moves traffic handling off the platform-aware Vercel edge for the paths you route through it. Choose it when WAF depth or multi-provider consistency matters more than staying purely native.
Key Benefits:
- Full OWASP-based managed rules and a custom rule language independent of Vercel's plan tier
- Unified WAF policy across Vercel and non-Vercel origins for multi-cloud estates
- Mature bot management, rate limiting, and threat intelligence
- Runs in front of Vercel, filtering requests before they reach the platform edge
What to Look For in a WAF for Vercel
When choosing how to firewall an app on Vercel, weigh these config-level factors:
- Native WAF vs fronting - The Vercel WAF runs inside the platform with no extra hop and no software to install. A third-party WAF sits in front of Vercel and adds an edge layer. Native is simpler and platform-aware; fronting gives you WAF depth and cross-origin consistency at the cost of another hop and more configuration.
- Plan tier gates - WAF
Managed Rulesets (OWASP Core Ruleset, Bot Protection, AI Bots) are Enterprise
only. Custom
rule counts scale by plan (Hobby up to 3, Pro up to 40, Enterprise up to
1000), and project-level IP
block counts scale from 3 to 100 to 1000. Account-level IP Blocking is
Enterprise only, with CIDR rules capped at
/16for IPv4 and/48for IPv6. Confirm your tier covers what you need before you design rules. - Rate limiting details - WAF Rate Limiting offers a Fixed Window algorithm on all plans and Token Bucket on Enterprise. Counting keys are IP and JA4 Digest on all plans; User Agent and arbitrary header keys are Enterprise only. The window is 10s to 10min on Hobby/Pro and up to 1hr on Enterprise. Note counters are tracked per region, so a global limit can be exceeded across regions.
- vercel.json is a subset - Rules written in
vercel.jsonviaroutesand themitigateproperty support only thedenyandchallengeactions. Thelog,bypass, andredirectactions are dashboard, CLI, and API only. Do not assume infrastructure-as-code covers the full rule surface. - Rule execution order - The platform firewall (DDoS mitigation) runs first, then traffic passes through the Vercel WAF. Within the WAF, Vercel documents two ordered stages: custom rules evaluate first, then WAF Managed Rulesets. Because custom rules run before managed rulesets, a bypass custom rule can allow traffic a managed ruleset would otherwise block.
- Observability and change control - Use the Firewall live
traffic view, firewall
observability and alerts, and Log Drains to a SIEM. Because changes apply in
~300ms with instant rollback, test new rules in
logmode against live traffic before switching them todenyorchallenge.
Vercel Considerations
Vercel-specific considerations when adding a WAF:
- Vercel-only scope - The native WAF protects only apps deployed on Vercel. It cannot protect origins hosted elsewhere. If you run a multi-cloud estate and want one WAF policy everywhere, that points toward a third-party WAF in front rather than the native product.
- DDoS is automatic and free - L3/L4/L7 DDoS mitigation runs on all plans with no configuration, and traffic blocked by DDoS mitigation is not billed. Attack Mode is free on all plans; it challenges unverified visitors during an active attack while exempting verified bots (search crawlers, webhooks) and your own Functions and Cron Jobs.
- No redeploy, instant rollback - Firewall changes take effect globally within 300ms and are decoupled from your build/deploy pipeline. Any configuration can be restored from the audit log, which is useful when a rule causes unexpected behavior.
- Managed rulesets are Enterprise-only - On Hobby and Pro there is no OWASP Core Ruleset toggle. You build protection from custom rules, IP blocking, and rate limiting instead of enabling a signature ruleset. Plan for this if you specifically need OWASP CRS coverage without an Enterprise contract.
- Persistent actions - A challenge, deny, or rate limit action can carry a time-based block on the offending client IP. The block is applied before the firewall processes the request, so persisted-blocked traffic does not count toward CDN or traffic usage.
- False positives and trusted sources - If automatic
mitigations block a trusted proxy or shared network, you can Pause System
Mitigations for 24 hours, or (Pro/Enterprise) create System Bypass Rules so
essential traffic is never blocked by DDoS protection. Test any new custom rule
in
logmode first, watch the live traffic view, then promote it todenyorchallenge.
Frequently Asked Questions
Does Vercel include a WAF out of the box?
Partly. Every Vercel deployment gets the platform-wide firewall with automatic L3/L4/L7 DDoS mitigation on all plans and no configuration. The configurable Vercel WAF layer, custom rules, IP blocking, rate limiting, and Attack Mode, is also available on all plans, but the OWASP Core Ruleset and bot managed rulesets require an Enterprise plan.
Do I need a separate WAF if I am on Vercel?
For many frontend applications the native Vercel WAF is enough: automatic DDoS mitigation plus custom rules, IP blocking, and rate limiting cover common abuse. You may want a dedicated WAF in front if you need the full OWASP Core Rule Set without an Enterprise plan, a unified policy across Vercel and non-Vercel origins, or advanced bot management and managed rulesets that the native WAF gates behind Enterprise.
Can I configure Vercel WAF rules in vercel.json?
Yes, but only a subset. You define rules under the routes property
using a mitigate action, and only deny and
challenge are supported there. The log,
bypass, and redirect actions are available only through
the dashboard, CLI, or Firewall API. See the
custom
rules docs for the vercel.json syntax.
How do I rate limit an API endpoint on Vercel?
Create a custom rule whose condition matches the endpoint (for example a path
of /api) and set the Then action to Rate Limit. You choose a Fixed
Window (all plans) or Token Bucket (Enterprise) strategy, a Time Window (default
60s) and Request Limit (default 100), a counting key (IP or JA4 Digest on all
plans; User Agent and header keys on Enterprise), and a follow-up action of the
default 429, or Log, Deny, or Challenge. See
WAF
Rate Limiting. Note counters are per region.
Is the full OWASP Core Rule Set available on Vercel?
Only on the Enterprise plan. The OWASP Core Ruleset is a WAF Managed Ruleset that you enable and configure per rule (each rule set to Log or Deny) in the Firewall dashboard, and managed rulesets are Enterprise-only. On Hobby and Pro you approximate coverage with custom rules, IP blocking, and rate limiting, or you front the app with a third-party WAF that ships the CRS.
What is Attack Mode and when should I use it?
Attack Mode is a free, all-plans emergency setting that challenges every unverified visitor with a security challenge during an active DDoS attack, while automatically allowing verified bots (search crawlers, webhooks) and your own Functions and Cron Jobs through. Traffic blocked by Attack Mode does not count toward usage. Use it during a highly targeted attack rather than as a permanent setting, since Vercel already mitigates DDoS automatically.
Can I front my Vercel app with a third-party WAF like Cloudflare?
Yes. You can route traffic through a WAF such as Cloudflare before it reaches Vercel to get a full OWASP-based ruleset, a richer rule language, and consistent policy across multiple origins. Be aware of the trade-offs: it adds a second edge hop in front of Vercel's own network, needs careful origin and proxy setup, and the fronted paths lose Vercel's platform-aware traffic handling. It is the right call when WAF depth or multi-cloud consistency outweighs staying native.