Skip to content

Agents running unattended

With auto-approve, in the background or overnight, nobody is there to answer a prompt. A call the policy has no rule for then simply runs, and code inside an allowed command can do whatever it contains.

Put the whole agent and everything it starts in one sandbox, with network only through OpenMoat’s proxy:

Terminal window
openmoat run --write ~/.claude --write ~/.claude.json -- claude
openmoat run --isolate --write ~/.claude --write ~/.claude.json -- claude # Linux: refuse to start without bubblewrap

The two --write paths are Claude Code’s own state, which it must write to run. Whatever follows the agent’s name goes to the agent, so an auto-approve flag goes there. On Linux, where bubblewrap works, openmoat run starts the Isolated tier by default: the agent sees only the project, the policy’s read roots, its own executable, the --write paths and an empty temp directory. --isolate refuses to start where that tier cannot (Linux tiers and Landlock); require.run: full-boundary makes every openmoat run refuse.

openmoat run also takes a snapshot of the project’s files before the agent starts and after it exits, so openmoat restore can put them back after a bad session (Undo an agent’s changes). A call held for review can be approved from your phone while you are away (Approve reviews from your phone).

  • openmoat run needs macOS 13 or later, or Linux. On macOS 12 and earlier it refuses to start and says so. On Windows it refuses too: for OS confinement, run the agent and openmoat inside WSL2.
  • Turn the agent’s own sandbox off inside, because sandboxes do not nest. Credentials must not come from the keychain: use an API key or apiKeyHelper.

Afterwards, read what happened:

Terminal window
openmoat replay --since today # one tree per agent session: every call, verdict and rule
openmoat report --since 7d # totals, hosts, top rules, reviews per active hour
openmoat why --last # the newest deny or review, explained in full

What the agent is told when a call is denied:

Terminal window
OpenMoat blocked: reading or changing your keys and credential files
call cat ~/.ssh/id_rsa
rule moat: deny [secrets-paths] — secret material: read /Users/you/.ssh/id_rsa
why a key or token that leaves this machine cannot be taken back
next if you need this, do it yourself in your own terminal
more openmoat why --last · https://openmoat.dev/r/secrets-paths
Verdict With a prompt Nobody answering
allow runs runs
defer your agent asks you runs
review waits for you stopped
deny never runs never runs
  • Everything the policy denies stays denied: secrets read or sent, data sent to unlisted hosts, a download piped into a shell, destructive commands, changes to OpenMoat.
  • A review stops the call. Agents that cannot prompt receive it as a deny that says how to approve the call (openmoat allow --last).
  • Under openmoat run, the operating system confines what an allowed command does, the network goes only through the proxy, and npm and uv skip package versions published in the last 7 days.
  • Deferred calls run. npm install left-pad and git push origin main have no rule, so in auto-approve nothing asks.
  • Some modes answer or skip the check. OpenCode 2’s --auto approves OpenMoat’s reviews, and OpenMoat’s plugin cannot tell. The Cline CLI’s --yolo runs no hooks. Hermes Agent’s in-session /yolo approves a review unseen.
  • Antigravity CLI. --dangerously-skip-permissions approves its requests unseen, which OpenMoat cannot see. A real agy blocks the call when the hook is missing or exits with an error; what it does when the hook times out is not documented, so OpenMoat assumes the call runs then.
  • Some agents run a call when the hook fails or is not loaded. openmoat status reports what it can see.
  • Without a sandbox, the hook decides alone. On a hook-only agent an allowed call runs with your permissions.
  • Under openmoat run, the agent’s own login is readable to the commands it runs. An API-key login can go through the broker instead; an OAuth login cannot.
  • Under openmoat run, tool commands of some agents still receive the relay token. Under Codex, Cursor, GitHub Copilot CLI, Gemini CLI, the Cline CLI and the Antigravity CLI, a script or a test runner can send the run calls the agent never made.
  • On Linux without bubblewrap, openmoat run cannot create anything directly at the project’s top. From 0.21.0 it grants the project entry by entry there, so .env, .git and .moat at the top stay covered, while a .env in a subfolder stays open. Where bubblewrap works it starts the Isolated tier by default; --isolate refuses to start without it (Project files on Linux).
  • Commit, pull and install outside the run. Under openmoat run the project’s .git and the agents’ configuration folders are read-only, so git commit, or a git pull or install that changes those folders, fails inside it.
  • An allowed host can receive data. The proxy checks the host, not what is sent inside HTTPS.
  • Sending what a session collected is recorded, not stopped. It appears in the audit log and in openmoat report.

Auto-approve and CI · openmoat run · Limits