Prerequisites
- A Polos project with a running orchestrator
- Admin access to a Slack workspace
Step 1: Create a Slack App
1
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.
2
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
3
Install to workspace
Click Install to Workspace and authorize. Copy the Bot User OAuth Token (
xoxb-...) - this is your SLACK_BOT_TOKEN.4
Invite the bot to your channel
In your target Slack channel, type
/invite @polos (or whatever you named the bot).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
1
Enable events
In your Slack app settings, go to Event Subscriptions and enable events.
2
Set the request URL
Set the Request URL to:
3
Subscribe to bot events
Add
app_mention.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
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: