> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.alephant.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.alephant.io/_mcp/server.

# Slack Bot

> Create and operate AIephant OpenCore Bot over Slack Socket Mode with explicit event, channel, and reply boundaries.

AIephant OpenCore Bot lets approved Slack users ask questions through the OpenCore Slack listener. The Slack app, its tokens, channel membership, and reply policy remain administrator-managed boundaries.

This capability works only when the deployment runs the Slack bot listener and an Administrator can access the Slack Bots settings. Creating a record in OpenCore does not create a Slack app or start a listener that the deployment has disabled.

## Availability and prerequisites

| Requirement                   | Why it is required                                                                                  | Check                                                                                                |
| ----------------------------- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| OpenCore Administrator access | Bot and channel configuration endpoints require full Admin Panel access.                            | Confirm the intended operator can open **Slack Bots** in the Admin Panel.                            |
| Running Slack bot listener    | Socket Mode events are consumed by a separate listener process.                                     | Confirm the deployment profile enables the Slack bot workload and its logs show a socket connection. |
| Slack app administration      | The app must be installed with the events and scopes used by the current listener.                  | Use an approved Slack workspace and an app owner who can reinstall after scope changes.              |
| Approved data boundary        | Channel replies can expose public knowledge, while private replies can use user-authorized content. | Decide the channel, Agent or document-set scope, and reply visibility before rollout.                |

## Create the Slack app from a manifest

The OpenCore form accepts tokens; it does not generate a Slack app manifest. In Slack, create an app **from an app manifest**, review the requested scopes, and install it in the approved workspace. The following template matches the current listener's Socket Mode events and API calls; administrators must review it against current Slack requirements and remove optional capabilities they do not use.

The optional slash command and User Token scopes are included for the corresponding listener and enhanced private-channel search paths. If your deployment does not use them, remove them only after testing the resulting workflow.

```yaml
display_information:
  name: AIephant OpenCore Bot
features:
  bot_user:
    display_name: AIephant OpenCore Bot
    always_online: true
  slash_commands:
    - command: /opencore
      description: Ask AIephant OpenCore Bot
      should_escape: false
oauth_config:
  scopes:
    bot:
      - app_mentions:read
      - channels:history
      - channels:read
      - chat:write
      - commands
      - groups:history
      - groups:read
      - im:history
      - im:read
      - reactions:write
      - usergroups:read
      - users:read
      - users:read.email
    user:
      - channels:history
      - channels:read
      - groups:history
      - groups:read
      - im:history
      - im:read
      - mpim:history
      - mpim:read
      - search:read
      - users.profile:read
      - users:read
settings:
  event_subscriptions:
    bot_events:
      - app_mention
      - message.channels
      - message.groups
      - message.im
  interactivity:
    is_enabled: true
  socket_mode_enabled: true
```

Create an app-level token with the Socket Mode connection scope in Slack, then reinstall the app whenever Slack says changed scopes or events require it. Invite AIephant OpenCore Bot to each private or public channel it should receive; scopes do not grant channel membership.

## Add the tokens in OpenCore

Open **Admin Panel → Slack Bots → New Slack Bot** and use the exact visible name **AIephant OpenCore Bot**. The backend validates each supplied token with Slack before saving it.

| Field            | Required | Source and boundary                                                                                                                              |
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| Name             | Yes      | Local Admin Panel label. Keep it as **AIephant OpenCore Bot** for a consistent visible identity.                                                 |
| Slack Bot Token  | Yes      | Bot OAuth token from the installed app, normally carrying an `xoxb-` prefix. It is used for Slack Web API calls.                                 |
| Slack App Token  | Yes      | App-level token from Socket Mode, normally carrying an `xapp-` prefix. It opens the WebSocket connection.                                        |
| Slack User Token | No       | User OAuth token with an `xoxp-` prefix. It is used only by supported enhanced Slack search paths and expands the data the credential can reach. |

Store tokens only in the password fields and your approved secret-management process. Do not paste them into manifests, chat, tickets, logs, screenshots, or source control.

## Channel and reply boundaries

