Skip to main content
By the end of this page, a Slack app is connected to Ravi through Socket Mode, the agent main answers you in a DM, in a channel and in threads, and only you and the channels you choose can reach it. Slack is the recommended channel. Ravi connects to Slack itself: messages do not go through Omni, and you need no phone and no public URL. Below, slack-main names both the channel config and the instance, main is the agent, U0123ABCD is your Slack member ID and C0123ABCD a channel ID.

Before you start

  • Ravi installed and answering in the terminal (Install Ravi; its Run without Omni section skips Omni and PostgreSQL for Slack-only use):
  • PM2 (ravi setup installs it) and permission to install apps in your Slack workspace.
  • A place for the tokens: the macOS Keychain, or a HashiCorp Vault server (KV version 2) on Linux. Ravi reads Slack tokens only from its credential broker, never from ~/.ravi/.env.
The channel config slack-main points to the tokens (credential connection slack:main). The channel runner, a separate PM2 process called ravi-channels, reads it and connects to Slack, then routes each message through the instance with the same name, which holds the agent, the policies and the routes. If the names differ, every message is held for review. ravi daemon start does not start the runner; ravi channels start does.

Set it up

1

Create the Slack app

At api.slack.com/apps, choose Create New App. Either pick From a manifest and paste the reference manifest below, or pick From scratch and set these by hand:
  1. Socket Mode: turn it on and create the app-level token with the connections:write scope. Copy it (xapp-...). Create it in Basic Information > App-Level Tokens, with or without the manifest.
  2. Event Subscriptions: turn it on and subscribe to the bot events message.im, message.channels, message.groups, message.mpim, app_mention and app_home_opened (plus reaction_added for reaction triggers).
  3. Interactivity & Shortcuts: turn it on. Approval buttons and the thread buttons need it. To control a thread from the ”…” menu of its messages, also create the three message shortcuts in Control Ravi from Slack.
  4. Slash Commands: create /ravi (or the name this app should have). With Socket Mode no Request URL is needed. Control Ravi from Slack says what it does.
  5. App Home: turn on the Messages Tab and allow users to send messages from it, or you cannot DM the app. Turn on the Home Tab too: Ravi fills it (see The Home tab).
  6. OAuth & Permissions: add the bot scopes below. Leave token rotation off: Ravi does not refresh tokens.
  7. Install to Workspace and copy the Bot User OAuth Token (xoxb-...).
Change name, display_name and command for each app: a second app in the same workspace needs its own command name (see Control Ravi from Slack). The optional scopes below are not in the manifest; add the ones you need.
Optional: reactions:read (reaction events), canvases:read/canvases:write (ravi slack canvas-*, and long replies as canvases), channels:manage/groups:write (ravi slack channels-create), links:read/links:write (unfurls), assistant:write (Working indicator).After changing scopes or events, reinstall the app, store the bot token again if it changed, and run ravi channels restart.
2

Store the tokens

The tokens go to your login Keychain. The CLI, the channel runner and the daemon (which posts approval messages) read them from there, so run Ravi as your own user.
Paste the tokens at a hidden prompt, which keeps them out of your shell history:
You should see Stored connection slack:main (keychain) (or vault), then executed: slack:main socket_mode.connect and secretResolved=yes. That proves the secret is readable, not that Slack accepts it; step 4 checks that.If connections add prints only Command failed unexpectedly., check that you passed --backend, and that VAULT_ADDR and VAULT_TOKEN are set and valid (Linux) or the security tool exists (macOS).
3

Create the channel config and the instance

show should list Agent: main, DM Policy: pairing and Group Policy: allowlist. These policies hold every DM and channel until you route it. With the default open, anyone in the workspace who DMs the app, and every human message in any channel it is in, reaches the agent.
Run each create once. Both overwrite the whole record: ravi instances create slack-main without its flags clears the agent and resets the policies to open, and ravi channels create slack-main without --credential-connection drops the tokens. To change one field, use ravi instances set slack-main <key> <value> or ravi channels set slack-main <key> <value>.
4

Start the channel runner

