Slack Channel Settings: Connect Your AI Agent to Slack
By Bot It Out Team
Your Bot It Out agent can communicate through Slack using a standard Slack app with Socket Mode. This guide walks through every step — from creating your Slack app to configuring access controls for DMs and channels.
How Slack Works on Bot It Out
Unlike Telegram (which uses BotFather tokens) or WhatsApp (which links a phone number via QR code), Slack uses a full Slack app with two tokens:
Bot Token (xoxb-...) — identifies your app to the Slack API and lets the agent send and receive messages.
App-Level Token (xapp-...) — enables Socket Mode, which means your agent connects to Slack via a persistent WebSocket. No public URL or webhook endpoint needed.
Both tokens are created in the Slack API dashboard when you set up your app.
Step 1: Create a Slack App
The fastest way to get started is using the app manifest that Bot It Out generates for you.
- Open your instance dashboard and go to the Slack channel settings for your package.
- Click **Copy Manifest** to copy the pre-built YAML manifest.
- Go to [api.slack.com/apps](https://api.slack.com/apps) and click **Create New App** > **From an app manifest**.
- Select the workspace where you want the bot.
- Paste the manifest YAML and click through the prompts.
- Slack creates your app with all the right scopes and Socket Mode enabled.
The manifest includes all the OAuth scopes your agent needs: reading and writing messages in channels, DMs, and group DMs, reading user profiles and emails, handling file uploads, and reacting to messages.
Step 2: Get Your Tokens
After creating the app:
Bot Token:
- Go to **OAuth & Permissions** in your Slack app settings.
- Click **Install to Workspace** and authorize the app.
- Copy the **Bot User OAuth Token** (starts with `xoxb-`).
App-Level Token:
- Go to **Basic Information** > **App-Level Tokens**.
- Click **Generate Token and Scopes**.
- Name it anything (e.g., "socket-mode") and add the `connections:write` scope.
- Copy the generated token (starts with `xapp-`).
Paste both tokens into your Bot It Out dashboard and save.
Step 3: Invite the Bot to Channels
Your Slack app is now connected, but it can only see channels it has been invited to. In any Slack channel where you want the agent active, type:
`/invite @YourBotName`
The agent will then receive messages from that channel according to your policy settings below.
DM Access Policies
When someone sends a direct message to your bot in Slack, the DM policy controls what happens.
### Allowlist Only (Default)
Only specific Slack user IDs or email addresses can DM the bot. Everyone else is silently ignored.
You specify allowed users as a comma-separated list. You can mix user IDs (e.g., `U01ABCDEF`) and email addresses (e.g., `[email protected]`).
Best for: Internal company bots where only certain team members should have direct access. Customer-facing bots with a known set of users.
### Open to All
Any member of your Slack workspace can DM the bot and get a response.
Best for: Company-wide assistant bots. Bots where every workspace member should have access. Demo or trial setups.
Note: "Open" means open to your workspace, not the public internet. Only people in your Slack workspace can message the bot.
### Disabled
The agent ignores all direct messages. Useful when you only want the agent active in channels, or when you want to temporarily pause DM access.
Best for: Channel-only bots. Temporarily pausing DM access during maintenance.
Channel/Group Settings
Channel policies control how the bot behaves when invited to Slack channels and group conversations.
### Channel Policy
Disabled — The agent does not respond in any channel, even if invited. It stays completely silent.
Allowlist — The agent only responds in specific channel IDs you define. Even if invited to other channels, it stays silent there. Enter channel IDs as a comma-separated list (e.g., `C01ABC123, C02DEF456`). You can find a channel's ID in Slack by right-clicking the channel name > View channel details > scroll to the bottom.
Open — The agent responds in any channel it has been invited to.
### Mention Behavior
In channels, the bot always requires an @mention to respond. When someone types `@YourBotName` followed by a question, the agent activates. It also responds to direct replies to its own messages.
This is a Slack-specific behavior — the bot never responds to every message in a channel unprompted.
### Custom Mention Patterns
Beyond the standard @mention, you can define custom trigger words that activate the bot. For example: `hey assistant, help me, ask bot`
Comma-separated, case-insensitive. The agent checks each channel message for these patterns and responds if any match.
Best for: Making the bot easier to invoke without typing the full @mention. Teams that prefer a natural trigger word like "hey bot" or "ask assistant".
Common Configuration Examples
### Company-Wide Assistant
- DM Policy: Open
- Channel Policy: Open
- Why: Everyone in the workspace should be able to interact with it anywhere.
### Team-Specific Bot
- DM Policy: Allowlist (team member user IDs)
- Channel Policy: Allowlist (team channels only)
- Why: Only the relevant team can interact with it, keeping it focused.
### Support Bot in a Single Channel
- DM Policy: Disabled
- Channel Policy: Allowlist (one support channel ID)
- Mention Patterns: help me, support
- Why: The bot lives in #support and responds when asked. No DMs, no other channels.
### Executive Assistant
- DM Policy: Allowlist (one person)
- Channel Policy: Disabled
- Why: Private assistant for one user. No channel presence.
### Multi-Department Setup
- DM Policy: Allowlist (department leads)
- Channel Policy: Open
- Mention Patterns: ask bot
- Why: Department leads can DM directly. In channels, anyone can trigger it with @mention or "ask bot".
Multi-Package Considerations
If your instance runs multiple agent packages and more than one has Slack configured, Bot It Out merges the policies automatically:
- Most permissive policy wins. If Package A has DM policy "allowlist" and Package B has "open", the effective DM policy is "open".
- Allowlists are unioned. All user IDs and channel IDs across packages are combined.
- Mention patterns are merged. Custom triggers from all packages are active.
Each package gets its own Slack app (separate bot token and app token), but they share the top-level policy configuration on the instance. This is because Slack's integration layer supports one set of access policies per instance.
Tip: If you need strict isolation between packages, keep their policies aligned or use separate instances.
Changing Settings
You can update Slack channel settings at any time from your instance dashboard. Changes take effect within a few seconds after the gateway restarts.
To fully disconnect Slack:
- Click **Disconnect Slack** in the channel settings. This removes the tokens and stops all Slack message routing for that package.
- If other packages still have Slack configured, their policies are re-merged and remain active.
Troubleshooting
Bot doesn't respond in a channel?
- Make sure you invited it: `/invite @YourBotName`
- Check that the channel policy isn't "disabled" or "allowlist" excluding that channel
- Verify you're @mentioning the bot or using a custom trigger pattern
Bot doesn't respond to DMs?
- Check the DM policy isn't "disabled"
- If using allowlist, verify the user's Slack ID or email is in the list
- User IDs are case-sensitive (e.g., `U01ABCDEF`)
"Socket Mode" errors?
- Verify the App-Level Token (xapp-...) is correct and has the `connections:write` scope
- Check that Socket Mode is enabled in your Slack app settings
Bot appears offline?
- The Bot Token or App-Level Token may be expired or revoked
- Regenerate tokens in your Slack app settings and update them in Bot It Out