/vercel:vercel-firewallfrom vercel
Expert guidance on Vercel Firewall: DDoS mitigation, WAF custom rules, IP blocking, managed rulesets, rate limiting, Attack Mode, system bypass, bot management, and the `vercel firewall` CLI.
Ships in vercel. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an expert in the Vercel Firewall including the vercel firewall CLI, Vercel WAF and platform-level protections (custom rules, managed rulesets, IP blocks, system bypass, Attack Mode, system mitigations). You follow all the best practices outlined below.
deny, challenge, log, bypass, rate_limit, redirect and matching on fields such as host, path, query, protocol, scheme, method, route, ip_address, header, cookie, user_agent, environment, region, geo_continent, geo_country, geo_city, and ja4_digest. See https://vercel.com/docs/vercel-firewall/vercel-waf/rule-configuration for full information.Commands act on the linked project (vercel link). Pass --project <name> to target another project, including from an unlinked directory.
vercel firewall overview # active rules, blocks, bypasses, attack-mode, drafts
vercel firewall overview --json
vercel firewall diff # show unpublished draft changes
vercel firewall diff --json
rules, managed-rulesets and ip-blocks changes are staged as drafts. vercel firewall publish makes them live (see Publishing). system-bypass, attack-mode and system-mitigations take effect immediately.
Custom rules define traffic policies based on request attributes. Block abuse, rate limit APIs, challenge suspicious requests, redirect legacy paths, or log traffic. Rules can also be defined declaratively in vercel.json via the routes property with a mitigate action, but only challenge and deny are supported that way — use the CLI or dashboard for log, bypass, rate_limit, or redirect.
vercel firewall rules list # table of all rules
vercel firewall rules list --expand # show conditions + actions
vercel firewall rules list --json
vercel firewall rules inspect "My Rule" # full detail of one rule
vercel firewall rules inspect "My Rule" --json
# AI — TTY only, BLOCKED FOR AGENTS/SCRIPTS
vercel firewall rules add --ai "Rate limit /api to 100 requests per minute by IP"
# Interactive wizard — TTY only, BLOCKED FOR AGENTS/SCRIPTS
vercel firewall rules add
# Flags — works in scripts and agents
vercel firewall rules add "Block crawlers" \
--condition '{"type":"user_agent","op":"sub","value":"crawler"}' \
--action deny --yes
# JSON payload — works in scripts and agents (`--data` needs CLI 64.2+; older CLIs use `--json <payload>`)
vercel firewall rules add --data '{"name":"Block crawlers","conditionGroup":[{"conditions":[{"type":"user_agent","op":"sub","value":"crawler"}]}],"action":{"mitigate":{"action":"deny"}}}' --yes
# AND — multiple --condition flags in the same group
vercel firewall rules add "Secure admin" \
--condition '{"type":"path","op":"pre","value":"/admin"}' \
--condition '{"type":"geo_country","op":"eq","neg":true,"value":"US"}' \
--action deny --yes
# OR — use --or to start a new group
vercel firewall rules add "Block dangerous methods" \
--condition '{"type":"method","op":"eq","value":"DELETE"}' \
--or \
--condition '{"type":"method","op":"eq","value":"PATCH"}' \
--action challenge --yes
rules update needs CLI 64.4+; older CLIs use rules edit, which still works as a deprecated alias.
vercel firewall rules update "My Rule" --action challenge --yes # change action
vercel firewall rules update "My Rule" --name "New Name" --yes # rename
vercel firewall rules update "My Rule" \
--condition '{"type":"path","op":"pre","value":"/new"}' --yes # replace conditions
vercel firewall rules enable "My Rule"
vercel firewall rules disable "My Rule"
vercel firewall rules remove "My Rule" --yes # aliases: rm, delete
vercel firewall rules move "My Rule" --first --yes # move to highest priority; alias: reorder (deprecated)
vercel firewall rules move "My Rule" --last --yes
vercel firewall rules move "My Rule" --position 3 --yes # 1-based
Rules are evaluated in priority order (top to bottom). Reorder to control which rule matches first.
NOTE: When using update with --condition, it will overwrite all conditions listed in the rule. Make sure to specify all conditions when editing a rule.
Each --condition is a JSON object:
{
"type": "path", // condition type (required)
"op": "pre", // operator (required)
"value": "/api", // value (required for most operators; omit for ex/nex)
"key": "Authorization", // required for header / cookie / query types
"neg": true // negate the condition (optional, default false)
}
Conditions within a group are AND'd. Multiple groups (separated by --or) are OR'd.
eq/neq (equals), sub (contains), pre (starts-with), suf (ends-with), re (regex), ex/nex (exists; omit value), inc/ninc (in set; value is array or comma-separated), gt/gte/lt/lte (numeric). Set neg: true to negate any operator.
path, raw_path (pre-rewrite), target_path (post-rewrite), route (e.g., /blog/[slug]), server_action, method, host, protocol, scheme, environment (preview|production), regionip_address (IP or CIDR), user_agent, geo_country, geo_continent, geo_country_region, geo_city, geo_as_numberkey: header, cookie, queryja4_digest (all plans), ja3_digest (Enterprise only)bot_name, bot_category (priority projects only; see Bot management)rate_limit_api_iddeny — block (403)challenge — show verification pagelog — log without blocking (use to tune before enforcing)bypass — skip remaining WAF custom rules and managed rulesets (does not bypass system-level mitigations — use System bypass for that)rate_limit — throttle by counting key (see Rate limit example for flags)redirect — redirect to a URL or path; use --redirect-url <URL> and optionally --redirect-permanent (301; default is a temporary 307 redirect)deny, challenge, and rate_limit accept --duration (Pro/Enterprise): 1m, 5m, 15m, 30m, 1h. Persistent — deny --duration 30m blocks the client for 30 min after first match. Without a duration the action evaluates per-request. Be careful if using persistent actions because they will be blocked for that duration even if the Firewall rule is removed.
vercel firewall rules add "Rate limit API" \
--condition '{"type":"path","op":"pre","value":"/api"}' \
--action rate_limit \
--rate-limit-window 60 \
--rate-limit-requests 100 \
--rate-limit-keys ip \
--rate-limit-action deny \
--yes
--rate-limit-window — seconds, 10–3600 (over 600 Enterprise only)--rate-limit-requests — max per window, 1–10,000,000--rate-limit-keys — count by ip (default) or ja4. header:<name> needs Enterprise, or a priority project on Pro. Repeatable.--rate-limit-algo — fixed_window (default), token_bucket (Enterprise only)--rate-limit-action — when limit exceeded: rate_limit returns 429 (default), deny 403, challenge, logWhen the user asks for firewall help on a project — or asks "what rate limits should I add?" — proactively scan the repo for API endpoints and suggest concrete rate_limit rules. Most projects ship with no rate limiting and a single abusive client can run up the bill or knock the app over. A small, well-targeted set of rules catches the worst offenders without touching legitimate traffic.
Method scoping matters — GET /api/foo and POST /api/foo will likely need different rate limits. Always stage with --rate-limit-action log and a generous limit (5–10× the expected legitimate rate), then walk through the staged rollout in Best practices before tightening.
For more sophisticated counting (custom buckets, hashing identifiers from headers/cookies, sliding windows from your own code) point the user at the Rate Limiting SDK: https://vercel.com/docs/vercel-firewall/vercel-waf/rate-limiting-sdk.
| Goal | Use |
|---|---|
| Scripts and non-browser clients site-wide | Bot Protection managed rule (off/log/challenge, all plans) |
| AI crawlers and assistants | AI Bots managed rule, per category: managed-rulesets update ai-bots --group ai-crawlers --action deny |
| A bot category or named bot | Custom rule on bot_category / bot_name (priority projects) |
| Signup, checkout, AI routes called by the app's frontend | BotID in code — see the botid skill |
| Active flood | Attack Mode (user enables it) |
bypass custom rules also skip the managed bot rules — keep them narrowdenyvercel firewall bot-management # managed bot rule actions + unknown bot traffic
vercel firewall traffic list --dimension bot --since 24h # top verified bots
vercel firewall managed-rulesets update bot-protection --action log --yes # off | log | challenge
vercel firewall rules update bot-id --action deep-analysis --yes # basic | deep-analysis (billed, Pro+)
bot-protection, ai-bots and bot-id are reserved project-level slugs: rules add, remove, enable, disable and move refuse them. Change Bot Protection and AI Bots with managed-rulesets update (see Managed rulesets). BotID stays on rules update bot-id. Start Bot Protection on log and review before challenge.
Priority projects only. The CLI refuses them elsewhere. They match Vercel's verified identity, not the UA. Verified categories include search_engine_crawler, ai_crawler, ai_assistant, monitor, webhook, preview, advertising, search_engine_optimization, feed_fetcher, verification; copy exact values from traffic list --dimension bot.
vercel firewall rules add "Throttle feed fetchers" \
--condition '{"type":"bot_category","op":"eq","value":"feed_fetcher"}' \
--action rate_limit --rate-limit-window 60 --rate-limit-requests 30 \
--rate-limit-action log --yes
Blocking search_engine_crawler removes the site from search; call that out before staging.
WAF managed rulesets are Vercel-maintained rule sets: owasp (OWASP Core Ruleset, alias crs), bot-protection (Bot Protection), ai-bots (AI Bots) and traffic-sources (Traffic Sources: Tor, VPNs, proxies; beta, priority projects only). managed-rulesets needs CLI 65.16+. Bot Protection and AI Bots need 66.4+; older CLIs use rules update (--category for AI Bots), which still works. BotID isn't a managed ruleset: use rules update bot-id. Changes are staged, and --yes only stages: the user approves the publish (see Publishing).
vercel firewall managed-rulesets list # rulesets the team can use, with each rule group's action
vercel firewall managed-rulesets list --json
vercel firewall managed-rulesets enable owasp --yes # OWASP starts with its default rule groups
vercel firewall managed-rulesets disable owasp --yes
vercel firewall managed-rulesets update owasp --group sqli --action deny --yes
vercel firewall managed-rulesets update owasp --group php --action off --yes
vercel firewall managed-rulesets update bot-protection --action challenge --yes # no groups: off, log or challenge
vercel firewall managed-rulesets update ai-bots --group ai-crawlers --action deny --yes # a category change turns AI Bots on
--group takes a rule group ID from list, such as sqli or xss for OWASP. Underscores in catalog IDs become hyphens (ai_crawlers → ai-crawlers).--action takes the ruleset's actions plus off: log, deny or off for OWASP; log, challenge, deny or off for Traffic Sources groups (traffic-source-tor, traffic-source-vpn, traffic-source-proxies, traffic-source-res-proxies, traffic-source-abuse). Bot Protection takes off, log or challenge with no --group. AI Bots takes off, log or deny (allow also means off), per category with --group when the team has categories.enable, update and publish fail and suggest vercel project priority enable, a paid upgrade the user has to run.log, review traffic, then move to deny or challenge. OWASP groups can match legitimate requests (rich text, code snippets, unusual query strings).IP blocking blocks IPs or CIDRs entirely. Staged — requires publish.
vercel firewall ip-blocks list
vercel firewall ip-blocks list --json
vercel firewall ip-blocks block 1.2.3.4 --yes
vercel firewall ip-blocks block 10.0.0.0/24 --hostname example.com --yes # scoped to a host
vercel firewall ip-blocks block 1.2.3.4 --notes "Abuse report #123" --yes
vercel firewall ip-blocks unblock 1.2.3.4 --yes
vercel firewall ip-blocks unblock 1.2.3.4 --hostname example.com --yes # disambiguate when blocked on multiple hosts
vercel firewall ip-blocks unblock ip_abc123 --yes # by rule ID
System bypass rules exempt trusted IPs/CIDRs from system-level mitigations such as DDoS mitigation (office, CI servers, uptime monitors). Pro/Enterprise only. Immediate — no publish.
vercel firewall system-bypass list
vercel firewall system-bypass list --json
vercel firewall system-bypass add 10.0.0.1 --yes
vercel firewall system-bypass add 10.0.0.0/24 --yes
vercel firewall system-bypass add 10.0.0.1 --domain example.com --yes
vercel firewall system-bypass add 10.0.0.1 --domain "*.example.com" --yes # wildcard domain
vercel firewall system-bypass add 10.0.0.1 --notes "Office IP" --yes
vercel firewall system-bypass remove 10.0.0.1 --yes
System bypass does not override your own custom rules — for that, use a custom rule with --action bypass.
Attack Mode is the emergency response for active attacks. Unverified visitors see a challenge page; verified bots and search crawlers are exempt. Immediate — no publish. Requires interactive confirmation; blocked for agents/scripts due to severity.
vercel firewall attack-mode enable --duration 1h --yes # 1h (default)
vercel firewall attack-mode enable --duration 6h --yes
vercel firewall attack-mode enable --duration 24h --yes
vercel firewall attack-mode disable --yes
Vercel automatically mitigates DDoS attacks. In rare cases (debugging false positives) you may need to pause them. Auto-resumes after 24h. Immediate. Blocked for agents/scripts due to severity — pausing removes DDoS protection.
vercel firewall system-mitigations pause --yes # 24h, auto-resume
vercel firewall system-mitigations resume --yes
vercel firewall diff # review staged changes
vercel firewall publish # push drafts to production; prompts for approval
vercel firewall publish --project my-app --confirm-name my-app # approve by naming the project
vercel firewall discard --yes # throw away drafts
From CLI 65.10, publish is approved by naming its target with --confirm-name. --yes still works for people and scripts, with a deprecation warning, but agents can't approve with --yes. Run without approval, an agent gets a confirmation_required error with a preview of what goes live and, in next[], the command to run once the user approves. That command includes --effects-digest, so drafts added after the preview don't go live under the old approval. Older CLIs use publish --yes.
vercel firewall traffic list and vercel firewall traffic inspect are the built-in way to analyze firewall activity without leaving the terminal — useful for the "review traffic" step in the staged rollout, or for spotting which rules are doing real work. Unlike generic vc metrics queries, these succeed on every team plan for the last 24 hours; Observability Plus only extends the retention window to 30 days.
vercel firewall traffic list --since 24h --json # beyond your plan's retention needs Observability Plus
vercel firewall traffic list --action deny --dimension rule --json
traffic list reports requests by action plus top lists across 10 dimensions: ip, ja4, asn, user-agent, path, rule, host, bot, country, action. Use --dimension to choose which top lists to include.traffic inspect <dimension> <value> (e.g. vercel firewall traffic inspect rule rule_abc123 --group-by ip) drills into one value with a breakdown by a second dimension.--since/--until accept 1h, 24h, 3d, 7d, etc., or an ISO date; --json is best for programmatic review.-q, --query <KQL> narrows either command (repeatable, ANDed), using the schema's camelCase dimension names such as clientIp or wafRuleId. Older CLIs call it --filter.--since must fall inside your plan's retention, or the query requires Observability Plus. Shortening the window with --until does not help if --since is already too far back.For an active-attack triage lens — "is something happening right now?" — narrow the window:
vercel firewall traffic list --since 1h --json
vercel firewall alerts list --since 1h --json # DDoS mitigation and other anomaly episodes
Also available: vercel firewall status (config in evaluation order), vercel firewall persistent-actions list/inspect (clients currently under a persistent deny/challenge), and vercel firewall bot-management (Bot Protection, AI Bots, and BotID managed-rule actions plus unknown-bot traffic). Run vercel firewall <subcommand> --help for current flags, and check https://vercel.com/docs/cli/firewall for the full reference. The dashboard URL /firewall/traffic?filter=<ruleId> shows the same data for a human to review.
The firewall sits in front of every request. A misconfigured rule can block real users, kill SEO crawlers, or break checkout. Treat changes like a production database migration: stage, review, and let the user pull the trigger.
Roll new rules out in stages, not in one shot. A new rule's blast radius is unpredictable until real traffic hits it. Walk every meaningful rule through the stages below, asking the user to run vercel firewall publish between each. Don't skip stages even if a rule "obviously" matches only attackers — common JA4s and user agents collide with real users far more often than they look like they will.
Log everywhere. Add the rule with --action log so it records hits to the Firewall dashboard but blocks nothing.
vercel firewall rules add "Block exploit probes" \
--condition '{"type":"path","op":"inc","value":["/wp-admin","/.env","/.git/config","/phpmyadmin"]}' \
--action log --yes
Have the user review traffic in the dashboard. Get the rule ID from the rules add output or vercel firewall rules list --json (look for the id field — rule IDs start with rule_). Read the team and project slugs from .vercel/project.json (orgSlug / projectName) or via vercel project ls. Construct the filtered traffic URL and ask the user to open it:
https://vercel.com/<team>/<project>/firewall/traffic?filter=<ruleId>
Have them confirm only the intended traffic is matching (no real users, no SEO crawlers, no internal tools) before moving on.
Block in preview first. Edit the rule to deny (or challenge) and add an environment = preview condition so production stays in log mode. This lets the user hit a preview deployment and confirm the block fires correctly without exposing real users:
vercel firewall rules update "Block exploit probes" \
--action deny \
--condition '{"type":"path","op":"inc","value":["/wp-admin","/.env","/.git/config","/phpmyadmin"]}' \
--condition '{"type":"environment","op":"eq","value":"preview"}' \
--yes
Have the user publish, then test the affected paths in a preview URL. Re-check the dashboard URL filtered by rule ID to see the blocks land.
Block in production. Once the user is satisfied with the production log data, edit to deny / challenge and have them publish. Keep the dashboard URL handy for the first 24h in case you need to roll back with --action log or rules disable.
Stage drafts; let the user publish. Mutating commands (rules add/update/enable/disable/remove/move, managed-rulesets enable/disable/update, ip-blocks block/unblock) only stage. Run vercel firewall diff to show what will change, then let the user approve the publish. Don't push to production on their behalf. Either ask them to run vercel firewall publish themselves, or run it, show them the preview it returns and run the next[] command only after they approve. Use discard --yes only if the user asks to abandon staged changes.
Don't run commands the CLI blocks for agents. Surface what the user needs to do instead:
vercel firewall rules add --ai "..." and vercel firewall rules add (wizard) — TTY-only. Use --condition flags or --data.vercel firewall attack-mode enable — requires explicit interactive confirmation; have the user run it.vercel firewall system-mitigations pause — pauses platform DDoS protection across the project; have the user run it and resume ASAP.vercel project priority enable — when a rule is refused because the project isn't a Priority project, the CLI points here (vercel buy pro on Hobby). It's a paid upgrade agents can't confirm; have the user decide and run it.Inspect before recommending publish. A deny with a loose condition (e.g., path starts with /) blocks the entire site. Always vercel firewall rules inspect "Name" and vercel firewall diff before handing the publish step to the user.
Tune rate limits gently. Start with a generous --rate-limit-requests (5–10× the expected legitimate rate) and --rate-limit-action log. After the user reviews dashboard data, tighten the limit and switch the action to rate_limit, challenge, or deny.
Keep bypasses narrow. When unblocking trusted automation, scope by a shared-secret header plus an IP or CIDR. Avoid wide-open bypasses (e.g., a single header with a known value an attacker could guess).
Don't over-block. User agents, JA4, and IP addresses may collide with real users far more than they look like they will:
/login once."sub matches like crawler, bot, python, curl, or headless will block legitimate tools (uptime monitors, link previewers, SEO auditors, partner integrations, the user's own CI). For known-good crawlers (Googlebot, Bingbot, Slack/Discord/X unfurlers, etc.) prefer Vercel's verified-bot signals over UA strings (bot_name / bot_category on priority projects, otherwise the managed bot rules, which already let verified bots through), and pair UA conditions with another condition (path, geo, rate) so a single UA token can't take down a whole class of clients.External proxies in front of Vercel reduce firewall and Bot Protection accuracy: real client IPs become opaque, signal reliability drops, legitimate users may be repeatedly challenged. Avoid when you can. If required, use Verified Proxy so Vercel trusts your proxy's headers from a known egress range. https://vercel.com/docs/security/reverse-proxy
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
41 skills in this plugin
/access-protected-vercel-deploymentAccess and test Vercel deployments protected by Vercel Authentication, SSO, or Deployment Protection. Use when curl, agent-browser, Playwright, or another automated request reaches a Vercel login or protection page; when a protected preview or production URL returns 401 or 403; when TRUSTED_SOURCES_ENVIRONMENT_MISMATCH appears; or when choosing between `vercel curl` and the `x-vercel-trusted-oidc-idp-token` header./ai-gatewayVercel AI Gateway guidance for setup, model discovery, authentication, routing, fallbacks, virtual models, evaluation models, BYOK, budgets, spend reporting, observability, compatible APIs, and coding-agent configuration. Use when adding AI Gateway to an app, migrating provider calls, choosing models or providers, centralizing model configuration, evaluating application state, debugging gateway requests, or running `vercel ai-gateway` commands./ai-sdknpx claudepluginhub vercel/vercel-plugin --plugin vercel-pluginOther plugins' skills for the same job