Skip to content

Slack Channel

Agentcy uses Slack's Socket Mode so you don't need to expose a public URL. You register a Slack app, pair its tokens with Agentcy, and messages are routed to agents via bindings.

Create the Slack app

  1. Go to https://api.slack.com/appsCreate New AppFrom scratch.
  2. Under Socket Mode: enable it. Generate an App-Level Token with scope connections:write — token starts with xapp-. Save it.
  3. Under OAuth & Permissions → Bot Token Scopes, add:
    • app_mentions:read
    • channels:history, channels:read
    • chat:write, chat:write.public
    • files:read
    • groups:history, groups:read
    • im:history, im:read, im:write
    • users:read
  4. Install the app to your workspace. Grab the Bot User OAuth Token — starts with xoxb-.
  5. Under Event Subscriptions: enable, subscribe to bot events app_mention, message.channels, message.groups, message.im.

Configure in Agentcy

bash
curl -X POST http://localhost:8080/api/v1/channels/slack/configure \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{
    "fields":{
      "bot_token":"xoxb-…",
      "app_token":"xapp-…"
    }
  }'

Or set env vars before boot (precedence: DB config wins over env):

env
AGENTCY_FEATURES_CHANNELS_SLACK=true
SLACK_APP_TOKEN=xapp-…
SLACK_BOT_TOKEN=xoxb-…

Verify

bash
curl -X POST http://…/channels/slack/test -H "authorization: Bearer $TOKEN"
# -> { "status":"ok", "workspace":"acme", "bot":"U01…" }

Bindings

Route messages to agents:

bash
# Bind DMs to the default agent
curl -X POST http://…/bindings \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{"agent":"default","match_rule":{"channel":"slack","conversation_type":"im"}}'

# Bind mentions in a specific channel
curl -X POST http://…/bindings \
  -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{
    "agent":"incident-responder",
    "match_rule":{"channel":"slack","slack_channel":"#incidents","mentioned":true}
  }'

match_rule Slack fields:

  • slack_channel#name or Cxxx id
  • slack_user@name or Uxxx
  • conversation_typeim | channel | group
  • mentioned — only trigger when the bot is @-mentioned

Outbound messages

The slack.post_message tool is available to agents bound to Slack. Use it explicitly:

execute_connector_tool("slack","post_message",{
  "channel":"#eng-standup",
  "text":"PR triage summary for today: …",
  "blocks":[…]
})

Threading

By default, replies land in the same channel. To thread under the triggering message, add thread_ts to the match_rule:

json
"match_rule":{"channel":"slack","preserve_thread":true}

With preserve_thread: true, the agent captures thread_ts on inbound and uses it automatically for outbound slack.post_message calls.

Files

Slack file uploads are downloaded into the artifact store and passed to the agent as artifact references. Size cap: 20 MB per file (Slack default).

Policies

Same as WhatsApp — subject.channel = "slack" is populated on evaluation. Example:

rego
deny[msg] {
  input.subject.channel == "slack"
  input.resource.connector == "aws"
  input.resource.tool_effect != "read"
  msg := "AWS writes are disallowed from Slack entirely"
}

Gotchas

  • Socket Mode needs outbound only. No firewall changes typically.
  • Event subscription URL is irrelevant. Slack only uses it for HTTP mode. Leave blank.
  • Two Slack apps = two bindings. If you install the same Agentcy into two workspaces, give each its own config (Agentcy will produce two distinct src_slack_<workspace> sources).
  • Rate limits. Slack's per-workspace rate is 1 message/sec to a channel. The channel adapter queues bursts.

Next

Built by AgentcyLabs. For in-house deployment or Agentcy Cloud (PaaS) access, visit agentcylabs.com.