A developer with an agent on a laptop
The problem
Section titled “The problem”Your agent runs shell commands, edits files, fetches web pages and calls MCP tools with your permissions. After the hundredth prompt you click yes, and a README, an issue or a web page can carry an instruction the agent may follow.
The commands
Section titled “The commands”brew install crocodile-labs/tap/openmoat # macOS and Linuxopenmoat init # asks before it sets up each agent it findsopenmoat policy check "cat ~/.ssh/id_rsa" # a verdict, without running anythingThen start your agent in a new session and work as usual. On Windows, and for other ways to install, see the Quick start.
Example output of the last command:
✕ deny rules : secrets-paths reason: secret material: read /Users/you/.ssh/id_rsa also : shell "cat ~/.ssh/id_rsa"While you work, in your own terminal:
openmoat status # each agent's protection and what to fixopenmoat watch # follow the agents' calls liveopenmoat why --last # explain the newest deny or reviewopenmoat allow --last # allow the call an agent was just stopped onopenmoat uninstall puts back every file openmoat init changed.
What it stops
Section titled “What it stops”- Secrets read or sent. SSH keys,
.env, cloud credentials, every agent’s login files and secret variables are denied, however the path is spelt. - Data leaving the machine. Sending to a host the policy does not list is denied.
- Downloaded or hidden code. Piping a download or a decoded payload into a shell is denied.
- Destructive commands.
git push --force,git reset --hardandrm -rf ~are denied. - Code that runs later. CI workflows, git hooks and login items wait for you. Shell startup files are denied.
- Look-alike packages. A name one typo away from a popular package waits for you.
- OpenMoat switched off. The agent cannot edit the policy, approve its own block or uninstall OpenMoat.
Normal work such as git status --short, cargo test and npm test is allowed without a prompt. What the policy has no rule for goes to your agent’s own prompt, as it would without OpenMoat.
What it does not stop
Section titled “What it does not stop”- A deferred call runs if your agent lets it. In auto-approve modes only
denyandreviewstop a call. - Outside an OS sandbox, the hook decides alone. On a hook-only agent an allowed call runs with your permissions, so a classifier mistake is a bypass.
openmoat statusshows each agent’s level, andopenmoat runadds a sandbox (macOS 13 or later, Linux). - Allowed code is not inspected. An allowed
npm testruns whatever it contains, and an allowed host can receive data from an allowed command. - Some agents run a call when the hook fails or is not loaded, and agent settings can turn hooks off.
openmoat statusandopenmoat doctorreport what they can see. - Tools no hook exposes are not seen, and a repository’s git configuration can run a program before any hook.
- A program that runs as you outside any sandbox can change the policy and recompute the lock.