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

# Security overview

> Four independent protection layers, and which one you actually need.

Server protection is split into four systems that don't overlap. They solve genuinely different problems, and turning on the wrong one for your threat means you're still exposed.

<CardGroup cols={2}>
  <Card title="Antinuke" icon="explosion" href="/security/antinuke">
    Stops **staff and compromised admins** mass-deleting channels, roles or members. Reverts what it can, punishes whoever did it.
  </Card>

  <Card title="Antiraid" icon="users-slash" href="/security/antiraid">
    Stops **outsiders** — join floods, brand-new accounts, spam waves, mention spam.
  </Card>

  <Card title="Automod" icon="filter" href="/security/automod">
    Blocks **message content** — banned words, links, invites, mention counts — using Discord's native AutoMod.
  </Card>

  <Card title="Honeypot" icon="crosshairs" href="/security/honeypot">
    Catches **compromised accounts** with a bait channel, then fingerprints their scam images and blocks them server-wide.
  </Card>
</CardGroup>

## Which do I need?

<AccordionGroup>
  <Accordion title="I have staff I don't fully trust" icon="user-shield">
    **Antinuke.** It's the only layer that watches people who already have permissions. Set thresholds on ban, kick, channel, role, webhook and emoji, turn on `antinuke bot` so nobody can sneak an app in, and whitelist only the handful of people who genuinely do bulk work.
  </Accordion>

  <Accordion title="We keep getting raided" icon="users-slash">
    **Antiraid**, specifically `massjoin` and `newaccount`. Both pause invites for a set duration when they trigger, which is what actually stops a raid rather than cleaning up after one. Add `automation` if the raiders are using selfbots.
  </Accordion>

  <Accordion title="People post scam links or images" icon="link-slash">
    **Honeypot** plus **automod links**. The honeypot catches compromised accounts before they reach a real channel; the link filter handles everything else.

    Then turn on `honeypot scan on`. It perceptually fingerprints every scam image it sees and blocks that image across the whole server — surviving re-compression, cropping and recolouring, so a campaign that rotates its wording gets caught by the graphic it keeps reusing. `!honeypot blacklist add` on a reply adds anything that slips through.
  </Accordion>

  <Accordion title="Chat is a mess" icon="comment-slash">
    **Automod** — the word filter, invite filter, and mention limits. Discord enforces these itself, so they apply instantly with no bot round-trip. Pair it with [warn thresholds](/moderation/warnings) so repeat offenders escalate on their own.
  </Accordion>

  <Accordion title="I want mods without giving out real permissions" icon="key">
    **[Fake permissions](/security/fake-permissions).** Grant a role the ability to use `ban` through mira without giving it Discord's Ban Members permission. If they lose access to the bot, they lose the ability entirely.
  </Accordion>
</AccordionGroup>

## The recommended baseline

Copy-pasteable. Adjust the thresholds to your server's size.

```javascript theme={null}
// Antinuke — punish anyone who mass-destroys anything
!antinuke ban on --threshold 3 --duration 1h
!antinuke kick on --threshold 5 --duration 1h
!antinuke channel on --threshold 3 --duration 1h
!antinuke role on --threshold 3 --duration 1h
!antinuke webhook on --threshold 2 --duration 1h
!antinuke emoji on --threshold 5 --duration 1h
!antinuke bot on
!antinuke permissions on
!antinuke punishment ban

// Antiraid — pause invites when a raid starts
!antiraid channel #alerts
!antiraid massjoin on 30s --threshold 8 --punishment ban
!antiraid newaccount on 7d --punishment kick
!antiraid mentionspam on --threshold 6 --punishment timeout
!antiraid spam on --threshold 8 --punishment timeout --for 10m

// Automod — content filtering
!automod invites on
!automod links on
!automod mentions on 6

// Honeypot — bait channel for compromised accounts
!honeypot setup
!honeypot punishment ban
!honeypot scan on
```

<Warning>
  Before turning any of this on, **whitelist yourself and your most senior admin**. Antinuke will happily ban the server owner's alt if it trips a threshold, and getting locked out of your own server is a bad afternoon.

  ```javascript theme={null}
  !antinuke whitelist @you
  !antinuke trust @cofounder
  !antiraid whitelist @you
  ```
</Warning>

## How they interact

They run independently and can all fire on the same event — which is fine, because each is checking something different. A raider who joins during a mass-join wave, posts a scam link and mass-mentions in one message will trip antiraid, automod and the honeypot at once. Whichever punishment lands first sticks.

The one thing to watch: if antiraid's punishment is `ban` and antinuke's ban threshold is low, mass-banning raiders can look like a nuke. mira's own actions are exempt from its antinuke, so this doesn't actually happen — but if you have *another* bot doing the banning, whitelist it.

```javascript theme={null}
!antinuke whitelist @OtherBot
```

## Checking your setup

```javascript theme={null}
!antinuke settings
!antiraid settings
!honeypot settings
!automod
```

Each shows what's enabled, the thresholds, the punishment, and who's exempt. `!configuration` gives you a shorter overview across every module at once.

## What to do during an attack

<Steps>
  <Step title="Pause invites">
    ```javascript theme={null}
    !antiraid pause 30m
    ```

    Stops new accounts arriving while you deal with the ones already inside. Discord also disables DMs from server members for the duration.
  </Step>

  <Step title="Lock the server">
    ```javascript theme={null}
    !lockdown all
    ```

    Every channel goes read-only. `!unlockdown all` when it's over — it only unlocks what it locked, so channels that were already private stay private.
  </Step>

  <Step title="Clean up">
    ```javascript theme={null}
    !purge bots 100
    !purge invites 100
    !massban 111111 222222 333333 --history 1d
    ```
  </Step>

  <Step title="Undo the damage">
    If antinuke caught it, its alert message has a **restore** button that recreates deleted roles and channels with their original permissions and members. Otherwise:

    ```javascript theme={null}
    !backup
    ```
  </Step>

  <Step title="Resolve the state">
    ```javascript theme={null}
    !antiraid resolve
    ```

    Lifts the automatic invite pause and channel locks that antiraid applied.
  </Step>
</Steps>
