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

# Slack

> Connect to Slack workspaces to read and send messages, manage channels, and interact with users

## Overview

The Slack server enables AI assistants to interact with your [Slack](https://slack.com) workspaces, allowing seamless communication, channel management, and team collaboration through conversational AI.

## How to Add Slack

<Steps>
  <Step title="Create Slack App">
    1. Go to [https://api.slack.com/apps](https://api.slack.com/apps)
    2. Click **Create New App**
    3. Select **From scratch**
    4. Name your app and select your workspace
  </Step>

  <Step title="Configure OAuth Permissions">
    1. In your app settings, click **OAuth & Permissions** in the left menu
    2. Under **Scopes > Bot Token Scopes**, add the required access permissions

    <Info>
      **Required OAuth Scopes**

      For the test commands below to work, add these minimum Bot Token Scopes:

      * `channels:read` - List and view basic channel information
      * `channels:history` - Read message history from public channels

      Depending on your use case, you may also want to add:

      * `chat:write` - Post messages to channels
      * `users:read` - View basic user information
      * `reactions:read` - View emoji reactions
      * `reactions:write` - Add emoji reactions to messages
      * `files:read` - Access file content

      You can always add more scopes later by returning to the **OAuth & Permissions** page in your Slack app settings.
    </Info>

    3. Scroll up and click **Install to \[workspace]**
    4. Invite the bot to the requisite channels:
       * Open the Slack channel where you want the bot to work
       * Click on the channel name at the top to open channel details
       * Go to the **Integrations** tab
       * Click **Add apps** and select your bot
       * Alternatively, you can type `/invite @YourBotName` in any channel to add it
    5. Restart Slack to ensure the changes take effect
    6. Copy the **Bot User OAuth Token** that appears in the **OAuth & Permissions** section in the left menu
  </Step>

  <Step title="Connect to Civic">
    1. Add the Slack server to your Civic environment through the server directory
  </Step>

  <Step title="Test Connection">
    1. Start with a simple command like `list channels` or `get recent messages from #general` to verify the connection works properly.
    2. You will be prompted to authorize the connection with Slack using the bot token that you copied from step 2.6.
  </Step>
</Steps>

<Tip>
  If you have difficulty prompting the bot to update OAuth token, go to **Civic > Org & Toolkit > Account**, delete Slack, then re-add the Slack server to get the prompt again.
</Tip>

## What You Can Do

<CardGroup cols={2}>
  <Card title="Team Communication" icon="users">
    Send messages, reply to threads, and interact with team members across channels
  </Card>

  <Card title="Channel Management" icon="list-ul">
    List channels, browse conversations, and access channel history
  </Card>

  <Card title="User Interactions" icon="robot">
    Get user profiles, add reactions, and engage with workspace members
  </Card>

  <Card title="Thread Management" icon="comments">
    Reply to message threads and retrieve threaded conversations
  </Card>
</CardGroup>

## Available Tools (8)

### Communication Tools

<AccordionGroup>
  <Accordion title="slack_post_message">
    `slack_post_message` — Post a new message to a Slack channel
  </Accordion>

  <Accordion title="slack_reply_to_thread">
    `slack_reply_to_thread` — Reply to a specific message thread in Slack
  </Accordion>

  <Accordion title="slack_add_reaction">
    `slack_add_reaction` — Add a reaction emoji to a message
  </Accordion>
</AccordionGroup>

### Channel Management

<AccordionGroup>
  <Accordion title="slack_list_channels">
    `slack_list_channels` — List public or pre-defined channels in the workspace with pagination
  </Accordion>

  <Accordion title="slack_get_channel_history">
    `slack_get_channel_history` — Get recent messages from a channel
  </Accordion>

  <Accordion title="slack_get_thread_replies">
    `slack_get_thread_replies` — Get all replies in a message thread
  </Accordion>
</AccordionGroup>

### User Management

<AccordionGroup>
  <Accordion title="slack_get_users">
    `slack_get_users` — Get a list of all users in the workspace with their basic profile information
  </Accordion>

  <Accordion title="slack_get_user_profile">
    `slack_get_user_profile` — Get detailed profile information for a specific user
  </Accordion>
</AccordionGroup>

## Use Cases

### Team Collaboration

* **Daily Standups**: "Post our team standup summary to #engineering"
* **Project Updates**: "Reply to the latest message in #project-alpha with our status update"
* **Announcements**: "Send a message to #general about the deployment completion"

### Communication Management

* **Message Monitoring**: "Show me the last 20 messages from #support"
* **Thread Following**: "Get all replies in the thread about the database issue"
* **Team Engagement**: "Add a ✅ reaction to the latest message in #deployment"

### Team Insights

* **User Discovery**: "List all users in the workspace"
* **Profile Lookup**: "Get John's profile information"
* **Channel Overview**: "Show me all available channels"

<Note>
  The Slack server requires appropriate workspace permissions and bot token configuration to access channels and send messages. Remember to invite your bot to any channels you want it to access.
</Note>

***

## Guardrails

In addition to the [14 universal guardrails](/civic/concepts/guardrails), this server has **3 server-specific guardrails** across all operations.

<Note>
  Slack's server-specific guardrails are scoped versions of the universal guardrails — the same rules applied explicitly at the Slack server level, covering all operations rather than individual tools.
</Note>

| Guardrail                  | Operation          | Timing   | Description                                                       |
| -------------------------- | ------------------ | -------- | ----------------------------------------------------------------- |
| Block PII in Requests      | *(all operations)* | Request  | Prevents sending PII in request parameters — Slack-scoped version |
| Redact Credit Card Numbers | *(all operations)* | Response | Redacts credit card numbers from Slack responses                  |
| Redact Email Addresses     | *(all operations)* | Response | Redacts email addresses from Slack responses                      |

<Tip>
  Configure guardrails via the Civic UI or ask the Configurator Agent: "Add guardrails to my Slack server."
</Tip>