| Boundary                       | Current behavior                                                                                                                                                                                      | Administrator action                                                                                    |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| Default configuration          | Applies to all channels and direct messages; a new bot defaults to reply only when tagged outside DMs.                                                                                                | Keep the default narrow, or disable it and add explicit channel configurations.                         |
| Explicit channel configuration | Matches the configured Slack channel name and can select public knowledge, document sets, or an Agent.                                                                                                | Enter the channel name without `#` and confirm the bot is a member.                                     |
| Event and thread handling      | Handles app mentions, supported message events, DMs, and the configured slash command. Untagged non-root thread replies are ignored; mentions and DMs may continue in thread.                         | Test a root message, a mention, a DM, and a thread reply separately.                                    |
| Bot messages                   | Self-messages and Slack's system bot are ignored. Other bot messages are ignored unless directly tagged or **Respond to Bot messages** is enabled.                                                    | Leave bot-to-bot replies off unless loops and cost controls have been tested.                           |
| Reply visibility               | Without a user/group allowlist, replies are channel messages. An allowlist scopes invocation and sends replies ephemerally to resolved members; the private-reply option targets the requesting user. | Treat unresolved allowlists as a fail-closed condition and verify visibility with representative users. |

Disabling the default configuration removes DM replies and leaves only explicitly configured channels. A question-mark filter, tag-only mode, response validity check, selected knowledge source, and per-channel disabled state can further suppress a reply.

## Knowledge and privacy

Public channel replies use public knowledge within the selected scope. Document sets or search Agents that contain auto-synced permission-aware connectors are not selectable for ordinary channel-visible replies because the answer could expose private content.

Private ephemeral replies can use content already authorized for the requesting user when the selected search path supports it. Slack users can still copy or share a reply, so an ephemeral response is not a substitute for source authorization or company sharing policy.

## Updates, enablement, and removal

Changing the Bot or App token causes the listener reconciliation loop to close the existing socket client and reconnect with the new token pair. Renaming the local record does not rename the Slack app; update the Slack app display name separately and keep both names as **AIephant OpenCore Bot**.

Turning **Enabled** off causes incoming requests for that bot record to be ignored. Turning it on resumes processing when the listener next reads the record. Deletion does not guarantee socket cleanup: reconciliation closes all clients only when the tenant has no bot records. If another bot remains, the deleted bot's stale socket is not explicitly removed. Disable the bot before removal, revoke all Slack-side tokens associated with the record—the Bot, App, and any configured User token—and restart the listener when guaranteed in-memory cleanup is required; token rotation remains the safe path for a bot that will stay configured.

## Verify

1. Confirm Socket Mode is enabled, the app is installed, and the listener establishes a connection without logging token values.
2. Mention AIephant OpenCore Bot in an approved channel and confirm one threaded reply.
3. Send a DM and verify it follows the default configuration; disable the default configuration and confirm the DM becomes silent.
4. Test an unconfigured channel, configured channel, non-member, allowlisted member, bot-authored message, and private reply.
5. Rotate the App and Bot tokens, update them in OpenCore, and confirm the listener reconnects before revoking the old tokens.

## Troubleshooting

| Symptom                                    | Likely boundary                                                                                           | Check                                                                                                  |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| Token rejected on create or update         | Token is invalid, revoked, or the wrong token class.                                                      | Regenerate the relevant Slack token and verify Bot, App, and optional User fields were not swapped.    |
| Socket never connects                      | Listener workload is absent, Socket Mode is off, or the App token cannot open a connection.               | Check deployment workload status and Slack Socket Mode configuration.                                  |
| Mention works but ordinary messages do not | Tag-only mode, channel membership, event subscription, or channel configuration is limiting input.        | Compare the manifest events with the Admin Panel configuration and reinstall after Slack-side changes. |
| Reply reaches the wrong audience           | Default/channel configuration, allowlist resolution, or ephemeral mode is not what the operator expected. | Stop rollout and repeat visibility tests with non-sensitive content.                                   |

## Related pages

* [Enterprise Integrations](/opencore/governance/enterprise-integrations) explains the conditional integration boundary.
* [Slack connector](/opencore/knowledge/connectors/slack) covers Slack content indexing, which is separate from the interactive bot.
* [Manage Agents](/opencore/agents/agents) explains the Agents selectable by a channel configuration.
* [Usage, Identity & Security](/opencore/governance/usage-and-security) covers identity and secret-handling controls.