A healthy runner looks like this:
  • The first channels start does not save PM2’s process list, hence ravi daemon install (and pm2 startup, see Install Ravi).
  • permissions-list tests only the bot token. A wrong app token shows as an adapter that never gets to connected.
  • Run ravi channels restart after channels create or channels set, after storing new tokens, and after changing Slack settings in ~/.ravi/.env. Instances, routes and contacts reload on their own.
  • ravi daemon status does not list the runner; ravi daemon status --json does.
  • ravi channels logs follows the log until Ctrl+C. For a one-off read: pm2 logs ravi-channels --nostream --lines 200.
  • Do not run ravi channels probe while the runner is up: it opens a second Slack connection.
5

Make yourself the owner

Find your member ID in Slack: open your profile, click ⋮ (More) and choose Copy member ID. It starts with U.
  • contacts add prints the <contact-id>. --instance must be exactly slack-main. A typo is accepted silently, and then your messages do not resolve to you: the agent answers without tools. ravi contacts check U0123ABCD --json must show "instanceId": "slack-main".
  • Already have an owner contact, for example from WhatsApp? Link your Slack ID to it instead: ravi contacts link <contact-id> --channel slack --id U0123ABCD --instance slack-main.
  • The route is what lets your DMs through pairing. On Slack, an allowed contact alone is not enough.
Make yourself the owner explains the ceiling, the permission-owner tag and the risks.
6

Add a channel

In Slack, invite the app to the channel, public or private: /invite @Ravi (your app’s name). It never joins on its own. Find the channel ID at the bottom of the channel’s About tab, or with ravi slack channels-list --channel slack-main. Then:
  • Keep the group: prefix: a bare C0123ABCD route never matches. Private channels with G... IDs work the same way.
  • In a channel with other people, every member who resolves to a contact gets the agent’s whole ceiling. Govern it first (Make yourself the owner).
Do not use ravi instances pending approve with Slack IDs. For a channel it stores a broken route made of the ID’s digits, and for a member it can create a stray phone contact. The table from ravi instances pending list slack-main shows that broken pattern too; take the chatId from --json and add the route yourself.

How the agent behaves in Slack

  • With --session <name> on the DM route, your DMs go to that session and each DM thread gets a child session. To make a routed channel feed a session that already exists, run ravi sessions attach main --chat C0123ABCD (Sessions).
  • To answer channel root messages in a new thread: ravi channels set slack-main defaults '{"rootReplyMode":"new_thread"}', then ravi channels restart. This replaces the whole defaults object.
  • The agent keeps a DM or channel on its subject: work that strays from the conversation (an investigation, a fix, a long run of tools, another subject) goes to a new thread it opens with ravi sessions create-thread, where a thread session does the work. Inside a thread, it stays on that thread’s subject. This needs the agent to be allowed to run ravi sessions.
  • The DM or channel session orchestrates the threads it opens. It lists them with ravi sessions threads and gives one new instructions with ravi sessions thread-send <thread-session> "...". A thread sends progress back with ravi sessions report "..." and its result with ravi sessions close-thread --return "..."; both arrive in the channel session naming the thread by its first line. A follow-up in the channel about an existing thread’s subject goes to that thread. Threads do not message each other: one that needs something from another says so with report, and the channel session relays it with thread-send.
  • The parent configures an owned thread with ravi sessions thread-configure <thread-session> --effort ultra --json. It accepts provider, model, effort and thinking overrides, validates the complete selection and returns the saved values. Changes apply on the next turn without interrupting the current turn. Omitted fields stay unchanged; clear removes an override. Parent ownership does not grant generic access to other sessions, and provider changes retain their extra authorization check.
  • A thread the agent opens shows in the channel as a card: the first line of its initial message as the title, a short summary, who asked for it, and its status (in progress, done, reopened). The whole message opens the thread when it does not fit the card. The card updates itself when the thread reports progress, closes (showing the result) or is reopened.
  • There is no mention-only mode: every human message in a routed channel starts a turn. Other bots are ignored unless they mention your app.
  • Edited messages are ignored. Send a new one.
  • ravi contacts block does not stop Slack messages, and reply mode is not enforced. Keep people out with policies and routes (Instances and routing).
Questions with options (polls, the agent’s AskUserQuestion) do not work on Slack: Ravi cannot post a poll there (Polls are not supported on Slack), so the agent gets an error instead of your answer. Ask the agent to ask in plain text.

How replies look

