Skip to main content

Overview

Ravi uses a Relation-Based Access Control (REBAC) model. Every permission is a relation:
For example, (agent:dev) execute (group:contacts) means the agent dev can run CLI commands in the contacts group. New agents are closed by default — they have no permissions until explicitly granted. Denied actions emit audit events to ravi.audit.denied.

Core Concepts

Subjects

A subject is the entity requesting access. In Ravi, subjects are always agents:

Relations

Relations define what kind of access is being granted:

Objects

Objects are the resources being accessed:

Permission Resolution

When the engine evaluates can(agent:dev, execute, group:daemon), it checks in this order:
  1. Superadmin — Does (agent:dev, admin, system:*) exist? If yes, allowed.
  2. Direct relation — Does (agent:dev, execute, group:daemon) exist? If yes, allowed.
  3. Wildcard — Does (agent:dev, execute, group:*) exist? If yes, allowed.
  4. Pattern match — Does any relation like (agent:dev, execute, group:dae*) match? If yes, allowed.
  5. Tool group — If checking a tool, does the agent have a toolgroup that includes it? If yes, allowed.
  6. Denied — No match found.
When no agent context exists (direct CLI call, not from an agent session), all checks return allowed.

Wildcards

Wildcards only work as a trailing suffix on the object ID:

CLI Command Groups

Groups with scope: admin require an execute grant. Use group:<name> as the object:

Subcommand Access

Grant access to a single command within a group:

Open Groups (No Grant Required)

These groups work for any agent without explicit permissions:
  • sessions (open) — but modification commands check session scope inline
  • media, react, tools, transcribe, video, whatsapp.dm (open)
  • cron, triggers (resource) — check resource ownership

SDK Tools

Control which SDK tools an agent can use with the use relation:
Available SDK tools: Bash, Read, Edit, Write, Glob, Grep, WebFetch, WebSearch, Task, TaskOutput, TaskStop, TodoWrite, NotebookEdit, AskUserQuestion, EnterPlanMode, ExitPlanMode, EnterWorktree, Skill, TeamCreate, TeamDelete, SendMessage, LSP, ToolSearch.

Tool Groups

Instead of granting tools one by one, use tool groups for bulk access:
Tool groups combine with individual grants. An agent with toolgroup:read-only and tool:Bash has access to all read-only tools plus Bash. When the engine checks can(agent:dev, use, tool, Read), if no direct tool:Read grant exists, it checks whether any granted toolgroup includes Read.

System Executables

Control which system binaries an agent can invoke through Bash:

Templates

Templates apply a preset of permissions in one command:
full-access only answers the Ravi REBAC question. A command can still be denied later by provider-native hooks, workspace hooks, external PreToolUse filters, or other runtime policies outside the REBAC store. When ravi permissions check says allowed but Bash still fails, inspect the denial source before changing more permissions.

Safe Executables List

The safe-executables template grants access to commonly needed development binaries: ls, cat, head, tail, find, mkdir, cp, mv, touch, git, grep, rg, awk, sed, jq, node, npm, bun, python3, make, cargo, go, jest, vitest, eslint, prettier, echo, date, pwd, which, and others.

Config-Synced Permissions

Some permissions are automatically derived from agent configuration fields and synced on daemon boot. These use source=config and are regenerated by ravi permissions sync. Manual grants (source=manual) are never affected by sync.

Relation Sources

Every relation has a source that indicates how it was created:

Audit Events

When a permission check fails, an audit event is published to the NATS topic ravi.audit.denied:
You can subscribe to these events for monitoring:
Or create a trigger to react to denied events:

CLI Reference

Grant a permission

Revoke a permission

Check a permission

Evaluates the full resolution chain (superadmin, direct, wildcard, pattern, tool group):

List relations

Sync from agent configs

Regenerates source=config relations from current agent settings. Manual relations are preserved.

Apply a template

Clear relations

Practical Examples

Full Admin Agent

An agent with unrestricted access to everything:

Restricted Developer Agent

An agent that can read files, run git, and manage its own sessions:

Read-Only Observer Agent

An agent that can only read files, search, and view data:

Sales Agent with Limited Scope

An agent that manages tagged contacts with limited operational scope:

Troubleshooting

”Permission denied” errors

  1. Check what permission is required — the error message tells you:
  2. Verify current permissions:
  3. Check with the engine:
  4. Grant the missing permission:

Common Mistakes

Wrong object type for CLI groups:
Using admin for specific groups:
Confusing group and executable:
Wrong relation for executables:

Redundant grants

The CLI warns about redundant grants:

Permissions not applying after config change

Config-synced permissions are regenerated on daemon boot. If you changed an agent’s contactScope or allowedSessions: