Slack
Connect an agent to Slack so people can DM it or @mention it in channels
Connect an agent to a Slack workspace. People can then DM the bot, or @mention it in a channel and get the reply in a thread. Replies stream into one live message, approval-gated tools show Approve / Deny buttons, and Mermaid diagrams are posted as images.
You need:
- An agent in the AgentBlit console.
- Permission to create and install apps in the Slack workspace.
Each Slack workspace can be connected to one agent. Connecting the same workspace a second time fails with This Slack workspace is already connected to an agent.
Values at a glance
Every Slack setting this guide uses. Copy them exactly.
| Slack setting | Value |
|---|---|
| Event Subscriptions → Request URL | Webhook URL from the channel card (below) |
| Interactivity & Shortcuts → Request URL | The same webhook URL |
| Bot token scopes | app_mentions:read, chat:write, im:history, files:write |
| Bot events | app_mention, message.im |
| Interactivity | On |
| App Home → Messages Tab | On, with Allow users to send Slash commands and messages from the messages tab checked |
The webhook URL always starts with:
https://console.agentblit.com/api/webhooks/channels/slack/It ends with the channel id, which AgentBlit creates when you connect the channel. Copy the full URL from the channel card in step 5. Do not type it by hand.
| Scope | Why |
|---|---|
app_mentions:read | Receive @mentions in channels |
chat:write | Post and update replies, progress and approval messages |
im:history | Receive direct messages |
files:write | Upload diagram images |
No other scopes are needed.
Set up
1. Create the Slack app from a manifest
- Open api.slack.com/apps and click Create New App.
- Choose From a manifest.
- Pick the workspace and click Next.
- Select the YAML tab, replace everything with the manifest below, and click Next.
- Check the summary and click Create.
Before you click Next, change name and display_name to your agent's name. People see display_name in Slack, for example in @AgentBlit Agent.
display_information:
name: AgentBlit Agent
description: Chat with an AgentBlit agent
features:
app_home:
home_tab_enabled: false
messages_tab_enabled: true
messages_tab_read_only_enabled: false
bot_user:
display_name: AgentBlit Agent
always_online: true
oauth_config:
scopes:
bot:
- app_mentions:read
- chat:write
- im:history
- files:write
settings:
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: falseThe manifest leaves out Event Subscriptions and Interactivity on purpose. Slack rejects both without a Request URL, and the URL contains a channel id that exists only after step 4. You add them in step 6.
2. Install the app to your workspace
- In the app's left sidebar, open Install App.
- Click Install to your workspace, then click Allow.
3. Copy the bot token and signing secret
| Credential | Where in Slack | Looks like |
|---|---|---|
| Bot User OAuth Token | Install App (or OAuth & Permissions) → Bot User OAuth Token | Starts with xoxb- |
| Signing Secret | Basic Information → App Credentials → Signing Secret → Show | 32 hex characters |
Use the Signing Secret, not the Client Secret or the Verification Token.
4. Connect the channel in AgentBlit
- Open the agent in console.agentblit.com.
- In the agent editor, open Channels and click Connect channel.
- Set Provider to Slack. It defaults to Telegram.
- Paste the
xoxb-token into Bot token and the signing secret into Signing secret. - Pick Access. The default is Open to anyone. See Access.
- Click Connect.
AgentBlit checks the token with Slack and names the channel after the Slack workspace.
5. Copy the webhook URL from the channel card
The new card shows Slack · followed by your Slack workspace name. Under it is the webhook URL, starting with https://console.agentblit.com/api/webhooks/channels/slack/. Copy the whole URL.
6. Paste the webhook URL into Slack
Paste the same URL in two places in the Slack app settings. Do not paste it into OAuth & Permissions → Redirect URLs.
Event Subscriptions
- Open Event Subscriptions and turn Enable Events on.
- Paste the URL into Request URL. Wait until Slack shows Verified ✓.
- Open Subscribe to bot events, click Add Bot User Event, and add
app_mentionandmessage.im. - Click Save Changes.
Interactivity & Shortcuts
- Open Interactivity & Shortcuts and turn Interactivity on.
- Paste the URL into Request URL.
- Click Save Changes.
If Slack shows a banner asking you to reinstall the app, click it and Allow again. The bot token stays the same.
If verification fails, check that the URL was copied in full, that the channel is switched on in AgentBlit, and that the signing secret in AgentBlit is the one from step 3. AgentBlit answers Slack's check only after the request's signature matches.
7. Invite the bot and @mention it
In the Slack channel where people should use the agent:
/invite @AgentBlit AgentThen mention it:
@AgentBlit Agent what can you do?The bot replies in a thread under your message. To DM it, open the app under Apps in the Slack sidebar and send a message.
Access
Choose Access when you connect. Change it later in the dropdown on the channel card or with the pencil button.
| Mode | What happens |
|---|---|
| Open to anyone (default) | Anyone in the Slack workspace who messages the bot can use the agent right away. |
| Require approval | A new person's first message gets Your access request is pending approval from the agent owner. The agent does not answer until you approve them. They must send their message again after approval. |
People in a channel act through the agent's connected accounts and tools. Use Require approval unless you trust everyone in the workspace.
Contacts on the channel card lists everyone who has messaged the bot, with their status (active, pending, blocked). Slack contacts show the Slack member id (U…). To find someone's id in Slack, open their profile, click ⋮, and choose Copy member ID.
- Approve lets a pending or blocked person use the agent.
- Block stops the agent from answering that person, without telling them.
Changing the access mode applies to people who message the bot for the first time afterwards. Existing contacts keep their status, so after switching to Open to anyone, approve anyone still pending in Contacts.
Where the agent replies
| Where | How to start | Reply |
|---|---|---|
| Direct message | Message the app under Apps | In a thread under your message |
| Public or private channel | Invite the bot, then @mention it | In a thread under the mention |
- Each thread is its own conversation with its own history. A new top-level message starts a new conversation.
- In a DM, reply inside the thread to continue. No @mention is needed.
- In a channel, the bot only sees messages that @mention it, including inside its threads. Mention it again for each follow-up.
- Everyone who mentions the bot in the same channel thread shares that conversation.
What people see in Slack
Live progress message
As soon as a message arrives, the bot posts ⏳ Thinking… and then edits that one message as the agent works. The answer streams in about every 1.5 seconds. Finished tool calls collapse into one summary line above the answer:
✓ 11 steps · Github Get File Contents ×6, Github Search Code ×3 +1 moreDenied and waiting tool calls keep a line each, for example ✗ Send Email (denied) or ⏸ Send Email (waiting for approval). An answer longer than about 3,900 characters continues in a new message.
Formatting
The agent's Markdown is converted to Slack formatting: bold, italics, strikethrough, links, headings (shown as bold lines), bullet and task lists, and code blocks. Slack has no tables, so tables are shown as aligned text in a code block.
Approvals
When the agent calls a tool that needs approval, the run pauses and the bot posts 🔒 Approval needed with a summary of the action and Approve / Deny buttons.
- Only the person who sent the message can decide. The card says
Only @name can decide., and anyone else who clicks gets a privateOnly the person who asked can approve or deny this. - After a click the card changes to
✅ Approvedor✗ Deniedand the agent continues in a new progress message. - The requester can also answer in the thread with
approve/yesordeny/no. In a channel, @mention the bot as well. - Sending anything else instead skips the approval (
Skipped: a new message arrived.) and the agent handles the new message.
The buttons need Interactivity turned on with the webhook URL (step 6).
Tools that ask for input through a form cannot show the form in Slack. That request is cancelled and the tool continues without it.
Diagrams
When a reply contains a fenced code block tagged mermaid, the bot renders it and uploads it to the thread as a PNG once the reply is finished. In the reply, the diagram's code is replaced with 📊 Diagram posted below. Up to three diagrams are posted per reply. If a diagram can't be rendered, its code stays in the reply.
Uploading needs the files:write scope.
Commands
Send these as a message in the conversation's thread. In a channel, mention the bot first, for example @AgentBlit Agent /new.
| Command | What it does |
|---|---|
/new | Clears this conversation's history and starts fresh. Skips a pending approval. |
/reset | Same as /new. |
/stop | Skips a pending approval in this conversation. |
/claim 12345678 | Links your Slack identity to your memory from another chat, using the 8-digit code the agent gave you there. Codes expire after 10 minutes. Needs long-term memory on for the workspace. |
Slack reads a message that starts with / as a Slack slash command and answers is not a valid command. In a DM, type a space before the command ( /new), or mention the bot first.
Published version
Slack conversations run the agent's published version, not the draft you are editing. After you change the prompt, tools or model, click Publish before testing in Slack.
- An agent that has never been published runs its draft.
- With a rollout percentage set, that share of conversations runs the draft.
Edit or remove a channel
Each channel card has:
- Switch — turns the channel off and on. While it is off, the bot does not answer and Slack's requests to the webhook URL fail.
- Pencil — opens Edit Slack channel: Name, Bot token, Signing secret and Access. Leave a credential blank to keep the current one.
- Trash — removes the channel.
To rotate credentials, regenerate them in Slack, then paste the new value with the pencil button:
- Bot token: must belong to the same Slack workspace. A token from another workspace fails with
That token belongs to a different Slack workspace. To move to another workspace, remove the channel and connect again. - Signing secret: in Slack, Basic Information → App Credentials → Signing Secret → Regenerate. Save the new one in AgentBlit right away. Until you do, Slack's requests fail signature checks.
Removing a channel and connecting again creates a new channel id, so the webhook URL changes. Paste the new URL into both Event Subscriptions and Interactivity & Shortcuts.
Troubleshooting
| Symptom | Fix |
|---|---|
| The bot never replies | In Event Subscriptions, the Request URL must be the webhook URL from the channel card and show Verified, with app_mention and message.im under bot events. Check the channel is switched on in AgentBlit. In a channel, run /invite @AgentBlit Agent and @mention the bot. |
Slack says Your URL didn't respond with the value of the challenge parameter | The URL is incomplete or from an old channel, the channel is off, or the signing secret in AgentBlit doesn't match. Copy the URL from the card again and check the signing secret. |
| The webhook URL is under Redirect URLs | That is OAuth & Permissions → Redirect URLs and isn't used. Remove it and paste the URL into Event Subscriptions and Interactivity & Shortcuts. |
The DM box says Sending messages to this app has been turned off | App Home → Show Tabs: turn Messages Tab on and check Allow users to send Slash commands and messages from the messages tab. |
| Approve / Deny do nothing | Turn on Interactivity & Shortcuts → Interactivity with the same webhook URL, and click Save Changes. |
| Diagrams stay as code | Add files:write under OAuth & Permissions → Bot Token Scopes and reinstall the app. |
| The bot's name in Slack differs from the app name | Slack shows the bot user's display name, not the app name in Basic Information. Change it in App Home → App Display Name → Edit. |
| New tools or prompt changes don't show up | The change is still a draft. Click Publish in the agent editor. |
Your access request is pending approval from the agent owner. | Access is Require approval. Approve the person in Contacts, or switch Access to Open to anyone. |
This Slack workspace is already connected to an agent | A Slack workspace can be connected to one agent. Remove the existing Slack channel from that agent first. |
Slack auth failed: invalid_auth | Paste the Bot User OAuth Token (starts with xoxb-) into Bot token, and the signing secret into Signing secret. |