rv stops the one command you'd regret. Everything else just works.
A local guard for Claude Code, Codex, Cursor and 7 more coding agents.
Install · What it does · How it works · Guides · Docs · Discord
Coding agents are fast, and most of what they run is fine. But one
git reset --hard with work you haven't committed, one rm -rf ~, or one
cat .env pasted into a transcript is enough to ruin a day.
rv sits in your agent's tool hook and checks every shell command and file read before it runs. The safe ones run as normal. The one you'd regret is stopped, with the reason and the rule that caught it. Only you can let it through, with Touch ID or your password. The agent can't approve itself.
Every decision happens on your machine. No account, and your commands never leave it.
curl -fsSL https://rykanv.com/install | sh rv setup --dry-run # optional: see which hooks setup would write rv setup # finds the agents on this machine and wires their hooks rv doctor # checks that the service, packs and hooks are live
Then watch it work. rv try makes a throwaway repo, has a fake agent
run git reset --hard on it, and shows rv stopping it. rv test checks
any command without running it:
rv test 'git reset --hard' # BLOCKED core.git:reset-hard rv test 'git status' # ALLOWED
That's it. Next time your agent reaches for a destructive command, rv stops it and tells the agent why.
Not sure yet? Watch first. Install in observe mode and rv stops nothing. It logs what it would have stopped, so you can trust it before it acts:
curl -fsSL https://rykanv.com/install | RV_INSTALL_MODE=observe sh rv blocks # what rv would have stoppedOn an existing install,
rv setup --observedoes the same.
Requirements: macOS 15+ on Apple Silicon, or Linux (x86_64 or aarch64, glibc 2.35+). The installer checks the rest and tells you what's missing. The install guide covers containers, WSL, pinning a version and uninstalling.
Claude Code · Codex · Cursor · Grok · OpenCode · Pi · Hermes · OpenClaw · Antigravity · Muse
rv setup only wires the agents already on your machine. One policy
covers all of them. rv guard <agent> stops commands for one agent,
rv watch <agent> only logs them, and rv host list shows each one's mode.
95 rule packs cover git, the filesystem, disks, cloud CLIs, Kubernetes, Terraform, databases, CI, payments and more. Three are on from day one:
| On by default | Stops things like |
|---|---|
core.git |
git reset --hard, git push --force, git clean -fd, git checkout -- ., git stash clear |
core.filesystem |
rm -rf /, rm -rf ~, find / -delete |
system.disk |
dd onto a disk, mkfs, wipefs, diskutil eraseDisk |
Secret files such as .env, SSH keys and cloud credentials are guarded
too, in shell commands and, for Claude Code, Cursor and Grok, in the
agent's own file tools.
See what's on with rv packs (rv packs --all browses all 95) and
protect another tool with rv protect <tool>. Packs read what a command does, not just its
first word, so npm test can't hide a payload: rv checks the scripts in
package.json that it would actually run.
When something is stopped, rv why '<command>' shows the rule, what
it would have destroyed, and a safer way to do it. rv log lists every
decision, newest first.
rv secrets set STRIPE_SECRET_KEY # hidden prompt, kept in your Keychain or keyring rv run --secret STRIPE_SECRET_KEY -- npm run deploy # the command sees a stand-in, never the key
The agent and the command only ever hold a stand-in. rv swaps in the real
key on its way to the API it belongs to, and scrubs it from everything that
comes back. Values can come from Keychain, 1Password, Vault, AWS, GCP,
Azure, Infisical or Bitwarden, and rv secrets scan catches keys before
they land in a commit.
→ Secrets guide
rv mcp serve puts your MCP servers behind one gateway. You decide which
tools run, which ask you first, and which never run. Tool definitions stay
exactly as you reviewed them (rv mcp trust), servers can run sandboxed,
and rv mcp check fails if anything goes around rv.
→ MCP gateway guide
rv box runs an agent on a private copy of your project. It can write
only inside that copy, reach only the hosts you allow, and never sees
your Keychain. rv box done shows what changed, in numbers, and lets you
keep, pick or drop it (dropped work waits 7 days in a trash).
→ What the box does and doesn't cover
Every stop, override and change to rv's own rules lands in a hash-chained
audit log. rv audit verify proves nothing was edited out, and
rv audit export --format ocsf hands it to your SIEM.
→ Audit log guide
Every stop shows a six-character code. Run it from your own terminal:
rv unlock a1b2c3 # lets that one command run once, in that directoryIt asks for Touch ID or your password, so an agent can't use it. The
same check guards every command that loosens rv. For a permanent
exception, use rv allowlist add.
If an agent is blocked and you don't know why, rv doctor tells you
what's wrong and how to fix it. The
troubleshooting guide lists every
message rv can show.
agent ──▶ hook ──▶ rvd ──▶ rule packs ──▶ your policy ──▶ runs / stopped
local 95 packs, allowlist,
daemon safe first unlock codes
Every shell and file-tool call from every agent goes to one local daemon,
rvd, and through one pipeline. A few rules hold everywhere:
- Fail closed. If rv can't decide (the daemon is down, slow, or not the one it should be), the call is stopped, not quietly allowed.
- A stop is a floor. Nothing later in the pipeline can turn a pack's stop into a yes. Only you can, with your own Touch ID or password.
- Nothing leaves your machine. Commands are decided locally. The audit log records the rule and the agent, never your command text.
- rv protects itself. Agents can't turn rv off, edit its rules, or redeem their own codes, in observe mode too.
On macOS, an optional on-device model can add a second opinion. It can only make a verdict stricter, never looser.
For the module map, see the architecture map
and docs/architecture.
| rv | Your agent's permission prompts | A container or VM | |
|---|---|---|---|
Stops git reset --hard before it runs |
✅ | if you read every prompt | ❌ the damage happens inside |
| One policy for 10 agents | ✅ | ❌ set up per agent | — |
| Reads what a command does, not its prefix | ✅ 95 packs | ❌ prefix rules | — |
| Agent never holds your real API keys | ✅ | ❌ | only if you don't mount them |
| Per-tool rules for MCP servers | ✅ | partly | ❌ |
| Agent can't approve its own override | ✅ Touch ID / password | ❌ in auto-approve modes | — |
| Keeps your normal dev loop | ✅ | ✅ | ❌ |
| Tamper-evident log of every stop | ✅ | ❌ | ❌ |
rv works alongside a sandbox, not instead of one. Use both if you like:
rv box is rv's own.
rv try # watch rv stop a fake agent in a throwaway repo rv test '<cmd>' # would rv stop this? (doesn't run it) rv why '<cmd>' # which rule, why, and a safer way rv log # every decision, newest first rv unlock <code> # run a stopped command once (Touch ID or password) rv packs # what's on; rv packs --all browses the 95 packs rv guard <agent> # stop commands for that agent (rv watch only logs) rv host list # each agent's mode rv scan # replay past agent sessions: what would rv have stopped? rv doctor # is everything wired and healthy? rv uninstall # remove rv's hooks, service and binaries
rv --help lists everything. Every command speaks --json for scripts
and agents. The old names (rv explain, rv allow-once, rv host mode)
still work.
Platform support
| macOS 15+ (Apple Silicon) | Linux (x86_64, aarch64) | |
|---|---|---|
Stops, packs, rv test, audit log |
✅ | ✅ |
rv run --secret (stand-ins for one command) |
✅ | ✅ (Linux 5.9+) |
| MCP gateway | ✅ | ✅ |
| MCP server sandbox | ✅ Seatbelt | ✅ Landlock + seccomp (Linux 6.7+) |
rv box |
✅ | — |
| On-device model | ✅ | — (packs only) |
Details and edge cases: install guide · known limits.
Privacy
rv decides everything on your machine and never sends your commands,
paths or secrets anywhere. It does send anonymous usage counts: one event
at install, then at most one a day with the rv and OS version, how many
calls were allowed and stopped, which packs are on, and which agents are
wired. Turn them off with "analytics": {"enabled": false} in
~/.config/rv/config.json.
What's coming next, in the open:
- Agents ask, you decide. A menu bar app and a fuller
rv term(the live terminal dashboard) where you answer an agent's ask from the keyboard. - Later: a week of watching turns into one confident "start guarding", and recap views of what rv stopped for you.
| Word | What it means |
|---|---|
| ✕ stopped | rv stopped the command. It did not run. |
| ◐ would stop | Watching: rv logged it and let it run. |
| ✓ ran | It ran. rv had no objection. |
| ⏺ asks | It waits for a person to say yes. |
| → next | The one command to type next. |
| ◆ rv | rv speaking. |
| guarding | An agent's mode that stops commands (rv guard). |
| watching | An agent's mode that only logs them (rv watch). |
| rule | One pattern rv checks a command against. |
| pack | A named set of rules, such as core.git. |
| code | Six characters on a stop; a person runs it once with rv unlock. |
| incomplete | rv could not finish checking, so it stops the command. |
rv why --help prints the same list.
rv is free and open source for everything on your machine, and stays that
way: we will never charge for a stop. rv Console is a separate,
commercial fleet view for teams (shared rules, SSO, history), fed by the
open rv audit forward and rv report --json. Signed organization
policy, which can only tighten rules, is in rv itself. Ask about early
access on Discord or at
rykanv.com.
rv is Swift 6.4 and builds on macOS and Linux:
git clone https://github.com/christopherkarani/rv && cd rv swift build --build-tests swift test
Start with CONTRIBUTING.md and the domain words in
CONTEXT.md. New rule packs are one of the best places to
help: each one is a JSON file in
Sources/RVPacks/Resources/packs.
There's a Python SDK in sdk/python.
Found a security issue? Please report it privately, as described in SECURITY.md.
Apache 2.0. See LICENSE.
If rv saved you from a bad command, a ⭐ helps other people find it.