Skip to Content
Blocks

Slack

Make the Slack app

Open Slack setup. Choose the manifest for both accounts or for your user account. A manifest is a file with the Slack app settings.

Install the app in your workspace. Ask an agent to connect Slack, or run swb connect slack. Save the workspace tokens through the claim link. Restart SwB to load the saved tokens.

TokenWhere to find it
Bot token, xoxb-OAuth & Permissions → Bot User OAuth Token
User token, xoxp-OAuth & Permissions → User OAuth Token
App-level token, xapp-Basic Information → App-Level Tokens, with connections:write

Send from Slack

Mention the bot and give the target's short name. Use targets to look up names.

@swb claude check the release notes

SwB removes the target name and sends the rest of the message. For a normal bot reply, SwB posts in the thread under the target's name and picture. In a follow-up, SwB can reuse the thread's target. The workspace's default_target is a fallback.

Post as an agent

Agents post with slack_post. Use blocks.slack.agents.<agent>.workspaces to choose where and through which accounts an agent can post. Each account has a write policy.

PolicyEffect
freeThe agent posts at once
approvalThe owner approves each post first
neverThe identity is read-only

The owner approves posts from the Slack DM or from the SwB page. MCP tools can only ask for an approval.

Personas

A persona is the name and picture on a bot post. SwB gives each Capy Captain a persona. Ask your agent to call slack_personas to see the available personas. The agent can choose an allowed persona with slack_post. Put custom picture files in <data>/avatars.

Projects per channel

workspace_projects maps a workspace to a project. channel_projects maps one channel to a project. The mapping chooses the project memory and the main routine for @swb claude.

Block settings

KeyUse
blocks.slackSettings for the Slack block and its workspaces
blocks.slack.useLoads the slack block
blocks.slack.enabledSet true to load the block or false to turn it off
blocks.slack.refresh_minutesMinutes between updates to the target list. The default is 30
blocks.slack.target_aliasesMaps extra target names to existing targets
blocks.slack.workspace_projectsSets the default SwB project for each workspace
blocks.slack.channel_projectsSets a SwB project by workspace and channel name or ID
blocks.slack.listen_channelsSets assist mode for channel names or IDs in each workspace. A channel mode can override it
blocks.slack.max_text_charsMaximum characters kept from each incoming message. The default is 4000
blocks.slack.event_retention_daysDays to keep Slack events. The default is 14

Use channel modes to wake an agent through a project route.

Workspaces and accounts

KeyUse
blocks.slack.workspacesMaps workspace names used in SwB to their Slack settings
blocks.slack.workspaces.*.team_idSlack workspace ID
blocks.slack.workspaces.*.app_idSlack app ID. SwB uses it to skip messages from its own app
blocks.slack.workspaces.*.intakeChoose socket for live events, poll to read channel history, or none to turn off message intake
blocks.slack.workspaces.*.app_token_envName of the environment variable for the app token used by Socket Mode
blocks.slack.workspaces.*.identitiesSlack accounts that SwB can use in this workspace
blocks.slack.workspaces.*.identities.botSettings for the bot account
blocks.slack.workspaces.*.identities.bot.token_envName of the environment variable for the bot token
blocks.slack.workspaces.*.identities.bot.writeWrite policy for the bot account. The default is free
blocks.slack.workspaces.*.identities.userSettings for the Slack user account
blocks.slack.workspaces.*.identities.user.token_envName of the environment variable for the user token
blocks.slack.workspaces.*.identities.user.writeWrite policy for the user account. The default is approval
blocks.slack.workspaces.*.user_onlySet true to use only the user account. Set its write policy to approval or never
blocks.slack.workspaces.*.watchedSets watch mode for the listed channels. Use * for every channel the bot has joined
blocks.slack.workspaces.*.default_targetTarget for a new message addressed to SwB with the target name omitted
blocks.slack.workspaces.*.ack_reactionSlack emoji name for acknowledgments on mentions and direct messages. The bot default is eyes
blocks.slack.workspaces.*.owner_user_idsSlack user IDs treated as owners. The workspace approver is the default
blocks.slack.workspaces.*.knownMaps known Slack user or bot IDs to display names. Use it to help choose whose messages to accept
blocks.slack.workspaces.*.sender_rateLimits message intake for each sender other than the owner. Applies to assist, triage and messages used as context
blocks.slack.workspaces.*.sender_rate.countMaximum messages per sender in the time window. The default is 5
blocks.slack.workspaces.*.sender_rate.window_sLength of the time window in seconds. The default is 600
blocks.slack.workspaces.*.bot_thread_posts_per_hourBot posts allowed per thread in an hour before more posts need approval. The default is 20

Agent access and approvals

KeyUse
blocks.slack.agentsMaps SwB agents to their Slack permissions
blocks.slack.agents.*.workspacesSets the accounts the agent can use in each workspace
blocks.slack.agents.*.allow_persona_overrideSet true to let the agent choose a persona for a bot post
blocks.slack.agents.*.allowed_personasPersona IDs the agent can choose when it has permission to choose a persona
blocks.slack.approvalsDefault settings for requests to approve Slack posts
blocks.slack.approvals.approver_user_idSlack user ID that receives and can decide default approval requests
blocks.slack.approvals.notify_workspaceWorkspace whose bot sends approval requests for the default approver
blocks.slack.approvals.ttl_minutesMinutes before an approval request expires. The default is 60
blocks.slack.workspaces.*.approver_user_idSlack user ID that receives and can decide requests from this workspace. It takes priority over the default

Names and pictures

KeyUse
blocks.slack.personasDefines the names and pictures that the bot can use in posts
blocks.slack.personas.*.nameDisplay name for bot posts that use the persona
blocks.slack.personas.*.avatarPicture file name for the persona. Set blocks.slack.public_base_url so Slack can fetch it
blocks.slack.personas.*.emojiFallback Slack emoji for the persona picture
blocks.slack.avatar_dirsExtra folders SwB searches for avatar files before its bundled pictures
blocks.slack.public_base_urlPublic HTTPS address Slack uses to fetch avatar files, such as https://swb.example.com
blocks.slack.workspaces.*.default_personaDefault persona ID for bot posts in this workspace

Event delivery

KeyUse
blocks.slack.workspaces.*.sinksSets up webhooks that send Slack events to other services
blocks.slack.workspaces.*.sinks.*.nameName that identifies the webhook in logs and status
blocks.slack.workspaces.*.sinks.*.url_envName of the environment variable for the webhook URL
blocks.slack.workspaces.*.sinks.*.signatureSet stripe to sign requests in the Stripe format
blocks.slack.workspaces.*.sinks.*.secret_envName of the environment variable for the signing key
blocks.slack.workspaces.*.sinks.*.kindsEvent types to send. Choose from watched, mention and dm. The default sends all three
blocks.slack.workspaces.*.sinks.*.targetsSend only events for these target names
blocks.slack.workspaces.*.sinks.*.coalesce_secondsSeconds to collect events for one request. The default of 0 sends each event on its own

On this page