Slack Integration Guide
Bring your Sutra agents directly into Slack — where your team already communicates. Agents respond to @mentions in channels, handle DMs, and process approval requests with interactive buttons. Your team gets AI-powered assistance without leaving their primary workspace.
Setup
1. Create a Slack App
- Go to api.slack.com/apps and click Create New App.
- Choose From scratch, name your app (e.g., "Sutra Bot"), and select your workspace.
- Under Features > OAuth & Permissions, scroll down to Scopes. Add the following Bot Token Scopes:
app_mentions:readchat:writechannels:historygroups:history- Scroll up and click Install to Workspace.
- Copy the Bot User OAuth Token (starts with
xoxb-...).
app_mentions:read lets the bot see when it's @mentioned. chat:write lets it post responses. channels:history and groups:history let it read message context in public and private channels. If your agents need to read direct messages, also add im:history. For file uploads, add files:write.2. Enable Events (Socket Mode or Webhooks)
To receive messages in real-time, Sutra needs to listen to Slack events.
Using Socket Mode (Recommended for internal networks):
1. In your Slack App settings, go to Socket Mode and enable it.
2. Generate an App-Level Token (starts with xapp-...).
3. Go to Event Subscriptions, enable events, and subscribe to the app_mention and message.channels bot events.
Using Webhooks (If Sutra is publicly accessible):
1. Go to Event Subscriptions and enable it.
2. Enter your Sutra webhook URL (e.g., https://sutra.mycompany.com/api/webhooks/slack).
3. Subscribe to the app_mention bot event.
3. Configure Sutra
In the Sutra UI, go to Settings > Configuration (Integrations group), or update your .env file:
SLACK_BOT_TOKEN=xoxb-...
# If using Socket Mode:
SLACK_APP_TOKEN=xapp-...
# If using Webhooks, you'll need the Signing Secret:
SLACK_SIGNING_SECRET=your_signing_secret
Using Agents in Slack
Connecting Channels to Agents
Unlike Telegram, where you /connect a bot to an agent, Slack channels are typically mapped to specific agents in the Sutra UI.
- Go to Agents and edit the agent you want to place in Slack.
- In the configuration, enter the Slack Channel ID (e.g.,
C1234567890) where this agent should reside. - Invite the Sutra Bot to that channel in Slack (
/invite @Sutra Bot).
C1234567890). Alternatively, open the channel in a browser — the ID is the last segment of the URL.You can map multiple channels to different agents, creating specialized support zones within your Slack workspace. For example, map #engineering-help to your DevOps agent, #marketing-ideas to your Content Strategist agent, and #data-questions to your Data Analyst agent.
Interacting
- Mentions: Simply
@mentionthe bot in the channel. The agent mapped to that channel will receive the message, process it, and reply in a thread to keep the channel clean. - Example:
@SutraBot can you summarize the deployment status? - Direct Messages: You can also DM the Sutra Bot directly. DMs are typically routed to a default "Assistant" agent, providing a private workspace for individual employees.
Agent responses in channels are always posted as threaded replies to keep the main channel clean. For longer conversations, the agent maintains full context within the thread — so follow-up questions work naturally without re-explaining the context.
Approvals via Slack
If configured, Sutra can route Human-in-the-Loop approval requests directly to a specific Slack channel (e.g., #ops-approvals). The message will include interactive Block Kit buttons (Approve / Reject), allowing managers to authorize agent actions without leaving Slack.
Approval messages include full context: the agent's name, the action it wants to take, the risk level, and the exact payload. Managers can review and decide without needing additional context. Approved actions execute immediately; rejected actions send feedback to the agent, which can adjust and resubmit.
#sutra-approvals channel and route all approval requests there. This gives your team a single place to monitor and manage agent requests, and makes it easy to set up Slack notifications so approvals never sit waiting.