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 setupinstalls 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.
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:
Change
- Socket Mode: turn it on and create the app-level token with the
connections:writescope. Copy it (xapp-...). Create it in Basic Information > App-Level Tokens, with or without the manifest. - Event Subscriptions: turn it on and subscribe to the bot events
message.im,message.channels,message.groups,message.mpim,app_mentionandapp_home_opened(plusreaction_addedfor reaction triggers). - 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.
- 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. - 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).
- OAuth & Permissions: add the bot scopes below. Leave token rotation off: Ravi does not refresh tokens.
- Install to Workspace and copy the Bot User OAuth Token (
xoxb-...).
Reference manifest
Reference manifest
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
- macOS
- Linux
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.
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.4
Start the channel runner
- The first
channels startdoes not save PM2’s process list, henceravi daemon install(andpm2 startup, see Install Ravi). permissions-listtests only the bot token. A wrong app token shows as an adapter that never gets toconnected.- Run
ravi channels restartafterchannels createorchannels set, after storing new tokens, and after changing Slack settings in~/.ravi/.env. Instances, routes and contacts reload on their own. ravi daemon statusdoes not list the runner;ravi daemon status --jsondoes.ravi channels logsfollows the log until Ctrl+C. For a one-off read:pm2 logs ravi-channels --nostream --lines 200.- Do not run
ravi channels probewhile 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 addprints the<contact-id>.--instancemust be exactlyslack-main. A typo is accepted silently, and then your messages do not resolve to you: the agent answers without tools.ravi contacts check U0123ABCD --jsonmust 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, anallowedcontact alone is not enough.
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 bareC0123ABCDroute never matches. Private channels withG...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).
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, runravi sessions attach main --chat C0123ABCD(Sessions). - To answer channel root messages in a new thread:
ravi channels set slack-main defaults '{"rootReplyMode":"new_thread"}', thenravi channels restart. This replaces the wholedefaultsobject. - 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 runravi sessions. - The DM or channel session orchestrates the threads it opens. It lists them with
ravi sessions threadsand gives one new instructions withravi sessions thread-send <thread-session> "...". A thread sends progress back withravi sessions report "..."and its result withravi 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 withreport, and the channel session relays it withthread-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;clearremoves 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 blockdoes 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
markdownortextcode 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. Withoutcanvases: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 theassistant:write scope. If you see nothing, use a reaction instead:
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 withravi 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_openedevent and the Home Tab turned on. With the event missing, the tab stays empty. With the tab off, the runner log saysSlack 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 aravi 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:*(yourpermission-ownertag). - 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).
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.
closesays why a thread did not close. The usual reason is a trigger still pointed at it: the answer names the triggers and theravi 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:- 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”) andravi_stop_thread(“Ravi: parar a thread”). - Reinstall the app when Slack asks.
ravi channels restart.
/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
- OAuth & Permissions: add the bot scope
commands. - Slash Commands: create the command.
- Reinstall the app when Slack asks. The new scope needs it once; commands you add later do not.
ravi channels restart.
/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
- DM. In the app’s Messages tab, send
hi; the agent answers. Ask it to runravi agents list; it runs, because you are the owner. - Channel. In the routed channel, send
@Ravi hi. The answer appears at the channel root. - Thread. Reply in a thread under that answer. The agent answers in the thread, and
ravi sessions list --agent mainshows 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>. - Ceiling. Lower the ceiling with
ravi agents permissions main bootstrap(it applies at once) and ask the agent in the DM to rununame -a. The command is refused, becauseunameis outsidebootstrap(on Pi or Grok, Ravi first sends you a private card with Approve and Reject; click Reject). Restore it withravi agents permissions main full-access --execute.
If it does not answer
health: stopped (not_running): runravi channels start.- Adapter
slack:slack-mainisfailed: the runner cannot read the tokens. Repeat thebroker execcheck from step 2 (on Linux, check the Vault variables), thenravi 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. Checkravi 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 withravi contacts check <your contact>. - Approve does nothing: Interactivity is off in the Slack app.
/ravifails 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 logsnames the refusal (Control Ravi from Slack).- The Home tab stays empty or loading: subscribe the
app_home_openedevent and turn on the Home Tab (step 1), reinstall the app, runravi 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 withravi contacts check <your contact>(see Approvals).