Set up Slack service credential
Create a Slack app service credential to give an agent API access through a shared app identity or publish it as a standalone Slack app. Create and install the app in Slack, then save its connection details in Glean.
These are separate uses of the credential:
- Attach it to the agent's Tools → Service credentials tab for authenticated Slack API calls, such as reading or posting messages.
- Link it in the agent's publishing settings or the Admin console so users can message the agent through its own Slack app. Standalone apps work only in one-to-one direct messages, not channels or group direct messages.
Glean stores the bot token encrypted and supplies authentication for the agent's supported Slack API calls. The agent doesn't receive the raw token.
Prerequisites
Complete the following prerequisites:
- Have a Slack workspace where you can create apps.
- Have admin access to install the app in that workspace.
- Have your Glean deployment name, which you use in the redirect URL and event request URL.
- Work with a Glean administrator who can create service credentials.
- For a standalone app, have Glean in Slack configured and enabled for the same Slack workspace. Creating the app and credential doesn't enable this integration. See Installation guide.
- Publish the agent with a Chat message trigger if you want to use it as a standalone app. Have permission to edit the agent and configure its publishing settings.
- Give the intended users access to the agent in Glean. Installing the Slack app or granting access to its credential doesn't grant access to the agent.
Create a Slack app
- Go to api.slack.com/apps.
- Select Create New App.
- Choose From an app manifest.
- Select your workspace and paste the following manifest:
display_information:
name: Glean Agent Bot
description: Interact with Glean Agent Bot
background_color: "#343ced"
features:
app_home:
home_tab_enabled: false
messages_tab_enabled: true
messages_tab_read_only_enabled: false
bot_user:
display_name: Glean Agent Bot
always_online: true
assistant_view:
assistant_description: Ask me anything
suggested_prompts: []
oauth_config:
redirect_urls:
- https://<your-glean-deployment>-be.glean.com/slack/oauth
scopes:
bot:
- groups:read
- app_mentions:read
- channels:history
- chat:write
- files:read
- groups:history
- im:history
- mpim:history
- reactions:write
- users:read
- channels:read
- assistant:write
- im:write
- users:read.email
settings:
event_subscriptions:
request_url: https://<your-glean-deployment>-be.glean.com/slack/events
bot_events:
- message.channels
- message.groups
- message.im
- message.mpim
- app_home_opened
- assistant_thread_context_changed
- assistant_thread_started
interactivity:
is_enabled: true
request_url: https://<your-glean-deployment>-be.glean.com/slack/interaction
message_menu_options_url: https://<your-glean-deployment>-be.glean.com/slack/interaction
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false
Before you create the app, update these fields:
display_information.name: Name of the Agent as shown in Slack.display_information.description: A short description of the agent.bot_user.display_name: The bot name shown in conversations.oauth_config.redirect_urls: Replace<your-glean-deployment>with your Glean deployment name.settings.event_subscriptions.request_url: Replace<your-glean-deployment>with your Glean deployment name.settings.interactivity.request_url: Replace<your-glean-deployment>with your Glean deployment name.settings.interactivity.message_menu_options_url: Replace<your-glean-deployment>with your Glean deployment name.
Leave the listed scopes and event subscriptions unchanged unless you have specific requirements.
- Review the configuration and select Create.
- Click Install to Workspace and complete the install flow.
You do not need to complete the /slack/oauth redirect for this agent service credential setup. During Install to Workspace, Slack might open the redirect URL and display a generic error. Confirm that Slack installed the app, then continue with the service credential setup steps below.
This flow differs from Slack connector authorization, which you must complete during the connector setup.See Slack connector setup.
Keep the im:history and im:write scopes in the manifest if the agent needs direct-message access.
Verify webhook configuration
The manifest configures the Events API webhook automatically.
- Open Event Subscriptions in the Slack app settings.
- Confirm the request URL is verified.
- Confirm these bot events are listed:
message.channelsmessage.groupsmessage.immessage.mpimapp_home_openedassistant_thread_context_changedassistant_thread_started
- Open Settings → Basic Information and copy the Signing Secret.
Slack verifies the request URL by sending a challenge to the endpoint. This check doesn't validate the signing secret saved in Glean. Glean uses that secret to verify the signatures on incoming events.
Collect the app details you need for Glean
From the Slack app settings, collect these values:
| Value | Location in Slack |
|---|---|
| Bot user OAuth token | OAuth & Permissions |
| App ID | Basic Information |
| Signing Secret | Basic Information |
Create the service credential in Glean
- In Glean, go to Admin console → Tools → Service credentials.
- Click Add.
- Select Slack App under Service credentials.

- Fill in these fields:
- Credential name: A human-readable name for the credential.
- Description: A short description for what the credential is used for.
- Bot Token: The
xoxb-...token from Slack. - App ID: The Slack app ID from Basic Information. Required to publish the agent as a standalone Slack app.
- Signing Secret: The signing secret from Basic Information. Required for the standalone app's webhook setup described on this page.
- Who can use this credential: Which users or groups can select this credential for agent API access or standalone-app publishing.
- Select Save.
Don't enter the standalone app's credentials in the main Glean app's connector setup.
Attach the credential to an agent
Attach the credential for authenticated Slack API calls. This step doesn't publish the agent as a standalone app.
-
Go to Agents in Glean.
-
Select the agent to which you want to add the service credentials.
-
In the Tools tab, select Service credentials and select the Slack service credential you created.

Publish the agent as a standalone Slack app
Link the credential through either the agent's sharing settings or the Admin console. You don't need to attach it as a tool to publish the app.
Saving these settings updates the published agent's app links.
Link from Agent builder
Use a published agent with a Chat message trigger:
- Open the agent in Agent builder and click Share.
- Under Publishing options, select Slack and turn on Make this agent available in Slack.
- Under How do people access your agent in Slack?, select Via a dedicated Slack app, the standalone-app option.
- Under Select apps to deploy this agent to, select the credential. Click Add another app to link another Slack app to the same agent.
- Save the sharing settings:
- For workflow agents, click Update, then Done in the Share dialog. If Next appears instead, click it and review the agent details before confirming.
- For autonomous agents, click Save.
Link from the Admin console
Administrators can manage the same app links here:
- Go to Admin console → Embedded integrations → Glean in Slack → Standalone apps.
- Click Add agent.
- Select the agent and its Slack credential.
- Click Save.
Only published agents with a Chat message trigger that you have permission to edit and configure for publishing appear in the picker. Each credential links to one agent at a time, but an agent can use several apps. A credential already linked to another agent isn't available for a new link.
Linking a standalone app replaces the agent's Slack channel selections. Switching between Via Glean in Slack and the standalone-app option in Agent builder clears the previous mode's channel or app selections.
To remove a link, use the app link's unlink control in Standalone apps and confirm with Unlink. You can also manage app links in the agent's publishing settings. See Publishing to Slack.
Verify it works
Test the setup you configured:
- For a standalone app, use a Glean user who has access to the linked agent. Open the installed app in Slack and send a one-to-one direct message. Confirm that the linked agent responds. Don't test in a channel or group direct message.
- For API access, run the agent in Glean against a channel the app can access. For example, ask it to read recent messages in a test channel. Confirm that the response uses the expected messages.
What the agent can do
With a Slack app credential attached for API access, the agent can act in the Slack channels the app has been added to:
- Read messages and thread history
- Post messages and reply in threads
- Add reactions
The agent can only reach channels where the app is a member. It can't perform workspace-administration actions, such as managing users, channels, or workspace settings.
Security and operational notes
- Injected server-side: the agent runtime never receives the raw bot token. Glean adds the authentication header only to requests bound for the API of Slack.
- Least privilege: the app can act only in the channels it is added to, and only through the scopes in the manifest. Add the app to the minimum set of channels the agent needs, and remove scopes you do not use.
- Rotation: to rotate, reinstall the app or regenerate the bot token in Slack, update the Bot Token on the credential in Glean, then revoke the old token.