Safeguard Docs
Integrations

Discord

Send Safeguard notifications to a Discord channel. The bot permissions or webhook Safeguard needs, which tokens work, and step-by-step setup.

What it does

The Discord card sends Safeguard notifications (new findings, scan results and alerts) to a channel on your Discord server. Find the card under Integrations on the Notification tab.

Public vs private

This does not apply to Discord: you always connect a channel on a server you manage. A bot can post to any channel it can see; a webhook posts to the one channel it was created in.

Supported auth methods

Method (dialog label)Use it whenNotes
Bot Token (Full Access)You want to pick the server and channel from a listThe token of a bot in a Discord application you own, added to your server
Webhook URL (Send Only)You want the smallest possible grantA channel webhook URL (https://discord.com/api/webhooks/...)

Permissions required

Safeguard only posts messages and lists servers and channels. It never reads messages, members or roles.

Bot token

Bot permission or callRequired?What Safeguard uses it for
bot scope when you add the bot to the serverRequiredAdding the bot to your server so it can list it (/users/@me/guilds) and its channels
Send MessagesRequiredPosting notifications to the channel
View ChannelsRequiredSeeing the notification channel
Embed LinksOptionalShowing notification embeds

The token is checked with GET /users/@me, which needs no permission.

Webhook URL

PermissionRequired?What Safeguard uses it for
The webhook URL itselfRequiredPosting to that webhook's channel. Discord needs no other authentication for a webhook
Manage Webhooks (for the person creating it)RequiredCreating the webhook in Discord

Least privilege: a webhook URL, or a bot with only View Channels and Send Messages on the notification channel.

Token types

Token typeWorks?Notes
Bot token of your own Discord applicationYesSent as Authorization: Bot <token>
Channel webhook URLYes (recommended for least privilege)Send only; no server or channel list
A user account tokenNoThe dialog takes a bot token
OAuth2 client secretNoThe dialog needs the bot token, not the client secret

Expiry: bot tokens and webhook URLs do not expire. Reset the bot token or delete the webhook to revoke them.

What we never need: Administrator, Manage Server, Manage Channels, Manage Roles, Read Message History or any privileged gateway intent.

Step-by-step setup

Create the credential in Discord

Webhook:

  1. In Discord, open the channel's settings and go to Integrations > Webhooks.
  2. Create a webhook, give it a name, and copy its URL. Anyone with the URL can post to the channel.

Bot token:

  1. In the Discord Developer Portal, create an application and open its Bot settings. Copy the bot token (reset it if it is hidden).
  2. Build an authorization link with the bot scope and the permissions View Channels and Send Messages (plus Embed Links), and open it to add the bot to your server.
  3. Make sure the bot can see the notification channel.

Or check it with curl

# Bot token
curl -s -H "Authorization: Bot $DISCORD_BOT_TOKEN" https://discord.com/api/v10/users/@me
# Webhook URL (returns the webhook without posting)
curl -s "<webhook-url>"

Connect it in Safeguard

  1. Open Integrations and choose the Notification tab.
  2. Click Connect on the Discord card.
  3. Enter an Integration Name and, optionally, a description.
  4. Choose the Authentication Type:
    • Bot Token (Full Access): paste the Bot Token. "Connected as bot:" appears; then choose the server and channel under Server & Channel.
    • Webhook URL (Send Only): paste the Webhook URL.
  5. Click Next, then Connect.

Webhooks and triggers

This card only sends messages to Discord; it does not receive Discord events. Safeguard posts when the events you subscribed to happen (for example a scan finishing or a new critical finding).

What we read and store

  • Read: with a bot token, the bot's identity, the servers it is in, and their channels.
  • Stored: the connection's name, server and channel, and the bot token or webhook URL. Safeguard never shows them again in the dialog.
  • Sent to Discord: notification text about your Safeguard projects and findings.
  • No customer data from this integration is sent to third-party LLMs.

Troubleshooting

Message you seeCauseFix
Discord validation failed: ... or Unable to validate Discord credentialsDiscord refused the bot token (reset, mistyped, or a client secret was pasted)Copy the bot token from the application's Bot settings again
Invalid Discord webhook URL formatThe URL does not start with https://discord.com/api/webhooks/Copy the webhook URL from the channel's Integrations settings
Invalid Discord webhook URLDiscord does not know this webhook (deleted, or the token part is wrong)Create a new webhook and paste its URL
Failed to fetch channels for selected serverThe bot is not in the server, or cannot see its channelsAdd the bot with the bot scope, and give it View Channels
Messages do not arriveThe bot lacks Send Messages in the channelGrant Send Messages on the channel

Rotation and disconnect

  • Rotate: reset the bot token in the Developer Portal (or create a new webhook), open the Discord connection on the Notification tab, choose Update, paste the new value and choose Save Changes.
  • Disconnect: choose Delete on the connection, then delete the webhook or remove the bot from your server.

Vendor references

On this page