---
title: "Turn On Attack Mode"
description: "Practice the incident moves you hope to never need. Subscribe to the Firewall's DDoS attack alerts so a real attack finds you, send a small, capped flood at your own deployment, enable Attack Mode from the CLI, check what gets challenged, including the payment webhook, then turn it off and put the Firewall back in production shape."
canonical_url: "https://vercel.com/academy/vercel-firewall/turn-on-attack-mode"
md_url: "https://vercel.com/academy/vercel-firewall/turn-on-attack-mode.md"
docset_id: "vercel-academy"
doc_version: "1.0"
last_updated: "2026-11-17T18:26:12.088Z"
content_type: "lesson"
course: "vercel-firewall"
course_title: "Protect Your App on Vercel"
prerequisites:  []
---

<agent-instructions>
Vercel Academy — structured learning, not reference docs.
Lessons are sequenced.
Adapt commands to the human's actual environment (OS, package manager, shell, editor) — detect from project context or ask, don't assume.
The lesson shows one path; if the human's project diverges, adapt concepts to their setup.
Preserve the learning goal over literal steps.
Quizzes are pedagogical — engage, don't spoil.
Quiz answers are included for your reference.
</agent-instructions>

# Turn On Attack Mode

# Turn on Attack Mode

It's 11:02 on a Saturday in July. The preorder page won't load, Marguerite is texting, and you're searching "vercel attack mode" with one thumb. Let's make sure that day goes differently. This lesson is a drill: the flood you're about to send is a few hundred page loads from your own laptop, nowhere near a real attack.

## Outcome

You get DDoS attack alerts where you'll see them, you can turn Attack Mode on and off from the CLI, and you know what it challenges and what it lets through on Claw & Order.

## What Attack Mode does

