Skip to content

OpenMoat 0.11.0

Released 2026-10-28. GitHub release v0.11.0.

Feature Page
Running a file the same session wrote asks where no OS sandbox from OpenMoat holds the command Code the agent wrote
Inline code that builds the names it opens, connects to or runs asks Inline code with built names
Every supported agent’s login, provider keys and OAuth tokens are denied to the agent’s tools Agent logins and keys
Reading or copying a folder that holds denied files asks Folders that hold denied files
OpenClaw, pi and OpenCode report that they loaded OpenMoat’s plugin Did the agent load the plugin?
OpenClaw runs the parameters OpenMoat checked OpenClaw
OpenCode 1 and 2 through one plugin; Hermes Agent OpenCode, Supported agents
  • New default rule agent-credentials (hook only): the agent’s own tools may neither read nor write the files where Claude Code, Codex, GitHub Copilot CLI, pi, Gemini CLI, OpenCode, Hermes Agent, OpenClaw and the Continue CLI keep their login, provider keys and OAuth tokens (OpenCode’s ~/.local/share/opencode/auth.json, Hermes Agent’s auth.json and mcp-tokens/, Codex’s auth.json, …), in a moved agent directory too; pi auth print-api-key, pi auth print-bearer-token, opencode auth export and secret-tool lookup are denied, and claude setup-token asks (agent-token). Under openmoat run each agent still reads its own login (#666).
  • An agent running its own CLI to save an MCP server, turn one on or start an MCP OAuth sign-in (claude mcp add, codex mcp add, gemini mcp add, opencode mcp add/auth, hermes mcp add, …) asks (runs-later), as does a write of the Continue CLI’s ~/.continue/config.yaml; mcp list and mcp get are unchanged (#666).
  • openmoat status and openmoat doctor warn, in one line, when an agent on the search path is a version with a published security advisory that a later version fixes, such as the OpenCode MCP OAuth command execution on Windows and WSL (1.0.137 to 1.18.32) and pi’s auth.json write race (before 0.78.1) (#666).
  • OpenCode’s OPENCODE_CONFIG_DIR and the Hermes Agent profiles openmoat init finds get the protection of the agent’s own configuration directory; Hermes Agent’s memory and skill_manage tools are checked as writes of its memories/ and skills/, so the session-taint and runs-later asks apply; openmoat status and openmoat doctor also warn about a project’s opencode.jsonc, .opencode/opencode.jsonc and .opencode/plugin/ (#666).
  • moat guard builds a path pattern’s matcher only for a path that can begin as the pattern’s literal start does, so a call that names a file no longer builds every file pattern of the policy; the verdicts are unchanged (#666).
  • Reading or copying a folder that holds files a deny rule names now asks (protected-contents, ADR-038). Before, cp -r ~/.codex /tmp/c, grep -r token ~/.gemini, tar czf a.tgz ~/.hermes, rsync -a ~/.local/share/opencode x, zip -r a.zip ~/.copilot or cp -r ~/.docker x deferred: the classifier sees one read of the folder, and agent-credentials and secrets-paths name files inside it. Every deny rule’s paths now protect the folders they lie in, in every spelling (moved agent directories, other case on macOS and Windows), for reads and for writes into the folder. ls ~/.codex and ls ~/Library ask too (the home folder and the folders above it are left to home-sweep and destructive, so ls / is unchanged); folders inside a project are unchanged, so grep -r TODO . stays allowed. Hosts that cannot ask deny it with the openmoat allow --last hint (#670).
  • An extraction is a write of the folder it extracts into: tar -x … -C DIR (--directory, also gtar and bsdtar) and unzip … -d DIR, or the working directory without one. tar xf e.tar -C ~/.claude and unzip e.zip -d ~/.moat were deferred and are now denied by kernel-self; tar xf e.tar -C ~ is denied by destructive (#670).
  • git checkout [<tree-ish>] [--] <path>… writes each path, as git restore does: git checkout main -- .github/workflows/ci.yml and git checkout .claude/hooks/x.sh ask (runs-later) instead of deferring or being allowed, and git checkout -- ~/.claude/settings.json is denied; git checkout -- src/main.rs and git checkout main are unchanged (#670).
  • shell-rc also denies writes to fish’s startup files (~/.config/fish/config.fish, conf.d/, functions/), the login and logout files (~/.zlogin, ~/.zlogout, ~/.bash_login, ~/.bash_logout, ~/.login), csh, tcsh, ksh and mksh startup files (~/.cshrc, ~/.tcshrc, ~/.kshrc, ~/.mkshrc) and the drop-in folders ~/.bashrc.d/ and ~/.zshrc.d/, which run as often as ~/.zshrc and were deferred; the host sandboxes deny them too. Reading them is unchanged (#671).
  • Writing into a folder on PATH (~/.local/bin, ~/bin, ~/.cargo/bin, /usr/local/bin, /opt/homebrew/bin) now asks (persistence): a file there named after git, ls or node runs in its place later. install -m755 evil ~/.local/bin/git and ln -sf evil ~/.local/bin/git were deferred. Installers (pipx install, uv tool install, cargo install, brew install, npm i -g) are commands, not writes, and are unchanged (#671).
  • env-dump also denies inline Python that reaches the environment through __import__('os') (python3 -c 'print(__import__("os").environ)', __import__("os").__dict__), which was deferred. An alias (e = os.environ; print(e)) is still not followed (#671).
  • kill of the pids a command substitution naming moat looks up now asks like pkill openmoat (stops-openmoat): kill -9 $(pgrep openmoat), kill $(pidof moat) and kill `pgrep -f openmoat` were deferred. pgrep openmoat alone and kill $(pgrep node) are unchanged (#671).
  • Writing what every Python start runs now asks (runs-later), the allowed pytest included: a .pth file in a site-packages or dist-packages directory, and sitecustomize.py or usercustomize.py anywhere, a project’s .venv and src/ included. They were deferred outside the project and allowed inside it. Session taint protects them too; the host sandboxes leave them writable, since installs write them (#671).
  • Running a file the same agent session wrote now asks where no OS sandbox from OpenMoat holds the command (session-written-code, ADR-039): on OpenClaw, GitHub Copilot CLI, pi, Gemini CLI, OpenCode and Hermes Agent, and on Claude Code and Cursor on native Windows or with their sandbox not in place. Before, an agent could write x.py and run python3 x.py, node x.js or go run x.go (allowed) or bash x.sh, ruby x.rb or perl x.pl (deferred), and the script could read ~/.ssh/id_rsa through a path it builds. Every interpreter form (python3 -u x.py, python -m tool, node -r ./x.js, deno run, bun, php -f, pwsh -File, npx tsx, sh < x.sh, source x), a program named by a path (./x, bin/x), and inline code importing a module the session wrote (python3 -c 'import tool') count, through env, time, bash -c and the other wrappers; so do shell writes (echo … > x.sh; bash x.sh). Claude Code, Codex and Cursor with their sandbox in place on macOS and Linux, and openmoat run, are unchanged. A session grant (openmoat allow --last) answers it until the session rewrites the file; OpenCode 1 denies it with that hint. Files the session did not write (python manage.py) and test runners (pytest, npm test, cargo test) keep their verdict. The audit log moves to schema 5, which records each session’s writes, bounded to 30 days and 100 000 files (#672).
  • Inline interpreter code that opens files, connects, reads the environment or runs programs with text it builds at run time now asks (opaque-code), with -c/-e and in a here-document alike: python3 -c 'print(open(os.path.expanduser("~/.s"+"sh/id_rsa")).read())', node -e "require('fs').readFileSync(process.env.HOME+'/.ss'+'h/id_rsa')" and perl -e 'open F,"$ENV{HOME}/.s"."sh/id_rsa";print <F>' deferred before. python3 -c 'print(1+1)', node -e 'console.log(2)' and code that hands those APIs literal text keep their verdict (#672).
  • Inline interpreter code that writes a file now writes every file name it shows, not only reads it: python3 -c 'open("/Users/me/.zshrc","a").write("x")' and its Node, Ruby, Perl, PHP, Deno and Lua equivalents are denied by shell-rc (they were deferred as reads), writes of ~/.claude/settings.json by kernel-self, a workflow written that way asks (runs-later), and a script written by a one-liner counts as written by the session for session-written-code. Code that only reads keeps its verdict (#672).
  • OpenClaw now runs the parameters OpenMoat decided on (ADR-041). OpenClaw shows each before_tool_call handler the call as it came and runs the params of the last one that returns some, so another plugin could turn a checked git status into cat ~/.ssh/id_rsa and that ran. OpenMoat’s plugin now decides at the highest priority and returns the parameters it checked at the lowest, which undoes such a change; a plugin that changes a call and asks for approval in the same answer keeps its change once a person approves it, as THREAT_MODEL §5 says (#674).
  • A plugin its agent did not load no longer looks protected (ADR-042). OpenClaw, pi and OpenCode start without a plugin that fails to load and then run every call unchecked. OpenMoat’s plugins now run openmoat guard --heartbeat --host <id> as they load, and openmoat status and openmoat doctor say “plugin not loaded yet” (a note) until the plugin has reported or sent a call since openmoat init wrote it or the agent was updated; when pi wrote a session since without either, they warn and report pi as not protected. openmoat status --format json lists it under plugins. The default policy denies an agent running openmoat guard --heartbeat itself (kernel-self), so one agent cannot report another’s plugin as loaded (#674).
  • An entry of OpenMoat’s without the agent’s fail-closed key (fail_closed: true for Hermes Agent, failClosed: true for Cursor) is reported as not protected, with the reason, instead of “out of date”: the agent would run a call whose hook failed. openmoat init puts the key back (#674).
  • Hermes Agent’s limits are documented from its source: its plugins.hook_callback_timeout (30 s by default) blocks a call whose hook has not answered, before the entry’s own 60 s and together with the guard’s own 30 s, so openmoat init leaves it alone; and Hermes runs a call unchecked when its own hook dispatcher raises an error (#674).
  • The OpenClaw, pi and OpenCode plugins are type-checked (// @ts-check, strict, scripts/ci/check-js.sh) and each runs under Node against a stand-in for its host and for the guard in the tests: every failure of the guard blocks, a deny, ask, allow and no answer reach the agent as they must, and the OpenClaw rewrite is undone (#674).
  • Hermes Agent is a supported agent (openmoat init --hosts hermes, hook only): one pre_tool_call hook with fail_closed: true in its config.yaml, edited as text so your comments stay, and its command approved in shell-hooks-allowlist.json, without which Hermes’s gateway, cron and ACP sessions skip it; openmoat status and openmoat doctor report a hook the allowlist does not approve. An ask is Hermes’s own approval prompt, and a deny you approve with openmoat allow --last where Hermes would approve it unseen (YOLO mode, approvals.mode: off). The lock pins both files, the MCP servers in mcp_servers one by one, and kernel-self protects Hermes’s configuration, allowlist, .env, plugins and hooks and denies HERMES_SAFE_MODE (#665).
  • OpenCode 1 (opencode-ai) is a supported agent, host opencode, hook only: openmoat init writes OpenMoat’s plugin to ~/.config/opencode/plugins/openmoat.js (or $XDG_CONFIG_HOME/opencode), which checks every tool call through tool.execute.before and blocks the call when openmoat is missing, fails or takes over 45 s. OpenCode 1 cannot ask, so an ask is a deny that says how to approve the call. The default policy denies the agent changing the plugin and the files that load plugins, starting OpenCode with --pure or OPENCODE_PURE, opencode upgrade --major and opencode plugin --global, and asks before it writes other plugins, custom tools, commands or a project’s opencode.json. OpenCode 2 support follows in the next entry (#665).
  • OpenCode 2 (@opencode/cli) is supported, through the same opencode host and one plugin for both versions (ADR-040): OpenMoat’s plugin exports { id, server, setup }, so OpenCode 1 (1.3.4 and later) runs it on tool.execute.before and OpenCode 2 on execute.before, and an upgrade from 1 to 2 needs no new openmoat init; openmoat status and openmoat doctor name the hook the opencode on the search path runs. On OpenCode 2 an ask is OpenCode’s own permission prompt (OpenCode 1 still receives it as a deny with the openmoat allow --last hint), and the plugin replaces the call’s tool and input with what it checked, frozen, so another plugin that rewrites the call afterwards makes it fail; the shell command it checked is pinned the same way when OpenCode starts it. OpenCode 2’s tools (shell, read/write/edit with path, patch, opencode_worktree_remove, …), its ~ expansion and its mcp.servers are read. -openmoat (or -*) in OpenCode 2’s plugins, or a policy denying the plugin, makes openmoat status and openmoat doctor report OpenCode as not protected (the person’s own opencode.json[c]) or warn about the project; the default policy denies the agent setting OPENCODE_CONFIG_DIR, OPENCODE_CONFIG or OPENCODE_CONFIG_CONTENT, writing OpenCode 2’s service*.json, and running opencode plugin add|remove|update or opencode service set|unset. With OPENCODE_CONFIG_DIR set, openmoat init installs the plugin there, which both versions load. OpenCode before 1.3.4, which loads no object plugin, is no longer set up: openmoat status says to upgrade (#673).
  • Breaking Library crates (API, breaking): openmoat-hosts replaces InstallSpec::unsupported with InstallSpec::versions (the oldest version that loads OpenMoat’s plugin and the hook each major runs) and adds InstallSpec::heartbeat and HookFile::fail_closed_key; openmoat-audit adds the session-writes table (schema 5) and Store::host_seen_since; openmoat-core adds CompiledPolicy::executed (#672, #673, #674).
  • .env.dist and .env.<mode>.example templates are no longer blocked by secrets-paths (#668).
  • openmoat doctor --format json names GitHub Copilot CLI’s checks after the agent: a name as wide as the text output’s column ran into its detail, so tools reading the JSON (OpenMoat Bar) did not find the agent’s protection line (#683).