The Slack Gatekeeper connects Cloudflare OS to Slack workspaces via OAuth, giving agents and Gadgets read access to channels, direct messages, threads, workspace members, and full-text search. It uses a user token (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/cloudflare/cloudflare-os/llms.txt
Use this file to discover all available pages before exploring further.
xoxp-…) so the agent sees exactly what the connecting user can see — including private channels, DMs, and multi-party DMs — without ever exceeding the user’s own permissions.
The Slack Gatekeeper is read-only. It never sends messages or modifies Slack data. All access is observational — ideal for agents that need to understand team context, search past conversations, or monitor a channel’s activity.
Capabilities
The Slack Gatekeeper provides access at three levels of granularity. You can introduce an agent to an entire workspace, a single conversation (channel or DM), or a specific thread.| Granularity | Resource URL | Session type |
|---|---|---|
| Workspace — all channels, DMs, members, and search | https://* (catch-all) | SlackWorkspaceSession |
| Conversation — a single channel, DM, or group DM | https://app.slack.com/client/:teamId/:conversationId | SlackConversation |
| Thread — a single message thread | https://*.slack.com/archives/:conversationId/:messageId | SlackThread |
OAuth Scopes by Resource
The Slack Gatekeeper requests user token scopes (user_scope), not bot scopes. Scopes are requested only for the resource granularity being connected:
| Grant | User token scopes |
|---|---|
| Workspace | team:read, channels:read, channels:history, groups:read, groups:history, im:read, im:history, mpim:read, mpim:history, search:read, users:read |
| Conversation | channels:read, channels:history, groups:read, groups:history, im:read, im:history, mpim:read, mpim:history, search:read, users:read |
| Thread | channels:history, groups:history, im:history, mpim:history, users:read |
users:read is always requested for connected-account display and resolving user mentions to readable names.
Setting Up Slack OAuth
Create a Slack app
- Go to api.slack.com/apps and click Create New App.
- Choose From scratch.
- Give it a name (e.g., “My Company OS”) and select the workspace you are building for.
- Click Create App.
Configure OAuth redirect URL
In the left sidebar, go to OAuth & Permissions.Under Redirect URLs, click Add New Redirect URL and enter:
- Local dev:
http://localhost:8787/gatekeeper/slack/oauth - Production:
${PUBLIC_BASE_URL}/gatekeeper/slack/oauth
Enable token rotation
On the same OAuth & Permissions page, scroll down to Token Rotation and enable it.Token rotation produces short-lived tokens (~12 hours) that are refreshed automatically via
oauth.v2.access?grant_type=refresh_token. Non-rotating tokens also work as a fallback, but rotation is recommended for security.Add user token scopes
Still on OAuth & Permissions, scroll to User Token Scopes (not Bot Token Scopes). Add the scopes appropriate for the resources you plan to offer.At minimum, add the workspace scopes listed above. You can limit to conversation or thread scopes if you only plan to offer narrower grants.
Configure credentials
In the left sidebar, go to Basic Information and copy the Client ID and Client Secret from the App Credentials section.For local development, set these in the repo-root The dev server maps
.dev.vars:.dev.vars
SLACK_CLIENT_ID / SLACK_CLIENT_SECRET into the Worker’s CLIENT_ID / CLIENT_SECRET automatically.Verify the setup
- Start the application in dev mode (
pnpm dev-server+pnpm dev-client). - Create or open a Gadget and navigate to the Connections tab.
- Click + New Connection and choose Slack.
- Connect your Slack account — you will be redirected to Slack’s authorization page.
- After approving, the tab closes and you are back in the Gadget.
- Paste a Slack conversation or thread URL, or choose a workspace-level grant.
What Agents Can Do
- Workspace session
- Conversation session
- Thread session
getInfo— read workspace name and metadatalistChannels— list public and private channels the user is a member oflistDirectMessages— list DMs and group DMslistUsers— list workspace membersgetUser— fetch a user’s profilegetConversation— open a specific conversation by IDsearch— full-text search across the entire workspace
Cursor objects. User mentions in messages are resolved to readable names automatically.