Skip to content

Talk to agents from Slack

Once an admin connects a Slack workspace, your team talks to an agent from Slack. Mention the app in a channel, write in a thread the app is in, or DM the app. In a group DM, mention the app in every message, since Agents gets only the group DM messages that mention it. Each Slack thread becomes a conversation of its own in Agents, the agent answers in the thread, and a card it posts there stays current as people tap it in the app. In Agents, these threads are listed in Chats under Other.

A post from Slack counts as the person on the team whose checked Agents email is their Slack account’s email. An account made by signing up with the link from the email is checked. A Slack user who isn’t on the team is told so in the thread, and nothing runs. Posts from other apps, edits, and the app’s own posts start nothing.

The first message of a new thread picks the agent that answers it, the agent whose name is its first word, or else the one the admin picked. The thread keeps that agent, so a later reply that starts with another agent’s name still goes to it.

Where the thread started Who reads it in Agents
A public channel The whole team.
A DM with the app Only the person who wrote.
A private channel At first, only the person who wrote and the agent. Each other person joins it in Agents when they post in it.
A group DM At first, only the person who wrote and the agent. Each other person joins it in Agents when they post in it and mention the app.

A member of a private channel or a group DM who never posts in the thread doesn’t see it in Agents, and still sees it in Slack. Mentioning someone in the thread doesn’t add them, since only the person who writes is matched to an Agents account.

Slack’s mention doesn’t say what kind of channel it came from, so Agents asks Slack once, when the thread starts. When Slack doesn’t answer in time, limits the call, or the app was taken out of the channel, the thread is private to the person who wrote. A thread keeps who reads it for good, its later posts included.

Until the app holds the channels:read, groups:read and mpim:read permissions, Agents can’t tell a private channel or a group DM from a public channel. A thread a mention starts then shows to the whole team, and the server’s log names the missing permissions. Add permissions to an app you installed makes threads started after it private where they should be. A thread that started before it, in a private channel or a group DM, still shows to the whole team, its later posts included.

A card an agent posts in a thread goes to Slack as a copy. It shows each poll option’s count and who picked it, a decision’s pick, who signed off, the card’s summary lines, or a closed poll’s result. While a part still asks something, its last line says where to answer, such as “Tap an option in the Agents app.” People tap the card in the app, since Slack’s copy has no buttons.

Each tap, and each change the agent makes to the card, updates the same Slack message, at most once every 5 seconds for each card, so a burst of taps arrives as one update. A person is named by their name, or “a teammate” when they have none, never by their login. Read and answer an agent’s cards covers the card itself.

You need to be an admin on the team and in the Slack workspace.

  1. Open https://api.slack.com/apps, choose Create New App, then From scratch. Name it Agents and pick the workspace.
  2. On OAuth & Permissions, under Scopes, in the first list, the one for the app’s own token, add app_mentions:read, channels:history, groups:history, im:history, mpim:history, channels:read, groups:read, mpim:read, chat:write, users:read and users:read.email.
  3. On App Home, under Show Tabs, turn on Messages Tab and tick “Allow users to send Slash commands and messages from the messages tab”, so people can DM the app.
  4. On Install App, choose Install to Workspace and allow it. Copy the OAuth token that starts with xoxb-.
  5. On Basic Information, under App Credentials, show and copy the Signing Secret.
  6. In Agents, open your menu, choose Settings, then Connections. Under Slack, paste the signing secret and the token, pick the agent that answers, and choose Connect. The section then shows the workspace’s name and a Request URL. Copy it.
  7. Back in Slack’s app settings, on Event Subscriptions, turn on Enable Events and paste the Request URL. Slack checks it, and the field reads Verified. If it doesn’t, the team isn’t connected yet, or the secret was pasted wrong.
  8. On the same page, in the list of events for the app’s own user, add app_mention, message.channels, message.groups and message.im, then choose Save Changes. If Slack asks you to reinstall the app, do it.
  9. In a channel, type /invite @Agents, then write @Agents what can you do?. The agent answers in the thread. Write in the thread without mentioning the app, and it answers again. In a group DM, mention the app each time.

Agents keeps the secret and the token in a file only the server reads, never in a row, a page or a log. Everyone on the team can read which workspace is connected, its answering agent, who connected it and when, and the Request URL. bin/agentsctl slack connect --agent <name> connects from a terminal, reading the secret and then the token from standard input.

An app installed before Agents asked for mpim:history, channels:read, groups:read and mpim:read needs them added once.

  1. Open https://api.slack.com/apps and choose the app you made for Agents.
  2. On OAuth & Permissions, under Scopes, add each of the four the app lacks to the first list, the one for the app’s own token.
  3. Choose Reinstall to Workspace in the banner at the top of the page, then Allow.
  4. If the OAuth token that starts with xoxb- on that page changed, Agents needs the new one. A connected workspace shows no token field, so in Agents choose Disconnect Slack under Slack in Settings, Connections, then connect again with the signing secret and the new token, and pick the answering agent again. The Request URL stays the same, and the threads stay in Agents.

An admin chooses Disconnect Slack under Slack in Settings, Connections, and confirms. Slack’s deliveries are refused from then on.

Files, reactions, edits and deletes made in Slack don’t reach Agents. An agent can’t start a Slack thread or post outside one.