> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flarebot.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Anti Nuke

> Detect and neutralize rogue admins and catastrophic server attacks instantly.

## Overview

AntiNuke is Flare's most critical security module. It actively monitors Discord's audit logs for suspicious, rapid administrative actions—such as mass-banning members, deleting channels, or creating malicious webhooks.

When an attack is detected, Flare instantly revokes the attacker's permissions, issues a punishment (like a ban), and attempts to quarantine the damage.

### Why should I use it?

Even trusted administrators can have their accounts compromised by phishing links. Without AntiNuke, a compromised admin account can delete years of server history in seconds.

## Requirements

<Warning>
  **Crucial Requirement**: Flare **MUST** have the `Administrator` permission and its role must be placed at the highest possible position in the role hierarchy. Flare cannot punish users who have a higher role than it.
</Warning>

## Configuration

Setting up AntiNuke requires defining the threshold (how many actions trigger the nuke) and the punishment.

<Tabs>
  <Tab title="Dashboard">
    1. Go to **Modules > Anti Nuke**.
    2. Toggle the module **On**.
    3. Under **Events**, check the actions you want to monitor (Mass Ban, Mass Kick, Channel Deletion, etc.).
    4. Set the **Thresholds** (e.g., 3 bans per 10 seconds).
    5. Select the **Punishment** from the dropdown (Ban, Kick, Remove Roles).
  </Tab>

  <Tab title="Commands">
    Enable the system globally and set the punishment:

    ```bash theme={null}
    /antinuke enable
    /antinuke punishment set ban
    ```

    Configure specific event thresholds:

    ```bash theme={null}
    /antinuke threshold bans 3
    /antinuke threshold channels 2
    ```
  </Tab>
</Tabs>

## Events Monitored

Flare's AntiNuke currently tracks the following vectors:

| Event                | Description                     | Recommended Threshold |
| -------------------- | ------------------------------- | --------------------- |
| **Mass Ban**         | User bans multiple members.     | 3 bans / 10s          |
| **Mass Kick**        | User kicks multiple members.    | 3 kicks / 10s         |
| **Channel Deletion** | User deletes multiple channels. | 2 deletions / 10s     |
| **Role Deletion**    | User deletes multiple roles.    | 2 deletions / 10s     |
| **Webhook Creation** | User creates multiple webhooks. | 2 creations / 10s     |
| **Bot Addition**     | User invites unauthorized bots. | 1 bot / 10s           |

## Whitelisting

Some bots (like backup bots or levelling bots) might trigger AntiNuke when doing routine tasks. You must whitelist them.

```bash theme={null}
/antinuke whitelist add @Bot
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Flare ignored a mass-ban attack">
    Check the audit logs. If the attacker was the Server Owner, Flare cannot take action against them (Discord API restriction). If it was an admin, check if Flare's role is positioned above the attacker's role.
  </Accordion>

  <Accordion title="Legitimate mods are getting banned">
    Your thresholds might be too low. If your mods regularly ban 3 people in 10 seconds during raids, you should increase the threshold to `5` or `10`.
  </Accordion>
</AccordionGroup>

## Related Pages

* [AutoMod Configuration](/modules/automod)
* [Protect My Server Recipe](/recipes/protect-my-server)
