Overview
Ravi uses a Relation-Based Access Control (REBAC) model. Every permission is a relation:(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 evaluatescan(agent:dev, execute, group:daemon), it checks in this order:
- Superadmin — Does
(agent:dev, admin, system:*)exist? If yes, allowed. - Direct relation — Does
(agent:dev, execute, group:daemon)exist? If yes, allowed. - Wildcard — Does
(agent:dev, execute, group:*)exist? If yes, allowed. - Pattern match — Does any relation like
(agent:dev, execute, group:dae*)match? If yes, allowed. - Tool group — If checking a
tool, does the agent have atoolgroupthat includes it? If yes, allowed. - Denied — No match found.
Wildcards
Wildcards only work as a trailing suffix on the object ID:CLI Command Groups
Groups withscope: 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 inlinemedia,react,tools,transcribe,video,whatsapp.dm(open)cron,triggers(resource) — check resource ownership
SDK Tools
Control which SDK tools an agent can use with theuse relation:
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
Thesafe-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 usesource=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 topicravi.audit.denied:
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
Regeneratessource=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
-
Check what permission is required — the error message tells you:
-
Verify current permissions:
-
Check with the engine:
-
Grant the missing permission:
Common Mistakes
Wrong object type for CLI groups:admin for specific groups:
group and executable:
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’scontactScope or allowedSessions: