Skip to main content
The Slack channel lets workspace members talk to your Managed Deep Agent from Slack. You declare triggers under channels/, point the Slack app Events Request URL at your deployment, and the runtime verifies signatures, runs the agent, and can auto-reply in the same thread or DM.
Managed Deep Agents is in private beta, available on LangSmith Cloud in the US region only. Join the waitlist to request access.
For the channel model and current limits, see Channels.

Prerequisites

  • A Managed Deep Agents project with a root identity declaration (channels/ requires identity).
  • A Slack app you can install into a workspace.
  • Deploy or local Agent Server URL for Event Subscriptions (after first deploy, copy it from the LangSmith deployment dashboard).

Add a Slack channel

Add channels/slack.py or channels/slack.ts next to your agent entry. The file name becomes the channel name (slackPOST /channels/slack/events). Export a named channel created with define_slack_channel / defineSlackChannel.
Pair this with an identity preset that matches your product:
For browser + Slack account linking (same actor across web and Slack), use validated_token ingress and Connect-with-Slack instead of a bare shared-bot install.

How Slack Events work

  1. Slack POSTs to https://<agent-server>/channels/slack/events (the file stem slack becomes the path segment).
  2. The runtime verifies the Slack signing secret against the raw body and returns HTTP 200 within Slack’s ack window.
  3. In the background it invokes the graph over trusted loopback, stamping actor and source-thread identity (source.provider: "slack").
  4. When autoReply is enabled, it posts the agent response back with the Slack Web API (and can set assistant loading status while the run is in progress).
LangGraph auth is bypassed only on POST /channels/{name}/events so Slack can deliver without an ingress secret; the loopback invoke still uses MDA_INGRESS_SECRET.

Channel options

Triggers and Slack bot events

mda derives required OAuth scopes from the on list at compile time. After you change scopes in the Slack app, reinstall the app to the workspace so the new scopes apply.

Required secrets

Put these in the project .env (or LangSmith workspace secrets) before mda deploy. Deploy preflights the Slack pair when channels/ is present. Optional install pins for tests or multi-install hardening: SLACK_API_APP_ID, SLACK_TEAM_ID, SLACK_BOT_USER_ID.

Configure the Slack app

Create or open a Slack app at api.slack.com/apps, then wire Event Subscriptions and OAuth to your Agent Server.

1. Create the app and install it

  1. Create an app from scratch in the workspace you will use for testing.
  2. Under OAuth & Permissions, add the bot token scopes that match your on triggers (at minimum chat:write plus the history/mention scopes above).
  3. Install the app to the workspace and copy the Bot User OAuth Token into SLACK_BOT_TOKEN.
  4. Under Basic Information, copy the Signing Secret into SLACK_SIGNING_SECRET.
Slack App Credentials section showing App ID, Client ID, masked Client Secret, and masked Signing Secret

Slack app Basic Information → App Credentials

Copy the Signing Secret into SLACK_SIGNING_SECRET. For Connect-with-Slack, also copy Client ID into SLACK_CLIENT_ID and Client Secret into SLACK_CLIENT_SECRET. Prefer the Signing Secret over the deprecated Verification Token.

2. Point Event Subscriptions at your deployment

Deploy the agent first (or run mda dev) so the Events URL exists, then enable Event Subscriptions: Replace <agent-server> with the Agent Server URL from mda deploy / the LangSmith deployment dashboard (for local dev, use your publicly reachable tunnel or equivalent—Slack must reach the URL). Slack sends a url_verification challenge; the managed runtime responds automatically when the signing secret matches.

3. Subscribe to bot events

Under Subscribe to bot events, add every event your triggers need:
  • app_mention
  • message.im (for direct_message)
  • message.channels and message.groups (for thread_reply)
Invite the bot to each channel where you will @mention it. Add message.groups when the bot should continue threads in private channels (not shown in the example below).
Slack Event Subscriptions page showing Enable Events on, a verified Request URL ending in /channels/slack/events, and bot events app_mention, message.channels, and message.im

Event Subscriptions with a verified Request URL and bot event subscriptions

4. Confirm bot token scopes

Under OAuth & Permissions → Bot Token Scopes, confirm scopes match the table above. If you add scopes after the first install, reinstall the app, then re-invite the bot to channels. Add groups:history when the bot should continue threads in private channels (not shown in the example below).
Slack Bot Token Scopes listing app_mentions:read, channels:history, chat:write, and im:history

OAuth & Permissions → Bot Token Scopes

Deploy and smoke-test

  1. Put Slack secrets in .env and ensure identity is declared.
  2. Run mda deploy (or mda dev with a reachable Events URL).
  3. Set the Slack Request URL to https://<agent-server>/channels/slack/events and verify it.
  4. In Slack, @mention the bot in a channel where it is invited (or DM it if direct_message is enabled).
  5. Confirm the bot shows a loading status (when supported) and posts a reply when autoReply is true.
Test the project locally with mda dev, then deploy it with mda deploy. Open deployment traces in LangSmith to inspect model calls, tool calls, errors, and latency.

Optional: Connect-with-Slack

Connect-with-Slack maps a Slack user (slack:T…:U…) to a web/guest actor so the same person keeps one thread history across browser and Slack when scoping.threads is "actor". When OIDC is configured (SLACK_CLIENT_ID, SLACK_CLIENT_SECRET, MDA_PUBLIC_APP_URL, and a signing key such as MDA_GUEST_SIGNING_KEY):
  • Linked users — Events remap to the web actor and the agent runs.
  • Unlinked users — The bot replies with a connect link; no agent run until they finish OAuth.
Shared-bot projects without OIDC keep Slack actors as-is (slack:T…:U…).

Slack OAuth redirect URLs

On LangGraph Host, set MDA_PUBLIC_API_URL to the public Agent Server URL so Slack’s redirect_uri is not an internal loopback. mda deploy can inject MDA_PUBLIC_API_URL when the deployment already has a runtime URL; set it in .env after the first deploy if needed. Deploy also derives CORS_ALLOW_ORIGINS from MDA_PUBLIC_APP_URL (add more hosts with MDA_CORS_ORIGINS or an explicit CORS_ALLOW_ORIGINS). Managed connect routes on the Agent Server:
Slack Redirect URLs showing https://…/identity/slack/callback saved for Connect-with-Slack OAuth

OAuth & Permissions → Redirect URLs

Slack message from the MDA app telling an unlinked user to connect their account via a settings URL before using the agent

Connect-with-Slack prompt for an unlinked user

Troubleshooting

Next steps

Channels

See how channel discovery and Events ingress work.

Identity

Choose shared-bot vs linked validated_token for Slack callers.

Deploy an agent

Route secrets and deploy the channel-enabled agent.

CLI reference

Look up channels/ packaging and deploy preflight.