Skip to content

Required protection level

openmoat status shows how much of the policy is enforced for each agent: hook + OS sandbox, hook only, not protected or not set up. A require: section says how much is enough. Without the section, which is the default, nothing is required.

require:
protection: hook-and-os-sandbox # every agent
agents:
gemini-cli: hook-only # this agent: OpenMoat writes no OS sandbox for it
Level Met when
hook-only OpenMoat’s hook decides the agent’s calls
hook-and-os-sandbox the hook decides, and an OS sandbox from OpenMoat holds the commands the agent runs: the agent’s own sandbox as OpenMoat set it up (Claude Code, Codex and Cursor; not on native Windows), or openmoat run

An entry in agents (a host id, as openmoat status --format json names it) takes the place of protection for that agent. An id OpenMoat does not know is an error, so a typo cannot drop an agent’s level.

Terminal window
openmoat edit # add `require:` to your policy
openmoat status # each agent's level and whether it meets it
openmoat sandbox sync # put OpenMoat's sandbox settings back for Claude Code, Codex, Cursor
openmoat run -- gemini # start an agent OpenMoat writes no sandbox for in an OS sandbox

Every call is denied with protection-required, tools OpenMoat does not govern included. The message names what is missing and the step that fixes it:

Terminal window
moat: deny [protection-required] — your policy requires hook + OS sandbox for Gemini CLI;
this call has hook only: OpenMoat writes no OS sandbox for Gemini CLI; to meet it, start
Gemini CLI with `openmoat run`

The step depends on what is missing:

What is missing The step
OpenMoat’s sandbox settings for the agent are missing or differ from the policy openmoat sandbox sync
OpenMoat writes no sandbox for the agent openmoat run
No OS sandbox exists on this system openmoat edit, to lower that agent’s line

openmoat run refuses to start a program it cannot bring to the level: any program when it has no sandbox on this system and hook-and-os-sandbox is required, a program that is no agent OpenMoat knows (no hook of OpenMoat’s would check its calls, and only protection applies to it), and an agent whose hook does not run. Calls inside the run meet hook-and-os-sandbox.

openmoat status and openmoat doctor add a row under the agent: required: hook + OS sandbox (your policy), met, or …, not met, so every call is denied: <what is missing>; to meet it, <step>. An unmet level is a problem (exit 64), and the home screen says below the required …. With --format json each agent has a required object (level, by, met, missing, fix). They show the level in force in the current directory, the repository policy’s included.

Your policy, the project’s repository policy and the installed policy packs can each have a require: section. An agent must be at the highest level any of them asks for, and the message names who asks: your policy, the repository policy or the policy pack <name>.

A repository or a pack can raise the level and never lower it: its hook-only, for every agent or for one, leaves your hook-and-os-sandbox in force, trusted or not. Like its deny rules, a repository’s level needs no openmoat trust.

Taking the section out of the policy is a change to a pinned file: every call is denied (kernel-integrity) until you re-pin.

New in 0.20.0. Where it cannot get all of its boundary, openmoat run normally starts anyway and warns. With require.run: full-boundary it refuses instead (ADR-077):

require:
run: full-boundary
On this system Without the setting With it
No OS sandbox: macOS before 13, a missing backend, Windows refused refused, naming the policy that asks
Linux where the Isolated tier cannot start (bubblewrap missing or blocked) starts the Lightweight tier, network restricted by port only, warns and records it refused; install bubblewrap
Linux, openmoat run --no-isolate starts the Lightweight tier, records it refused

On Linux the full boundary is the Isolated tier, which openmoat run starts by default where bubblewrap works. No --netns value and no --no-isolate lowers it. Your policy, a repository policy and a pack can each turn it on; none can turn it off. openmoat status and openmoat doctor say whether it holds here, and an unmet requirement is a problem (exit 64). It is about openmoat run, so an agent started without it is not refused: use require.protection above for that.

Environment. Under the setting only an allowlist of inherited variables reaches what openmoat run starts, so a cloud credential in your shell does not reach the agent: the built-in basics (PATH, HOME, TERM, locale, temp directories), the agent’s own API key names and configuration folder variable, the names you add, and what openmoat run sets itself.

sandbox:
env_allow: [JAVA_HOME, CARGO_HOME]
Terminal window
openmoat run --env NPM_TOKEN -- claude # one more name, for this run only
openmoat run --verbose -- claude # names what it withheld, never a value
openmoat doctor # lists the names it would withhold here

Names only: NAME=value and patterns such as AWS_* are errors. env_allow is read from your own policy; a repository policy or pack can turn the requirement on but cannot add a name. A brokered secret never reaches the agent even if you name it. If you run an agent through Amazon Bedrock or Google Cloud, add those credential names yourself. Without the setting everything is inherited, and one line says how many variables look like credentials.

MCP servers. openmoat status and openmoat doctor show every MCP server OpenMoat can read as protected or unprotected, with why. Under the setting a local server left unprotected (not run through openmoat mcp proxy, or a definition you have not accepted) fails the requirement. This is a report: the agent starts its servers itself, so openmoat run cannot refuse one.

Which agents run a call when their hook fails, and so most need this: Protection by agent and OS.

  • A hook that does not run cannot deny. A hook the agent’s settings turn off, a plugin the agent did not load, or an agent that runs a call when the hook fails sends no call to deny. openmoat status and openmoat doctor show such an agent as below the level, and openmoat run refuses it; nothing stops the agent started on its own.
  • hook-and-os-sandbox means what openmoat status means. Claude Code’s sandbox holds its shell commands, not its file tools, WebFetch or MCP servers, and Cursor runs some commands outside its sandbox. The level says OpenMoat’s sandbox settings are in force, not that every call is confined.
  • The answer is as strong as the state directory. The lock and the kept sandbox answer live in ~/.moat, which kernel-self keeps from the agent’s tool calls and every OS sandbox keeps from its commands. A program that runs as you outside any sandbox can rewrite them, as it can rewrite the policy.
  • The SDK and the WebAssembly module read require: and keep it, but they decide and do not enforce, so they do not apply it.

More in Limits. The rules in full: POLICY.md §9.2, §9.3, ADR-064 and ADR-077.