Put an agent in Slack

Connect an agent to Slack and your team can ask it questions where they already work: mention it in a channel, or send it a direct message. Nobody needs a Mercur account to talk to it. If you allow it, the agent can also post on its own: release notes in a channel, a direct message to the person who needs to know.

This page assumes you already have an agent on a connected computer. If not, start with AI agents on your own machine.

How it works

  • The bot is your own Slack app. You create it in your Slack workspace from a manifest that Mercur prepares, so it carries the name, icon and slash command you choose, and you can remove it from Slack at any time.
  • One bot belongs to one agent. An agent has at most one bot per Slack workspace, and one Slack workspace can hold the bots of several agents: a @backend bot and a @billing bot side by side.
  • Anyone in the Slack workspace can talk to it, without a Mercur account. Every message is handled with the agent access of the Mercur member who connected the bot. If that member loses access to the agent, the bot stops answering until someone reconnects it.
  • Slack conversations stay in Slack. They do not appear on the agent's Chat tab.

Only the workspace owner sees the agent's Slack tab and can connect a bot.

Connect a bot

Open the agent, go to the Slack tab and select Connect a Slack bot. The tab walks you through four steps:

  1. Create the app. Choose the Bot name and the Slash command (by default /mercur- plus the agent's name), then select Create manifest and Copy manifest. Open api.slack.com, choose Create New App → From a manifest, pick your Slack workspace and paste it. The manifest is valid for 24 hours; create a new one if it runs out.
  2. Install it to your workspace from the app's page in Slack.
  3. Copy two values from the app's page: the Bot User OAuth Token (under OAuth & Permissions, it starts with xoxb-) and the Signing Secret (under Basic Information).
  4. Connect. Paste both into the Slack tab and select Connect.

The bot now shows as Connected. It stays quiet until you turn Publishing on.

Choose where and how it answers

The bot's card on the Slack tab holds its settings:

  • Publishing: the bot answers only when this is on. Turn it off to silence the bot without disconnecting it.
  • Direct messages: lets people message the bot one to one.
  • Bot access: Read only (the default) or Read & edit. Read only answers questions; Read & edit lets the agent change files and run its allowed commands for anyone in the conversation, so use it only where everyone in the channel should have that.
  • Channel exceptions: give one channel a different access, or switch the bot Off there.
  • Show cost of each answer: adds the estimated cost to each reply.

The bot answers in every channel it is invited to, so anyone who can invite apps can bring it into a channel. Use a channel exception set to Off to keep it out of a specific one.

Talk to it

Invite the bot to a channel, then mention it:

In Slack
/invite @backend
@backend What happens to a subscription when the card payment fails three times?

The bot answers in a thread. To continue, mention it again in that thread; it does not read messages that do not mention it. In a direct message no mention is needed. While it works, a Stop button lets anyone in the thread cancel the answer.

The bot's slash command shows its state and starts over:

  • /mercur-backend status: whether it is on, whether the agent is online and the access here.
  • /mercur-backend new: in a direct message, starts a new conversation.
  • /mercur-backend help: lists the commands.

Let the agent write to Slack

Two switches on the bot's card let the agent send messages on its own. Both are off by default.

  • Automations may write to Slack: runs started by a schedule, a webhook or Run now may post.
  • Chats may write to Slack: chats in the console and Slack conversations may post.

With a switch on, the agent can look up a person or a channel, send a direct message, and post in a channel the bot is in. Every message comes from the bot, never from a person, and appears in the run's history with its text. Turning a switch off stops the next message of a run already going.

A prompt for a weekly automation could read:

Collect the pull requests merged into main since last Friday and write short release notes for the support team, grouped by area. Post them in #releases.

Bots connected before these switches existed need the new permissions first: paste the new manifest from Show manifest into the app in Slack, reinstall it, and paste the new token with Replace token or secret.

Disconnect

To stop the bot, select Disconnect on its card. Mercur revokes the bot's access; the Slack app itself stays in your Slack workspace until you delete it there. Deleting the agent disconnects its bots too.