
Essay Permissions
Scoping Agent Slack Bot Permissions to Specific Channels
OAuth scopes, channel membership, and an allow-list each close a gap.
Scoping an agent Slack bot to specific channels requires two separate controls. OAuth scopes define what the bot can do, while channel membership defines where it can do it. A genuinely constrained deployment manages both, then adds application-level channel filtering so that an accidental invitation does not become permission for the agent to act.
Why a Slack bot with the right scopes can still read more than you intended
A bot approved for a narrow reporting job can end up reading executive, legal, or incident channels after invitations made during testing. Its reach has expanded with the same scope list. OAuth scopes and channel membership are independent controls, and treating scope approval as the whole access decision leaves the second control unmanaged.
The distinction is visible in an ordinary API failure. A bot with channels:history still receives a not_in_channel error when it tries to read a channel it has not joined. That error demonstrates that a capability grant is not a conversation grant. The reverse is more dangerous because it need not produce an error at all. When the bot joins additional public channels, its existing history scope authorizes reading there too.
The approved capability may be entirely appropriate for the job, while the set of conversations reachable through that capability is not.
What OAuth scopes actually control, and what they leave open
OAuth scopes authorize classes of Slack API capability. Slack’s modern app model assigns individual scopes. Its scope reference offers over a hundred permissions across areas including channels, chat, files, admin, and assistant. The granularity is deliberate, but it is not channel filtering.
For a constrained agent, app_mentions:read supports receiving mentions directed at the bot, while chat:write supports posting as the bot in channels it belongs to. Reading history requires the scope for the conversation type, namely channels:history for public channels or groups:history for private channels. Access to direct messages and files needs its own review through im:history and files:read. Another agent’s use of a scope is no reason to give it to this one.
Two boundaries deserve particular attention. The workspace-search scope search:read cannot be granted to a bot token and requires a user token instead. By contrast, chat:write.public lets a bot post to public channels without joining them, making it an exception to the membership requirement for posting. A compromised token with message-writing access can spam channels, while admin scopes the bot does not need let it do far more damage.
How channel membership works as a separate enforcement layer
Channel membership turns an authorized capability into access to a conversation. For private channels, Slack requires an explicit invitation from an existing member. Public channels have a different path. A bot with channels:join can join them itself through conversations.join, without a human invitation. A membership policy that assumes every addition requires human action therefore depends on the scope configuration too.
A test, launch, or one-time request can leave a bot in a channel indefinitely because Slack has no native mechanism that automatically revokes those memberships. Token lifetime adds another persistence risk. Bot tokens and user access tokens do not expire by default unless token rotation is enabled.
Anything the agent can read is potential material for an answer visible to someone who can prompt it. Membership must therefore be reviewed as a data-access decision. Neither the scope grant nor membership itself distinguishes an approved working channel from one the bot entered by mistake.
Why the two levers together are not enough, and where application-layer allow-lists fit in

