Slack Bot

View as Markdown

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

RequirementWhy it is requiredCheck
OpenCore Administrator accessBot and channel configuration endpoints require full Admin Panel access.Confirm the intended operator can open Slack Bots in the Admin Panel.
Running Slack bot listenerSocket 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 administrationThe 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 boundaryChannel 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.

1display_information:
2 name: AIephant OpenCore Bot
3features:
4 bot_user:
5 display_name: AIephant OpenCore Bot
6 always_online: true
7 slash_commands:
8 - command: /opencore
9 description: Ask AIephant OpenCore Bot
10 should_escape: false
11oauth_config:
12 scopes:
13 bot:
14 - app_mentions:read
15 - channels:history
16 - channels:read
17 - chat:write
18 - commands
19 - groups:history
20 - groups:read
21 - im:history
22 - im:read
23 - reactions:write
24 - usergroups:read
25 - users:read
26 - users:read.email
27 user:
28 - channels:history
29 - channels:read
30 - groups:history
31 - groups:read
32 - im:history
33 - im:read
34 - mpim:history
35 - mpim:read
36 - search:read
37 - users.profile:read
38 - users:read
39settings:
40 event_subscriptions:
41 bot_events:
42 - app_mention
43 - message.channels
44 - message.groups
45 - message.im
46 interactivity:
47 is_enabled: true
48 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.

FieldRequiredSource and boundary
NameYesLocal Admin Panel label. Keep it as AIephant OpenCore Bot for a consistent visible identity.
Slack Bot TokenYesBot OAuth token from the installed app, normally carrying an xoxb- prefix. It is used for Slack Web API calls.
Slack App TokenYesApp-level token from Socket Mode, normally carrying an xapp- prefix. It opens the WebSocket connection.
Slack User TokenNoUser 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

BoundaryCurrent behaviorAdministrator action
Default configurationApplies 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 configurationMatches 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 handlingHandles 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 messagesSelf-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 visibilityWithout 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

SymptomLikely boundaryCheck
Token rejected on create or updateToken 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 connectsListener 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 notTag-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 audienceDefault/channel configuration, allowlist resolution, or ephemeral mode is not what the operator expected.Stop rollout and repeat visibility tests with non-sensitive content.