Prerequisites
- A Polos project with a running orchestrator
- Admin access to a Slack workspace
Step 1: Create a Slack App
Create the app
Go to api.slack.com/apps and click Create New App > From scratch. Name it (e.g., “polos”) and select your workspace.
Add bot token scopes
Go to OAuth & Permissions > Bot Token Scopes and add:
chat:write- Send messagesapp_mentions:read- Receive @mentionschannels:history- Read channel messagesgroups:history- Read messages from private channels
Install to workspace
Click Install to Workspace and authorize. Copy the Bot User OAuth Token (
xoxb-...) - this is your SLACK_BOT_TOKEN.One Slack app serves all your agents. Different agents route to different Slack channels via configuration, not separate apps. You only need a second app if your agents span multiple Slack workspaces.
Step 2: Configure environment variables
The Slack credentials are split between the orchestrator and the worker. Orchestrator — add to~/.polos/.env:
.env:
Step 3: Add SlackChannel to your worker
Pass aSlackChannel to your Polos instance:
ctx.step.suspend()),
an approval message is posted to the slack channel from where the request originated or
the slack channel configured for the tool approval.
Trigger agents from Slack
You can @mention your bot in Slack to trigger an agent. The agent’s output streams back to the originating Slack thread.Set up event subscriptions
Register your Slack app with the orchestrator
Link your Slack app to your Polos project so the orchestrator knows how to route incoming messages:Interact with the bot
Once configured, @mention the bot in any channel it’s been invited to:@assistant_agent is the name of the agent in Polos that you’re triggering from Slack.
The agent streams output back to the same Slack thread. If the agent suspends (e.g., for tool approval),
you’ll see the Slack message in the thread to approve/reject the request.
Environment variables
| Variable | Where | Required | Description |
|---|---|---|---|
SLACK_BOT_TOKEN | Orchestrator (~/.polos/.env) and Worker (.env) | Yes | Bot User OAuth Token (xoxb-...) from your Slack app |
SLACK_SIGNING_SECRET | Orchestrator (~/.polos/.env) | Yes | Signing Secret from your Slack app’s Basic Information page |
Per-tool channel routing
You might need admin approvals for specific tools irrespective of who triggered the agent. In such cases, you can route specific tool approvals to different Slack channels. For example, send authorize_payment to#ops-approvals: