> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langchain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate Slack with an agent

> Connect LangSmith Fleet to your Slack workspace to let your agents communicate with users in Slack.

With LangSmith Fleet, you can add an agent to your Slack workspace so your team can work with it directly in Slack.

After you add an agent to Slack, it can:

* Receive messages from Slack and start a run with the message content.
* Reply in your Slack workspace after processing a message.
* Read thread messages and conversation history for context.
* Read file attachments included in Slack messages.

Fleet maps each agent to a single Slack app, so users experience the Slack bot as your agent deployed in Slack rather than a separate service that relays messages.

<Warning>
  Disclaimer:

  **AI-generated content**: All responses from agents in Slack are generated by AI and may contain errors or inaccuracies. Always verify important information.
</Warning>

<Info>
  The Slack integration with Fleet does not have any direct pricing. However, agent runs and traces are billed through the [LangSmith platform](https://smith.langchain.com?utm_source=docs\&utm_medium=cta\&utm_campaign=langsmith-signup\&utm_content=langsmith-fleet-slack-app) according to your organization's plan.

  For current pricing information, see the [LangSmith pricing page](https://www.langchain.com/pricing).
</Info>

## Add your agent to Slack

After you authenticate with Slack once, you can add any agent to Slack in one click. Fleet creates a Slack app for the agent and configures it with the agent's name, description, and icon.

<Note>
  One-click Slack setup is available on LangSmith Cloud. On [Self-hosted](/langsmith/deploy-self-hosted-full-platform#enable-fleet-insights-and-chat), create and link a custom Slack app manually instead. See [Connect a custom Slack app (Self-hosted)](#connect-a-custom-slack-app-self-hosted).
</Note>

### Prerequisites

* An existing agent in Fleet (see [Quickstart](/langsmith/fleet/quickstart) to create one).
* A Slack workspace where you can install apps.

### Connect Slack

<Steps>
  <Step title="Open the Channels drawer">
    Open your agent, then in the sidebar expand the **Channels** drawer.
  </Step>

  <Step title="Connect Slack">
    1. Click **Connect your first channel**, then select **Slack**.
    2. The first time you connect, authenticate with Slack and authorize Fleet. After that, adding an agent to Slack takes one click.
  </Step>

  <Step title="Confirm the Slack app">
    Fleet creates a Slack app named after your agent and links it to the agent. Each agent maps to one Slack app, and each Slack app links to one agent.
  </Step>
</Steps>

<Note>
  When your agent is first added to a Slack workspace, it sends you a direct message with tips for inviting it to channels and mentioning it.
</Note>

### Invite the agent to a channel

1. In Slack, go to the channel where you want to use the agent.
2. Type `/invite @YourAgentName` to invite it.
3. Mention the agent with `@YourAgentName` to start a run. The agent replies in a thread.

## Approve or deny actions in Slack

When an agent pauses on a tool that requires approval, it raises the request directly in Slack. The message names the tool and the action, with **Approve** and **Deny** buttons, so you can respond without leaving Slack.

For more information on approvals, see [Human-in-the-loop](/langsmith/fleet/essentials#human-in-the-loop).

## Error messages in Slack

If an agent encounters an error during a run, it replies in the Slack thread instead of going silent. For some error types, such as authentication errors, the reply includes more detail so you can resolve the issue.

## Add Slack tools

Slack tools let your agent send messages, reply in threads, read history, and send direct messages. They work regardless of how the agent was triggered, whether through Slack, the Fleet UI, a schedule, or a webhook.

For example, you could start a long-running research task in the Fleet chat UI and instruct the agent to send you a Slack message when it is done.

To add Slack tools:

1. Open your agent, then in the sidebar expand the **Connections** drawer.
2. Click **Add connection** and add Slack if it is not already connected.
3. Add the Slack tools you need:
   * **Send Channel Message**: Post a message to a channel.
   * **Reply to Message**: Reply in a thread.
   * **Write Private Message**: Send a direct message.
   * **Read Channel History**: Read recent channel messages.
   * **Read Thread Messages**: Read replies in a thread.
4. If prompted, authorize the Slack connection.

<Tip>
  You can also ask your agent to add these tools itself. In the agent chat, try: "Add the Slack tools so you can respond to messages."
</Tip>

<Note>
  Set each tool to **Auto** to run it without approval, or **Ask** to require approval before it runs. For more information, see [Human-in-the-loop](/langsmith/fleet/essentials#human-in-the-loop).
</Note>

## Connect a custom Slack app (Self-hosted)

On Self-hosted, one-click Slack setup is not available. Instead, create and link a custom Slack app manually from the **Integrations** page by copying your Slack app credentials into Fleet.

### Create the Slack app

<Steps>
  <Step title="Create a new Slack app">
    1. Navigate to the **Integrations** page in Fleet and go to the **Apps** section.
    2. Click **Add Slack App**.
    3. Enter a name for the bot.
    4. Click **Create Slack App**. You will be redirected to the Slack API site with a popup asking you to pick a workspace.

    <Warning>
      Do not create a separate Slack app outside of this flow. The app must be created through this popup.
    </Warning>
  </Step>

  <Step title="Select your workspace">
    1. Choose the workspace where you want to install the bot.
    2. Click **Next**.
    3. Click **Create Bot**.
  </Step>

  <Step title="Enter your app credentials">
    After creating the bot, you will receive your app credentials. Enter the following credentials in Fleet:

    * App ID
    * Client ID
    * Client secret
    * Signing secret

    <Note>
      Copy the full client secret and signing secret carefully to ensure a successful connection.
    </Note>
  </Step>

  <Step title="Connect OAuth">
    1. Click **Connect OAuth**.
    2. Click **Allow** to give Fleet access to your app.
  </Step>

  <Step title="Finish setup">
    Link your Slack bot to an existing agent, or click **Finish** to link later.
  </Step>
</Steps>

### Link the custom app to an agent

You can link a custom Slack app to an agent from the **Integrations** page or from the agent sidebar. Each agent can only have one Slack app, and each Slack app can only be linked to one agent.

<Tabs>
  <Tab title="From the Integrations page">
    1. Navigate to the **Slack Apps** section on the **Integrations** page in Fleet.
    2. Select the app you want to link.
    3. From the dropdown menu, choose the agent you want to link to.
    4. Verify that **\<Agent Name>** appears next to the app name.
  </Tab>

  <Tab title="From the agent sidebar">
    1. Open your agent from **My Agents** in the left-hand navigation.
    2. In the sidebar, expand the **Channels** drawer.
    3. Select **Slack**.
    4. From the dropdown menu, select the Slack app you want to link.
  </Tab>
</Tabs>

## Troubleshooting

### Agent does not respond

If your agent is not responding, you can try the following:

* Check the thread in the Fleet UI for errors.
* Verify the agent was invited to the channel.
* Try deleting the Slack app in the **Channels** drawer, then going through [setup](#add-your-agent-to-slack) again.

### Not allowed to tag the bot

If you receive a private message saying you are not allowed to tag the bot, your Slack ID is not authorized for that agent. The agent's owner needs to share the agent with you, either by sharing run access with the whole workspace or with you individually.

## Next steps

<CardGroup cols={3}>
  <Card title="Add more tools" icon="puzzle" href="/langsmith/fleet/tools">
    Connect additional services to your agent
  </Card>

  <Card title="Add more channels" icon="bolt" href="/langsmith/fleet/channels">
    Set up email, schedule, or webhook channels
  </Card>

  <Card title="Use templates" icon="layout-grid" href="/langsmith/fleet/templates">
    Start from a prebuilt agent template
  </Card>
</CardGroup>

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/fleet/slack-app.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
