- Incoming webhook — outbound delivery of investigation findings to a channel.
- Socket Mode bot — two-way chat with the OpenSRE agent (mentions and DMs), managed the same way as the Telegram gateway.
Prerequisites
- A Slack workspace where you can create or install apps (workspace admin or app-install permissions).
- The channel you want findings posted to (webhook) and/or where the bot will be invited (Socket Mode).
Step 1: Create a Slack incoming webhook
- Visit https://api.slack.com/apps and click Create New App → From scratch.
-
Name the app (e.g.
OpenSRE) and pick your workspace. - In the left sidebar, open Incoming Webhooks and toggle the feature On.
- Click Add New Webhook to Workspace.
- Pick the channel where findings should be posted and click Allow.
-
Copy the generated URL. It has three path segments — a workspace ID, a channel/app binding ID, and a per-webhook secret — for example:
Treat this URL like a password — anyone holding it can post to your channel. If your workspace already has a Slack app you want to reuse, you can add a new webhook to it instead of creating a fresh app; the URL format is the same.
Step 2: Configure the integration in OpenSRE
You have two equivalent paths:- Direct setup command (recommended)
- Manual env var
- Onboarding wizard
~/.opensre/integrations.json (and can be merged on re-run).Credential resolution. Store first when present. Then:
SLACK_BOT_TOKEN / SLACK_APP_TOKEN → env then keyring;
SLACK_WEBHOOK_URL → plain env only (never keyring).Step 3: Verify
passed. Webhook-only configs confirm
the URL is present; Socket Mode configs also run Slack auth.test on the bot token.
To also confirm webhook delivery, add the --send-slack-test flag:
Agent Slack tools
Teammate tools (bot token) plus webhook blast. Credentials resolve inside the tools (never in tool-call traces). Shared client:integrations/slack/web_client.py.
Prefer
slack_reply_message / slack_read_messages when the bot token is
configured and the user names a channel or thread. Use slack_send_message only
for the fixed webhook channel.
For “add task”, “remind me”, and “what should we focus on next” requests, use
OpenSRE work management. Gateway turns can default reminders and recurring
check-ins to the current Slack channel.
Example prompts:
- “Read the last 20 messages in #incidents and summarize.”
- “Search Slack for ‘Windows install’ this week.”
- “Join #ops then reply that mitigation is rolled out.”
- “Who is on the team, and what does Vaibhav do?”
- “Add task: ping owners about the deploy window.”
/invite @OpenSRE) to private
channels it should read or post in.
Production Engineer schedules (Slack)
Wire morning digests and PR sweeps to a Slack channel (C… id from channel
details). The gateway daemon must be running so the scheduler can deliver.
Sentry morning digest (unresolved issues → Slack):
Two-way chat gateway (Socket Mode)
OpenSRE can also run a Slack messaging gateway so you can chat with the agent from Slack mentions or DMs. Each thread is its own conversation. No public inbound HTTPS URL is required — the gateway holds an outbound websocket.Create Socket Mode tokens
- In your Slack app settings, enable Socket Mode and create an app-level token
with the
connections:writescope (xapp-…). - Under OAuth & Permissions, grant the bot scopes below, then install the
app and copy the bot token (
xoxb-…). - Under Event Subscriptions, subscribe to the bot events
app_mentionandmessage.im.
Add these only if you use the feature — they are not in the current app config:
reactions:write (gateway ack 👀 / ✓ reactions + slack_add_reaction),
channels:read / im:read / mpim:read (resolve #channel-name and DM names
→ ID), and channels:join (slack_join_channel).SLACK_TEAM_TASKS_LIST_ID (F…) so slack_read_list can open the
default team-tasks List without a name search.
Reinstall the app after adding scopes so the bot token picks them up.
Allow your Slack user
Find your Slack member ID (U…) in the Slack app:
- Open your profile (avatar / name).
- Click ⋯ (More) next to View as / profile actions.
- Choose Copy member ID.
SLACK_ALLOWED_USERS=U0123ABCD in .env. The integration store takes
precedence when both are set.
For dogfood only, you may set SLACK_ALLOW_OPEN_WORKSPACE=1 instead (any
workspace member can talk to the bot).
DM pairing (optional)
Same policy as Telegram. Generate a code:Start the gateway daemon
Built-in chat commands:
/new (fresh session), /help, /pair <code>.
While a turn runs, the gateway adds an 👀 (eyes) reaction on the inbound
message, then swaps to ✅ (white_check_mark) when the reply is finalized.
If Slack is not configured the daemon still runs the other components and
opensre gateway status shows slack: not configured.
Deploying the Slack gateway
The Slack gateway backend is deployed and operated separately — not from this repo. Configure the integration here (tokens and scopes above); provisioning the hosted backend is out of scope for this repo. The EC2 gateway path (make deploy-gateway) is Telegram-only and
ignore SLACK_* variables with a validation warning: Slack Socket Mode is
single-consumer, so a second gateway holding the same tokens would split events.
Environment variables
Troubleshooting
error: webhook_url is required. from opensre integrations setup slack
You chose webhook (or both) and left the URL empty. Re-run and paste the full URL including the https:// prefix, or choose Socket Mode only.
slack: not configured from opensre gateway status
Missing SLACK_BOT_TOKEN / SLACK_APP_TOKEN (env or store) or empty allowlist without SLACK_ALLOW_OPEN_WORKSPACE=1. Run opensre messaging allow -p slack -u <U…> then gateway stop / start.
Connected, but deny reply
Your U… is not in SLACK_ALLOWED_USERS / store allowlist. Pair with /pair <code> after opensre messaging pair -p slack, or add yourself with messaging allow.
invalid_payload or channel_not_found from Slack
The webhook URL was created against a channel that has since been archived or renamed in a way that broke the binding. Create a new webhook in the Slack app settings and replace SLACK_WEBHOOK_URL.
Findings posted to the wrong channel
A webhook is bound to the channel it was created against. To change channels, create a new webhook in Slack pointed at the new channel and update SLACK_WEBHOOK_URL.
Webhook returns no_service
The Slack app or webhook was deleted. Re-create it and update the URL.