[Attack Mode](https://vercel.com/docs/vercel-firewall/attack-mode) makes every visitor pass a security challenge before they reach the site. Browsers pass it in a moment. [Known bots](https://vercel.com/docs/bot-management#verified-bots) like search crawlers and many webhook providers skip it, and so do your own Vercel Functions and Cron Jobs. It's [free on all plans](https://vercel.com/docs/vercel-firewall/attack-mode#pricing). You flip it when something is overwhelming the site and you don't know enough yet to write a rule.

## Know when it's real

On every plan, DDoS mitigation raises a [Firewall alert](https://vercel.com/docs/vercel-firewall/firewall-observability#ddos-attack-alerts) when it sees a large attack on your project. An alert only helps if it reaches someone, so send it somewhere you already look.

On every plan, that's Slack. You need a Slack workspace where you're allowed to add apps. Add the [Vercel app for Slack](https://vercel.com/marketplace/slack) to it, then in the channel your team watches, subscribe with your [team ID](https://vercel.com/docs/accounts#find-your-team-id):

```text
/vercel subscribe <team_id> firewall_attack
```

No Slack workspace? Alerts still show up in the alerts section of the project's **Firewall** page and in `vercel firewall alerts list`. Make checking them part of your routine when the site feels slow.

Alerts also land in the CLI, which is where you'll start when one fires:

```bash
vercel firewall alerts list --since 7d
```

No alerts, and this drill is far too small to trigger one. When a real one arrives, `vercel firewall alerts inspect <alert-id>` shows its window and the denied IPs, and `traffic list --alert <alert-id>` scopes the report to it.

### Pro and Enterprise: alerts to a webhook

\*\*Note: Optional: Pro and Enterprise\*\*

[Account webhooks](https://vercel.com/docs/webhooks) are available on Pro and Enterprise. Check the docs for current availability on your plan.

In your team's settings, [create a webhook](https://vercel.com/docs/webhooks#configure-a-webhook) with the attack detected firewall event checked (currently **Attack Detected**) and the `claw-and-order` project selected. Point it at whatever pages your on-call person.

## The flood

Send the flood before anything is on, so you have something to compare against:

```bash
npm run scalper -- flood --target "$URL"
```

```text
flood drill (page loads) → https://claw-and-order.vercel.app  (300 requests)
Only point this at a deployment you own.

Results
  200            300
```

Three hundred loads of the preorder page, all served. Bot Protection is still on log from 5.1, so it watched and let them in.

## Turn it on

Attack Mode changes take effect immediately. There's no draft and no publish step:

```bash
vercel firewall attack-mode enable --duration 1h --yes
```

`--duration` is a safety net: if you forget to turn it off, it turns itself off.

Run the flood again:

```bash
npm run scalper -- flood --target "$URL"
```

Every request is challenged. Now open the home page in your browser.

You'll see a brief challenge, then the truck. Every customer waits a moment, and automated traffic Vercel doesn't recognize stops at the checkpoint.

## Oh no, TidePay again

Place a lunch order in the browser, then send its payment:

```bash
npm run webhook -- <order-id> --target "$URL"
```

Challenged. The `TidePay webhook` bypass from 4.2 doesn't help, because Attack Mode runs before custom rules (`vercel firewall status` shows the order). Webhook providers Vercel recognizes pass automatically. TidePay isn't one, so its payments stall until Attack Mode is off.

Write this down somewhere you'll find it during a real incident: Attack Mode pauses any automated traffic Vercel doesn't recognize. On your app that might be a partner's integration or your own scripts running outside Vercel.

### Pro and Enterprise: keep payments flowing

\*\*Note: Optional: Pro and Enterprise\*\*

[System bypass rules](https://vercel.com/docs/vercel-firewall/vercel-waf/system-bypass-rules) are available on Pro and Enterprise. Check the docs for the current limits on your plan.

A system bypass runs first in the Firewall's order, ahead of Attack Mode, and lets specific IP addresses or ranges skip system-level mitigations. If a provider Vercel doesn't recognize publishes the IPs its webhooks come from, a system bypass keeps payments flowing during an incident:

```bash
vercel firewall system-bypass add <provider-cidr> --notes "TidePay webhooks" --yes
vercel firewall system-bypass list
```

It takes effect immediately, with no publish step, and covers every domain on the project unless you pass `--domain`. For this drill, read along: TidePay runs from your laptop, and bypassing your own IP would let the flood through too. Set this up for your real providers on a quiet Tuesday.

## Turn it off and put things back

Turn Attack Mode off, then end drill mode by switching Bot Protection back to challenge:

```bash
vercel firewall attack-mode disable --yes
vercel firewall rules update bot-protection --action challenge --yes
vercel firewall publish --confirm-name claw-and-order
```

Check the whole configuration, in the order it runs:

```bash
vercel firewall status
```

Compare it to 1.2: the same platform protections underneath, with three custom rules, Bot Protection, and AI Bots on top. Here's the whole set, in the order it runs:

- Attack Mode off, and no IP blocks.
- `TidePay webhook`: bypass for `POST /api/webhooks/payment`, first.
- `Pinchy's scraper`: deny when the user agent contains `PinchyScout` on `/` or `/location`.
- `Preorder rush`: rate limit `POST /api/preorder` to 40 requests per 600 seconds per IP.
- Bot Protection on challenge.
- AI Bots denying AI crawlers and allowing AI assistants.

There's no reference snapshot to diff against. Your `status` output matching this list is the check.

## Hands-on exercise 5.3

Set up alerts, then run the drill end to end.

**Requirements:**

1. Subscribe to DDoS attack alerts in Slack, or find the alerts section on the **Firewall** page if you don't have a Slack workspace. Run `vercel firewall alerts list`.
   - Optional, Pro and Enterprise: send the attack detected event to a webhook.
2. Send the flood with Attack Mode off and confirm it's served.
3. Enable Attack Mode for one hour.
4. Send the flood again and confirm it's challenged.
5. Load the site in your browser and pass the challenge.
6. Send a TidePay payment and confirm it's challenged too.
7. Disable Attack Mode, set Bot Protection back to challenge, and publish.
8. Confirm with `vercel firewall status`, then snapshot your rules and commit.

**Implementation hints:**

- Attack Mode, system bypass, and system mitigations apply immediately. Custom rules and managed rule actions are staged until you publish.
- The flood is capped at 500 requests even if you pass a bigger `--count`. Leave it at the default.
- Keep `vercel firewall attack-mode disable --yes` somewhere you can find it in a hurry.

## Try It

After everything is back, place a fresh lunch order in the browser. Orders expire after a day, so an id from an earlier session can come back `404 Unknown order`.

```bash
npm run webhook -- <order-id> --target "$URL"
npm run scalper -- flood --target "$URL" --count 20
```

TidePay gets through again. The flood's page loads get challenged by Bot Protection, because a script isn't a browser, and your browser loads the site without a challenge page.

## Commit

```bash
vercel firewall rules list --json > firewall/rules.json
git add firewall/rules.json
git commit -m "chore(firewall): end Attack Mode drill, Bot Protection back to challenge"
```

## Done-When

- [ ] DDoS attack alerts go to a Slack channel you watch, or, without Slack, you've found them on the **Firewall** page and in `alerts list`
- [ ] Optional, Pro and Enterprise: a webhook receives the attack detected event
- [ ] You've seen the flood served with Attack Mode off and challenged with it on
- [ ] You've passed the Attack Mode challenge in your browser
- [ ] You've seen the TidePay webhook challenged during Attack Mode
- [ ] Attack Mode is off and Bot Protection is on challenge
- [ ] `vercel firewall status` matches the final rule set above
- [ ] `firewall/rules.json` is committed

## Troubleshooting

**Your browser keeps showing the challenge page.** Try a private window with extensions turned off. If it passes there, something in your usual browser setup is getting in the challenge's way.

**`/vercel subscribe` says the team isn't connected.** The Vercel app for Slack has to be added to your Vercel team before it can subscribe. Follow the [Slack app guide](https://vercel.com/docs/comments/integrations#use-the-vercel-app-for-slack), then run the command again in the channel.

**`attack-mode enable` says you don't have permission.** Attack Mode needs at least the member role on the team. Ask a team owner, or run the drill on a project in your personal Hobby team.

## Solution

Alerts first, then the whole drill:

```text
/vercel subscribe <team_id> firewall_attack
```

```bash
vercel firewall alerts list --since 7d
npm run scalper -- flood --target "$URL"
vercel firewall attack-mode enable --duration 1h --yes
npm run scalper -- flood --target "$URL"
npm run webhook -- <order-id> --target "$URL"

vercel firewall attack-mode disable --yes
vercel firewall rules update bot-protection --action challenge --yes
vercel firewall publish --confirm-name claw-and-order
vercel firewall status

vercel firewall rules list --json > firewall/rules.json
git add firewall/rules.json
git commit -m "chore(firewall): end Attack Mode drill, Bot Protection back to challenge"
```

Attack Mode is off and Bot Protection is back on challenge. The day you need the big switch, it won't be the first time you've flipped it.

That's the main path. The Firewall page looked the same on day one, already working and knowing nothing about lobster rolls. Now it knows Pinchy's, the preorder bot, TidePay, and a hungry office at Harborview, and you can read what it did to each of them. If your truck becomes a chain, 5.4 is waiting.


---

[Full course index](/academy/llms.txt) · [Sitemap](/academy/sitemap.md)
