- Install and verify Omni.
- Install and verify Ravi.
- Configure the main WhatsApp instance.
- Configure the main agent.
- Create a REBAC audit group and route it to a dedicated audit agent.
- Add permission audit triggers.
- Run smoke checks.
ravi directly throughout this runbook.
Do not create wrapper variables for first-time setup.
0. Operating Assumptions
- Bun is installed and its global bin directory is on
PATH. - Omni is the channel gateway.
- Ravi owns agents, sessions, routing, policies, permissions, triggers, cron, and durable runtime state.
- The Ravi source repo is only needed for development. A normal install uses the published global CLI.
- Secrets stay in local environment files or a secret manager. Never paste them into chats, docs, or committed files.
1. Install Omni
Omni must be installed before Ravi can connect WhatsApp, Telegram, Discord, Slack, or other channel accounts.omni install is the interactive setup wizard. It handles server setup, process
manager setup, API key generation, and startup. For scripted installs:
omni auth status is not authenticated but the server is running, login with
the API key printed by the install/startup banner:
ravi instances create and
ravi instances connect.
Keep the boundary clear:
- Omni owns transport and provider connection.
- Ravi owns semantic runtime concepts:
agent,instance,route,session,contact,chat,policy, andpermission.
2. Install Ravi
Install the global CLI:- the runtime provider credentials used by this deployment;
OMNI_API_URL;OMNI_API_KEY;NATS_URL, if not using the default local NATS endpoint.
3. Create the Main Agent
Recommended convention:- agent id:
main - display name:
Ravi - workspace:
~/ravi/main
~/ravi/main/AGENTS.md with the operating identity and rules for the
main assistant. Minimal bootstrap shape:
4. Create and Connect the Main Instance
Create the WhatsApp instance with conservative defaults:First DM Smoke Test
Send a WhatsApp DM to the connected account. BecausedmPolicy is pairing,
the sender should appear as pending:
5. Add a REBAC Audit Group
The REBAC audit group should be handled by a dedicated agent. Do not overload the main agent with permission audit work. Recommended convention:- group name:
ravi - rebac - agent id:
ravi-rebac - workspace:
~/ravi/ravi-rebac
~/ravi/ravi-rebac/AGENTS.md:
Permission Profile
Start with an observer profile:ravi permissions list, grant, or revoke, it
currently needs superadmin access because the permissions CLI group is protected
as superadmin:
Route the Audit Group
In WhatsApp:- Create the group.
- Add the connected Ravi account.
- Send a message in the group.
ravi-rebac answers there.
6. Add Permission Audit Triggers
Important delivery rule: triggers capture their reply session and outbound source from the context that creates them. If you create a trigger from a plain shell with no chat context, the trigger can run but may not know which WhatsApp group should receive the report. Preferred setup:- Route the audit group to
ravi-rebac. - Send a message in that group asking
ravi-rebacto create its own triggers. - The trigger creation command runs inside the audit group context, so future trigger reports return to that group.
Permission Denials
Permission CLI Changes From Sessions
Permission CLI Changes From Shell
Unknown Instance Events
--account is enough. --account
selects the channel account; it is not a chat destination.
7. Smoke Checks
Run the cross-checks before calling setup complete:- Omni is connected.
- Ravi daemon is running.
maininstance is connected to WhatsApp.- DM policy is not accidentally open unless this is intentional.
- Group policy is not accidentally open unless this is intentional.
- Main DM replies work.
- Audit group replies work.
- Permission denial trigger fires to the audit group.
8. Recommended Baseline After First Setup
Once the first environment works, add these next:- A
devagent for Ravi core development. - A
ravi-rebacaudit agent for permission and route mapping. - A metrics observer agent for runtime KPIs.
- A daily or hourly observer cron for system health.
- A backup routine for
~/.ravi/ravi.db. - A documented list of connected Omni accounts and their owning agents.
- A route inventory exported from:
9. Troubleshooting
Messages arrive but no agent responds
Check instance policy and pending entries:groupPolicy=allowlist, it needs an explicit route:
A route exists but the wrong session replies
Routes select agents. Session subscriptions can keep an existing session attached to a chat. Inspect sessions and routes together before changing policies.Trigger fires but does not post to WhatsApp
The trigger probably lacks a deliverable reply source. Recreate it from inside the audit group context after the group is routed and responding.Permission check says allowed but Bash still fails
REBAC is one permission layer. Runtime hooks, workspace policies, or local provider rules can still block execution. Read the denial text before adding broader grants.Omni is connected but Ravi cannot see channels
Verify Ravi can read Omni config or environment:10. Bootstrap Completion Record
At the end of setup, record:- machine hostname;
- Ravi source path;
- Omni account names;
- connected Ravi instance names;
- main agent id and workspace;
- audit agent id and workspace;
- audit group id;
- trigger ids;
- permission profile chosen for each agent;
- known intentional broad grants.