> For the complete documentation index, see [llms.txt](https://docs.securitybot.gg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.securitybot.gg/protection/anti-raid.md). Agents can also search and read this documentation through its [MCP server](https://docs.securitybot.gg/~gitbook/mcp).

# Anti-Raid

Score new joins and lock down during a raid.

{% hint style="warning" %}
**Premium.** Anti-Raid runs on the Premium Bot. Free servers get raid-aware [Adaptive verification](https://docs.securitybot.gg/verification/verification/types.md#adaptive) instead.
{% endhint %}

Every new member adds points to a raid score. When the score hits your limit, Security Bot punishes the joins and can lock channels.

<figure><img src="https://3518259152-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQwAXme9ouKllbB2Vwt%2Fuploads%2Fgit-blob-1d77d65405094a75760dbd7d2b43e2ffdb9ef3cb%2Fanti-raid.png?alt=media" alt="Anti-Raid page with score, punishment and lockdown settings"><figcaption></figcaption></figure>

## Set it up

1. Open your server on [securitybot.gg](https://securitybot.gg) and go to **Anti-Raid**.
2. Switch it on.
3. Set the **Raid score**, **Punishment** and **Lockdown**.
4. Adjust the **Raid score rules**.
5. Click **Save changes**.

## Options

### Raid score

| Option      | Range             | What it does                              |
| ----------- | ----------------- | ----------------------------------------- |
| Score limit | 10 to 5,000       | A raid starts at this score               |
| Reset after | 10 to 200 minutes | The score goes back to 0 on this schedule |

### Punishment

| Option | What it does                                           |
| ------ | ------------------------------------------------------ |
| Mute   | Times out raid joins, up to 28 days                    |
| Ban    | Bans raid joins. 0 means permanent, or up to 365 days. |
| None   | Logs only                                              |

### Lockdown

Locks the channels you choose when a raid starts, for 2 minutes to 3 days. Pick text channels with **Choose channels**.

### Raid score rules

| Rule               | Adds points when                                       |
| ------------------ | ------------------------------------------------------ |
| Account age        | The account is younger than the age you set            |
| Join row           | The member joined within a few seconds of the last one |
| No profile picture | The account has no avatar                              |
| Normal join        | No other rule matched                                  |

### Bypass

**Account age bypass** skips accounts older than the age you set.

## Clean up after a raid

`/raid ban minimum_score join_time ban_duration` bans recent joins with at least that score. For example, everyone with 20 points who joined in the last hour.
