Slack

Slack is the most reliable channel for always-on use. If you are running OpenClaw for work or want rock-solid stability, start here.

Setup Overview

You will create a Slack App in your workspace and connect it to OpenClaw using Socket Mode (recommended) or webhook-based Events API.

# channels/slack.yaml
channel: slack
enabled: true
mode: socket  # Recommended: socket or events
dmPolicy: approval
groupPolicy: mention
requireMention: true
botToken: ${SLACK_BOT_TOKEN}
appToken: ${SLACK_APP_TOKEN}
signingSecret: ${SLACK_SIGNING_SECRET}

Socket Mode vs Events API

Socket Mode (Recommended)

mode: socket

Socket Mode creates a persistent WebSocket connection between your agent and Slack. No public URL needed. No webhook configuration. No firewall rules.

This is the most reliable option for always-on use because:

  • No external URL to maintain
  • Works behind NAT and firewalls
  • Reconnects automatically on network interruptions
  • No need to configure SSL certificates

Events API

mode: events
webhookUrl: https://your-domain.com/slack/events

Events API requires a publicly accessible URL for Slack to send events to. More complex to set up, but necessary if you need to run the agent on infrastructure that does not support outbound WebSocket connections.

Key Config Options

OptionValuesWhat It Does
dmPolicyallowlist, approval, openControls who can DM the bot
groupPolicymention, always, neverWhen to respond in channels
requireMentiontrue / falseRequire @bot mention in channels
modesocket, eventsConnection method
channelsArray of channel IDsRestrict to specific channels
respondInThreadstrue / falseReply in threads vs top-level

Tips and Gotchas

Socket Mode is the gold standard for reliability. We have run Slack with Socket Mode for weeks continuously with zero dropped connections. If you are choosing a single channel for your agent, this is it.

Use respondInThreads: true in busy channels. Without threading, the agent’s responses clutter the main channel. With threading, conversations stay contained and other channel members are not disrupted.

Create a dedicated channel for agent interaction. Rather than having the bot respond in #general, create #ai-assistant or #openclaw and restrict the bot to that channel. Keeps things clean.

Scopes matter. When creating your Slack App, request only the scopes you need:

chat:write        — Send messages
channels:history  — Read channel messages
groups:history    — Read private channel messages
im:history        — Read DMs
users:read        — Look up user information

Do not request admin scopes unless you have a specific reason. Principle of least privilege applies here.

Keep tokens in environment variables. Never put SLACK_BOT_TOKEN or SLACK_APP_TOKEN in your config files directly. Use environment variables or OpenClaw’s secrets manager. See the API Keys & Tool Policies guide for details.


Next Steps