# Anti-Raid

> Anti-Raid protects your server from mass join attacks using a configurable score-based detection system.

## How It Works

Anti-Raid assigns risk scores to new members based on account characteristics. When the combined score of recent joins exceeds your threshold, Security can lock the server and punish detected raiders.

## Score Calculation

Each new member is evaluated on these factors:

| Factor          | Description                               | Risk Indicator                       |
| --------------- | ----------------------------------------- | ------------------------------------ |
| **Account Age** | How old the Discord account is            | New accounts = higher risk           |
| **Join Speed**  | Time since the previous member joined     | Rapid joins = higher risk            |
| **Avatar**      | Whether the account has a profile picture | No avatar = higher risk              |
| **Normal Join** | Passes all checks above                   | Base score (can still assign points) |

You configure how many points each factor adds to a user's score.

## Score Limit

The score limit is your threshold for triggering raid protection:

* Security tracks the combined score of all users who joined in the last X minutes
* When this combined score reaches your limit, protection activates
* All flagged users can be punished automatically
* The server can be locked to prevent new joins

## Changing Scores

Configure scores through the dashboard:

1. Go to [securitybot.gg](https://securitybot.gg/) and log in
2. Select your server from the dashboard
3. Navigate to the **Anti-Raid** category
4. Adjust the score values in the third row
5. Click **Save**

## Bypass Options

Certain users can bypass Anti-Raid detection:

| Bypass Condition           | Description                                               |
| -------------------------- | --------------------------------------------------------- |
| **Discord Badge**          | Users with specific Discord badges (Nitro, Partner, etc.) |
| **Account Created Before** | Users who created their account before a specific date    |

> **Note:** All bypass options are optional and can be enabled/disabled based on your needs.

## Recommended Settings

| Server Type   | Score Limit | Account Age Score | Rapid Join Score |
| ------------- | ----------- | ----------------- | ---------------- |
| High Security | 10-15       | 5                 | 3                |
| Standard      | 20-30       | 3                 | 2                |
| Lenient       | 40-50       | 2                 | 1                |

## Tips

* Start with stricter settings and loosen them if you get false positives
* Enable the badge bypass to reduce false positives on legitimate users
* Monitor raid attempts in your logs to tune your settings
* Consider using [Verification](https://docs.securitybot.gg/other-modules/verification) alongside Anti-Raid for additional protection

## Related

* [Verification](https://docs.securitybot.gg/other-modules/verification) - CAPTCHA verification for new members
* [Beast Mode](https://docs.securitybot.gg/other-modules/beast-mode) - Global score-based protection
* [Anti-Nuke](https://docs.securitybot.gg/anti-nuke/anti-nuke) - Protection against internal threats


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.securitybot.gg/other-modules/anti-raid.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