The agent writes Markdown and Ravi sends it as Block Kit, so headings, lists, tables, task lists, quotes and code with syntax highlighting show as Slack draws them. An image alone on its line becomes an image.
  • A long reply is split only between blocks (paragraphs, tables, code), never inside one.
  • A long document in a reply (a markdown or text code block of 40 lines or more), or a reply too long for one message, becomes a canvas the conversation can read, and the message keeps a link to it. Without canvases:write, on a free workspace or in a DM, it is sent as a file in the same thread instead. Knowledge-guarded conversations never get a canvas or a file.
  • If Slack refuses the blocks, the reply goes out as plain Slack text, split the same way.

Working indicator

By default Ravi sets Slack’s assistant status (“is working…”) while the agent works. Slack shows it only for apps with the Agents & AI Apps feature and the assistant:write scope. If you see nothing, use a reaction instead:
The agent then puts an hourglass reaction on your message and removes it when done. RAVI_SLACK_REACTION_PRESENCE=always shows both.

The Home tab

When someone opens the app’s Home tab, Ravi publishes a default Home for that person: the agent’s name, its description, how to talk to it (the Messages tab, or a mention in a channel the app is in) and a note that nothing else is set up there yet. The agent is the one that answers that person’s DMs.
  • The description is the one the org directory shows, so it appears only while the agent is listed there (ravi agents listing main on --execute); an unlisted agent’s Home shows its name alone. Set it with ravi agents set main description "Answers questions about sales" (300 characters at most). The Home never shows the agent’s instructions or files: anyone in the workspace can open the tab.
  • The Home is published again only when its content changes, the next time the person opens it.
  • It needs the app_home_opened event and the Home Tab turned on. With the event missing, the tab stays empty. With the tab off, the runner log says Slack App Home not published: the Home Tab is off.

Approvals

When a turn asks for something the agent’s ceiling does not cover and the request goes to approval, Ravi sends a card with Approve and Reject buttons privately to each person who can grant it: an ephemeral message in the chat the request came from, which only that person sees, or a message in their DM with the app when they are not in that chat. Nobody else sees the card. Only agents on the Pi and Grok providers ask. On Claude and Codex, a shell command outside the ceiling is refused at once, and on every provider a ravi command group outside it is refused without asking.
  • A person can grant a request when their Slack user is linked to their contact on this instance and their capabilities cover it, or they have admin:system:* (your permission-owner tag).
  • When nobody can grant it, no card is sent and the request is refused at once, with that reason. Link your Slack user to your contact to receive the cards.
  • An approved command runs, and the approval lasts for that turn. For recurring access, add the executable to the agent’s ceiling.
  • Only clicks count; reactions and text replies are ignored.
  • Every click gets a private answer: your card shows the decision, and a click on a card that someone else already decided, that expired, or that you lack the permission for says so.
  • No click within 5 minutes means not approved.
  • Buttons need Interactivity on. The daemon sends the cards, so it must read the tokens too (Keychain, or the Vault variables in ~/.ravi/.env).
At full-access few requests need approval. See Permissions.

Control Ravi from Slack

/ravi controls Ravi from the chat where you type it. It is not a message to an agent: it opens no turn, spends no model tokens, and acts with your authority, the contact your Slack user is linked to. Only you see the answers.
  • The owner (permission-owner) can run all of them. Anyone else needs their Slack user linked to a contact, as for approvals, and the rights in the table. A Slack user with no contact is told so, and nothing runs.
  • A command acts on the session of the DM or channel it is typed in. Slack does not run an app’s command inside a thread, so type it in the channel or the DM, and name the thread when it is one (/ravi close <thread>, /ravi stop <thread>).
  • The card a thread opens with carries Fechar and Parar buttons (they go away when the thread is closed). Each asks Slack’s confirmation first, then does what /ravi close <thread> or /ravi stop <thread> does for that thread, with your authority, and answers only you. Nothing changes in the Slack app to turn them on: they use the same interactivity as the approval buttons. A card that was posted before this release gets them the next time Ravi updates it (a report, a close, a reopen).
  • The ”…” menu of any message in a thread can carry three message shortcuts: status of the thread, close it, stop its turn (see Message shortcuts on a thread). Status answers at once. Close and stop ask first, on a card only you see, with Confirm and Cancel, and run only when you confirm, with your authority and the same rules as the command.
  • close says why a thread did not close. The usual reason is a trigger still pointed at it: the answer names the triggers and the ravi triggers set <id> replySession <channel-session> that moves them.
  • A command that reaches Ravi more than a minute after it was typed is not run. Run it again.
  • Every command that reaches the daemon, the refused ones included, is written to the audit trail (ravi events replay --subject ravi.audit.chat_command), without what you typed. A command the runner refuses before publishing (another workspace, an origin it could not verify) shows only in the runner’s log.