An application-layer channel allow-list tells the agent which of the channels it can reach are approved for its work. The server checks the channel ID in every incoming event against an approved list before the agent processes or responds to the message. An invitation sent by mistake can then change Slack membership without changing the set of channels where the agent is approved to work. This is an enforcement layer separate from OAuth scopes.
The resulting model has three distinct gates. OAuth authorizes classes of access, membership limits that access to particular conversations, and application logic restricts its use to approved tasks. For a history-reading and message-sending MCP server, the recommended pattern begins with minimal scopes such as channels:history and chat:write, followed by the channel allow-list. A shared token without an application guard exposes whatever that token can see to the agent.
Task separation makes this guard easier to reason about. A reporting bot and a support bot should each have their own app, scopes, and allow-list, so unrelated jobs have separate identities. A configuration error in one then cannot expand the other’s reach. Tool allowlists provide a related application-level control for community MCP deployments, where token access alone is not a sufficient task boundary.
How token architecture affects what can be scoped and to whom
A bot token and a user token represent different principals. A bot token, identified by the xoxb- prefix, represents the bot’s own identity and reaches channels where the bot is a member. It is a good fit for receiving mentions, reading approved channels, and sending messages. It cannot have search:read, which also limits the kinds of analysis the integration can do.
A user token, identified by xoxp-, represents the person who authorized it. It can receive search:read for workspace search, with conversation access reflecting that user’s memberships. The access surface may be substantially broader than the bot’s intended working set.
Where analysis requires a user token, the recommended separation is a read-only user token for analysis and a separate bot token for sending. This limits what any single compromised token can do. It does not make the user’s channel access narrow. The same permission questions remain, but the membership boundary now belongs to the user, which makes shared-token designs harder to constrain. Slack’s official MCP server ties access to each user through per-user OAuth.
That error demonstrates that a capability grant is not a conversation grant.
What Slack's official MCP server changes about where the trust boundary sits
Slack’s official MCP server became generally available on February 17, 2026. It authenticates individual users through OAuth 2.0 with granular scopes, and every call inherits the permissions of the user who connected it. The agent can read what that user can read and nothing more. Builders no longer have to construct that per-user access boundary around a shared bot token.
Approval still determines how much of that access the agent receives. Granular search scopes constrain what it can surface, and omitting private-conversation search scopes at approval confines search to public history. The server provides search, message retrieval, message sending, canvas, member, file upload, and list tools. It also needs workspace-admin approval before it can be deployed. For most teams, it is the recommended default for 2026, though user-bounded access is not automatically task-bounded access.
The self-hosted alternative, korotovsky/slack-mcp-server, supports user, bot, and browser-session tokens. Its stealth mode uses browser tokens without an app installation, so it does not provide the same installation-and-approval boundary. Tool allowlists become an important control in that architecture. Slack’s May 2025 API terms also prohibit third-party app providers from bulk exporting message and file data or using API data to train LLMs, while exempting internal customer-built apps. That distinction requires attention to the deployment and its use, rather than treating token support as permission for every operation.
How prompt injection limits what scope restriction can protect against
The strongest objection to scope restriction is that authorized access can still be misused. Anyone able to post where an agent reads can place malicious instructions in front of the model. Scopes determine which capabilities those instructions might exploit, but they do not prevent the text from reaching the agent. An approved channel is not a trusted instruction source.
PromptArmor’s 2024 Slack AI exfiltration case illustrates the distinction. An attacker placed a malicious instruction in a public channel, and a user with private-group access later asked Slack AI to retrieve confidential information. The model followed the attacker’s instruction and produced a clickable markdown link containing confidential data in its URL. Clicking the link sent that data to the attacker’s server. The attack crossed a conversation boundary through the agent’s handling of content.
OWASP’s Top 10 for LLM Applications for 2025 ranks prompt injection first and excessive agency sixth. Scope restriction limits excessive agency, but injection can still occur. The defensive posture therefore needs untrusted-content isolation and tool authorization as well as narrow access. Treating Slack events as data rather than instructions is a layer above the permission model.
That limitation is also a reason to scope tightly. An agent that cannot read the HR channel cannot be instructed to retrieve its contents through that access. Security-sensitive information should therefore remain in channels excluded from agents by workspace policy, with Enterprise+ per-channel AI restrictions used to limit the RAG context boundary.
Workspace-level controls that govern which bots get the two levers at all
Per-bot restrictions depend on who can install apps and introduce new capabilities. Slack allows members to install apps without Workspace Owner approval by default. Workspace Owners can enable app approval to pre-approve or restrict apps, making this the first governance control to turn on. Approval covers the scopes the app will use. Without it, an individual member can introduce a broadly scoped bot into production outside the intended review process.
Enterprise Grid has admin controls that work across the organization. The APIs admin.apps.permissions.set and admin.apps.permissions.add/remove govern who can access an app, while admin.apps.mcp.servers.permissions.set controls access to MCP servers specifically. Channel restrictions remain a separate control. Slack’s Restrict API Token Usage setting adds a network boundary by rejecting Web API and SCIM API calls from outside configured IPv4 ranges.
Unused apps, inactive channels, and permission creep still need regular review because a valid installation can accumulate access after approval. Channel invitations deserve the same attention as scope changes. A standing audit cadence keeps those accumulated permissions tied to active jobs instead of preserving them merely because they were once needed.
A working minimum-scope baseline for a constrained agent bot
A practical starting configuration for a channel-focused agent uses app_mentions:read to receive mentions and chat:write to post replies. Add the history scope for the conversation type it must read, using channels:history for public channels or groups:history for private channels. Do not grant both unless the job requires both. Omit im:history unless direct-message access is explicit, and omit files:read unless file handling belongs to the use case. Workspace search requires a separate token decision because search:read is unavailable to bot tokens.
Membership should cover only channels with an active job for the bot. Set a policy to keep legal, HR, executive, and incident rooms agent-free. Review memberships monthly and remove the bot where its original purpose has ended. Enforce the approved channel allow-list in server code so that an extra invitation does not cause the agent to process events from that channel.
Use a bot identity for each job, downstream credentials with narrow access, allowlisted tools, and clear limits on what the bot can do and how much data it can use. Turn on token rotation so credentials do not stay valid forever. For teams using the official MCP server, set granular search scopes during OAuth approval to restrict what the agent can surface within the connecting user’s access.
Any added access should meet a clear need, with the scope grant, conversation boundary, and task guard reviewed together. Starting narrow is easier to expand than walking back broad access after an incident.
Notes
- Permission Scopes
Supplied the reference for Slack's OAuth permission scopes, such as history, chat:write and search:read, that the article uses to explain what scopes authorize.


