> ## Documentation Index
> Fetch the complete documentation index at: https://contract-auditor.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Notifications

> Push verified drift to Slack or Telegram from CI.

```bash theme={null}
python3 auditor/notify.py --run reports/runs/agent --min-severity high
```

## Three rules

| Rule                            | Effect                                                                          |
| ------------------------------- | ------------------------------------------------------------------------------- |
| Only verified findings are sent | Anything the gate did not confirm stays out                                     |
| Silence is the default          | A clean run sends nothing. `--notify-empty` opts in                             |
| Alerts are capped               | Worst 10 findings, then "+37 more". Slack allows 50 blocks, Telegram 4096 chars |

## Configure

<Tabs>
  <Tab title="Slack">
    Create an [Incoming Webhook](https://api.slack.com/messaging/webhooks), then:

    ```bash theme={null}
    echo 'SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T00/B00/xxxx' >> .env
    ```
  </Tab>

  <Tab title="Telegram">
    Create a bot with [@BotFather](https://t.me/botfather), add it to the group,
    then:

    ```bash theme={null}
    echo 'TELEGRAM_BOT_TOKEN=123456:ABC-DEF...' >> .env
    echo 'TELEGRAM_CHAT_ID=-1001234567890' >> .env
    ```
  </Tab>
</Tabs>

Set up either or both. A channel you have not configured is skipped, and that is
not an error.

## Preview without sending

```bash theme={null}
python3 auditor/notify.py --run reports/runs/agent --dry-run
```

Prints the exact payloads. Works with no credentials configured.

## Block a merge

```bash theme={null}
python3 auditor/notify.py --run reports/runs/agent --fail-on critical
```

Exits `2` when a finding is at or above the given level. Send failures exit `1`,
so CI can tell "API is broken" from "Slack is down".

## Options

| Flag             | Default              | Effect                                   |
| ---------------- | -------------------- | ---------------------------------------- |
| `--run`          | `reports/runs/agent` | Run directory or single findings file    |
| `--min-severity` | `high`               | `critical`, `high`, `medium`, `low`      |
| `--title`        | run directory name   | Name shown in the alert                  |
| `--report-url`   | none                 | Link included in the alert               |
| `--unverified`   | off                  | Send claims that did not pass the gate   |
| `--notify-empty` | off                  | Send an all-clear when nothing was found |
| `--fail-on`      | none                 | Exit `2` at or above this level          |
| `--dry-run`      | off                  | Print payloads instead of sending        |