Message shortcuts on a thread

The shortcuts are optional and need no Ravi setting, only the app. Once per Slack app, at Interactivity & Shortcuts:
  1. Create New Shortcut, On messages, three times, with these Callback IDs (the names are only what people read in the ”…” menu): ravi_status_thread (“Ravi: status da thread”), ravi_close_thread (“Ravi: fechar a thread”) and ravi_stop_thread (“Ravi: parar a thread”).
  2. Reinstall the app when Slack asks.
  3. ravi channels restart.
Then open the ”…” menu of any message in a Ravi thread and pick Ravi: status da thread: a card only you see appears in the thread. Close and stop ask first; Cancelar changes nothing, and a confirmation left on screen for more than ten minutes expires. A person who is not linked to a contact, or who may not change the session, is told so and nothing runs, exactly as for the command. Slack shows a private card inside a thread only once the thread has replies. On the first message of a thread nobody has answered yet, use /ravi status <thread> or the buttons on the thread’s card.

Name the command per app

Slash command names are not namespaced: if two apps in one workspace register /ravi, Slack runs the one installed most recently. Give each app its own name (/ravi on one, /hana on another) when you register it. Ravi answers under the name that was typed, so nothing is configured on the Ravi side.

Turn it on in an existing app

  1. OAuth & Permissions: add the bot scope commands.
  2. Slash Commands: create the command.
  3. Reinstall the app when Slack asks. The new scope needs it once; commands you add later do not.
  4. ravi channels restart.
Then type /ravi in a DM with the app. The DM needs the Messages Tab on, with users allowed to send messages and slash commands from it (App Home in the app’s settings); without it, type the command in a channel the app is in.

Smoke test

  1. DM. In the app’s Messages tab, send hi; the agent answers. Ask it to run ravi agents list; it runs, because you are the owner.
  2. Channel. In the routed channel, send @Ravi hi. The answer appears at the channel root.
  3. Thread. Reply in a thread under that answer. The agent answers in the thread, and ravi sessions list --agent main shows a new session for the thread: its name contains -t- followed by the thread timestamp without the dot, and its key ends in :thread:<ts>.
  4. Ceiling. Lower the ceiling with ravi agents permissions main bootstrap (it applies at once) and ask the agent in the DM to run uname -a. The command is refused, because uname is outside bootstrap (on Pi or Grok, Ravi first sends you a private card with Approve and Reject; click Reject). Restore it with ravi agents permissions main full-access --execute.

If it does not answer

  • health: stopped (not_running): run ravi channels start.
  • Adapter slack:slack-main is failed: the runner cannot read the tokens. Repeat the broker exec check from step 2 (on Linux, check the Vault variables), then ravi channels restart.
  • Adapter stuck in reconnecting (open_failed): the app token is wrong or revoked, or Socket Mode is off.
  • Log says Slack inbound held for owner review: the chat has no route, or the instance name differs from the channel config. Check ravi routes explain slack-main group:C0123ABCD.
  • Nothing in the log: the app is not in the channel, an event subscription is missing, or the app was not reinstalled after a scope change.
  • Answers without tools: your Slack ID is not linked to your contact on slack-main. Check with ravi contacts check <your contact>.
  • Approve does nothing: Interactivity is off in the Slack app.
  • /ravi fails in Slack or shows nothing: the command is not registered on that app, the runner is not connected, or the command came from a workspace this instance does not serve. ravi channels logs names the refusal (Control Ravi from Slack).
  • The Home tab stays empty or loading: subscribe the app_home_opened event and turn on the Home Tab (step 1), reinstall the app, run ravi channels restart, then open the tab again.
  • No approval card arrives and the request is refused: nobody who can grant it has their Slack user linked to their contact on slack-main. Check with ravi contacts check <your contact> (see Approvals).
More in Troubleshooting.