Repository navigation
0.5.7 - 2026-10-18
Alpha: the hook's decisions are not enforced by the operating system (ADR-013). Only commands inside the host sandboxes
moat initconfigures, or undermoat run, are confined by the OS. Elsewhere an allowed call runs with your permissions, so a classifier mistake is a security bug.
Release Notes
Push check for tokens and secrets, token egress, MCP server and tool pinning, a Claude Code hook that blocks when it fails, per-session proxy credentials, hooks inside moat run, human-only commands, and classifier fixes.
Security
git pushandgh pr createare checked for what they would publish: a commit that adds a known token format or a brokered secret's value is denied (push-secret), a change to a CI workflow or anotherruns-laterfile asks in a session that read untrusted content or a secret (push-runs-later), and a push that cannot be checked within 2 s or 8 MiB asks (push-unchecked); any other push is decided as before (#574).- With Claude Code 2.1.295 or later,
moat initsets"onFailure": "block"on OpenMoat'sPreToolUsehook, so a call is blocked whenmoatcannot start, crashes or times out instead of running unchecked. The key is written only when theclaudeonPATHreports that version;moat statusandmoat doctorreport a hook without it as out of date (runmoat init), andmoat doctorwarns when Claude Code is older or not found (#574). token-egressdenies a GitHub, OpenAI/Anthropic, AWS, Slack, Google, npm or GitLab token sent to a host that is not its service's, allowed hosts included: in a fetch or network tool's URL, an MCP URL argument, a web search, or the arguments of a command that connects to a host and of commands piped into it.placeholder-egressdenies a brokered secret's placeholder sent anywhere but that secret's host. Only prefixed token formats count, so commit SHAs, UUIDs and base64 data are not affected. Existing policies get both withmoat policy upgrade(#574).- Audit redaction also masks Anthropic keys (
sk-ant-…) and OpenAI project, service-account and admin keys whose body holds-or_(#574). - The policy lock pins each MCP server definition the agents read (
~/.claude.json, a project's.mcp.json, Cursor'smcp.json, Codex'sconfig.toml, and their project files). A server whose definition changed, or one added since (a cloned repository's.mcp.jsonincluded), has its tool calls denied withmcp-server-changeduntil a person runsmoat mcp accept, which shows the change and asks. Other servers and tools are not affected, andmoat doctorandmoat statusreport it (#574). moat mcp accept,moat mcp wrapandmoat mcp unwrapare denied to agents (kernel-self), pseudo-terminal wrappers included. Existing policies get it withmoat policy upgrade(#574).moat run's proxy serves its own run only: the agent'sHTTP_PROXY/HTTPS_PROXYcarry a per-run credential (http://<session>:<token>@127.0.0.1:<port>), and a request without it, or with another run's, gets 407. Each proxy row is recorded under the run's session (#574).- Session taint reaches
moat run's proxy: once an agent session of the run has read secret material, a request to any host but that secret's own is refused (session-taint), registries included, so a script the hook never sees cannot send it on. The default policy denies secret reads, so default setups see no change (#574). - One session of
moat run's proxy, or the connections that have not authenticated yet, can hold at most half of its connections; the next gets 503 (#574). - A deny can no longer be turned into a defer by padding the rest of a command line until the classifier stops. A here-document with no delimiter line and a trailing backslash are read as bash runs them, a command substitution that cannot be classified keeps its command's own reads and writes, and a line not read in full or past a classifier limit (64 KB, nesting depth, 2048 actions) asks instead of taking the catch-all (#569).
moat runremoves the environment variables brokered secrets are read from before it starts the agent; the agent and its commands held the real value instead of the placeholder (#569).runs-laterasks before the agent writes what its host starts in the next session, outside any sandbox: a project's.claude/hooks/,.mcp.json,.cursor/mcp.jsonand.codex/config.toml, and~/.claude.json,~/.claude/plugins/,~/.cursor/mcp.jsonand~/.cursor/cli-config.json. Existing policies get it withmoat policy upgrade(#569).- A tool OpenMoat does not govern is left to the host's own permission flow instead of being approved past it; it is still recorded. Cursor, whose hooks cannot leave a call undecided, keeps the allow (#569).
moat run --isolatetakes bubblewrap from/usr/bin,/binor/usr/local/binonly, never fromPATH, where a relative entry let a project ship its own (#571).- A project root whose path holds a glob character (
*,?, brackets, braces) names no files: spliced into${project}/**it widenedproject-fs, with a project at~/*to the whole home (#572). - Under
moat runon macOS, a pattern with**inside braces (~/{.ssh/**,.aws/**}) and a pattern under a symlinked directory (/tmp/x/**, which is/private/tmp/x) are enforced as the hook reads them; both were narrower (#572). - A patch handed to
apply_patchin a shell command, which Codex applies like its own patch tool, is checked as writes to every file it names; a write to a denied file deferred (#572). - MCP arguments named in camel or kebab case (
sourcePath,output-dir,baseUrl) are read as paths and URLs, and a write verb anywhere in a tool's name (file_write,download_file) makes its paths writes (#572). - In Claude Code's
bypassPermissionsanddontAskmodes, where no question reaches a person, an OpenMoat ask is a deny that says how to approve it (moat allow --last), as for Codex; calls OpenMoat leaves to Claude Code are unchanged (#574). moat allow,moat doctor --accept,moat trust,moat secret add,moat edit,moat policy upgrade,moat uninstall,moat sandbox sync,moat mcp accept/wrap/unwrapandmoat proxy install/uninstallrefuse when Claude Code, Codex, the Cursor CLI ormoat runstarted them, even through a terminal wrapper, and read their answer from the controlling terminal. Windows checks the terminal only (#574).moat proxyrefuses a TLS tunnel whose ClientHello carries an encrypted server name (ECH or ESNI), with which an allowed host's provider could serve another site;sandbox.proxy_allow_ech: trueallows it (#574).- The Claude Code hook also receives
ReadMcpResourceTool(afile:resource is checked as a read of that file, another as the MCP server's read),EnterWorktree(entering an existing worktree is checked as a read of its directory) andSkill(recorded, left to Claude Code). Existing installs show the hook as out of date untilmoat initis run (#574). - Session taint protects every file
runs-laterasks about (azure-pipelines.yml,Jenkinsfile,.buildkite/,.pre-commit-config.yaml,lefthook.yml,~/.claude.json) and OpenMoat's own.moat/, and a test keeps the lists in step (#574). - A shell command that gives
HOME,PWDorprojecta value it does not show (project=$(cat f),read HOME) no longer has paths under them read as the real home, working directory or project:project=$(cat f); cat ${project}/id_rsawas allowed as a project file, and now asks like any unknown directory (#574). ${project}in a shell command is the shell's variableproject, empty when unset, not the project root:cat ${project}/Users/me/.ssh/id_rsareads the key and was allowed as a project file (#574).- A relative path from the root directory (
cd / && cat Users/me/.ssh/id_rsa) is checked as/Users/…; it was read as the network path//Users/…, which no rule names (#574). xargsinput that the command line shows, a here-string, a here-document or text piped fromecho, is checked as the arguments of the command xargs runs, with-I,-nand-0read as xargs reads them (#575).- Files that
curlandwgetsend are checked as reads:curl -F name=@FILE,-F name=<FILE,--form,-T/--upload-file,-d @FILEand the other data options,--data-urlencode name@FILEand-K FILE, andwget --post-file,--body-fileand-i(#575). - Files rewritten in place are checked as writes: the file operands of
perl -iandruby -i(and their backups), the filepatchpatches and its-oand-rfiles (its-ipatch file is a read), anddd of=~/…, whose~bash expands (#575). env -S 'cmd args'(--split-string) is checked as the command line env runs (#575).- An unquoted glob that starts with
.(.*) also names.and.., as macOS/bin/bashand other bash before 5.2 expand it, so the directory and its parent are checked;rmandrmdir, which refuse those two operands, are unchanged (#575). - Shell rule patterns match in time bounded by the pattern length times the command length; a pattern with many
*against a long command took exponential time (#575). - The program git runs for the other side of a remote,
--upload-packand-uforclone,fetch,pullandls-remote,push --receive-pack/--execandarchive --exec, is checked as a command line. A local repository thatclone,fetch,pull,ls-remoteorarchive --remotenames is a read, and the directoryclonecreates and a local repositorypushupdates are writes (#575). - Hooks inside
moat runsend each tool call to themoat runprocess over the proxy's port with a token made for the run, and that process decides and records it; the sandbox stays closed to~/.moat, a wrong token is recorded and gets no decision, and any failure denies (#575).
Added
moat mcp proxy, opt-in per server withmoat mcp wrapormoat init --mcp-proxy: it runs a stdio MCP server through OpenMoat, pins each tool's description and input schema on first sight, hides a tool that changed or is new untilmoat mcp accept, and records every tool call in the audit log. With--sandboxthe server runs undermoat run.moat uninstallandmoat mcp unwraprestore the original command (#574).
Changed
- Changing one of Claude Code's own settings, such as
permissions.blockReadsOutsideWorkingDirectories, a permission list or mode, or a display toggle, no longer makesmoat guarddeny every call untilmoat doctor --accept. Calls are decided by the policy as usual, the change is recorded once per session, andmoat doctorandmoat statusreport it until you accept it. Any change to hooks, to keys that run a program or redirect the agent (env,apiKeyHelper, the model, plugins, MCP servers,sandbox), removing a deny rule OpenMoat wrote, an unknown key or a file that no longer parses still denies every call. Under a lock pinned by an earlier release a change topermissionsstill denies until the next re-pin (#575). moat proxysays at start-up that it asks for no session credential, so any local process may use it and session taint does not apply; the host sandboxes cannot send one (#574).moat statussays when a policy update waits formoat policy upgrade, and its JSON addspolicy_updateandlock_drift(#573).- On a session-taint ask,
moat allow --lastofferss: it approves every protected write of that session until it reads untrusted content again (other sessions still ask; a secret's asks never) (#573). moat initshows a diff of every file it would change for an agent before asking about it, hooks and sandbox settings together (#573).--helpand themoat runbanner use plain words: no ADR numbers or tier names, and the banner is two lines (--verbosefor the rest) (#573).- A tool call over the 1 MiB payload limit is refused with a message naming the limit, instead of failing as malformed input (#573).
moat guardstays fast in long agent sessions: the session's taint is folded from the calls since the last one, cached in the audit database, instead of from the whole session. Late in a 5,000-call session a call took 158 ms on Linux and 370 ms on macOS; it now takes about 10 and 18 ms (#571).
Fixed
moat guardno longer denies slow calls on a heavily loaded machine asno decision within 10 s: the time limit is 30 s (still a deny when it runs out), the session-cache write skips instead of waiting for the audit database's lock and shares the record's connection, andmoat doctornames the step most such calls were stuck in (#574).- Under
moat run, every governed tool call was denied as akernel-errorand nothing was recorded, because the hook could not read the policy lock or write the audit log from inside the sandbox; hooks now get the real decision, and session taint reaches the run's proxy (#575).
Install openmoat 0.5.7
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/crocodile-labs/openmoat/releases/download/v0.5.7/openmoat-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/crocodile-labs/openmoat/releases/download/v0.5.7/openmoat-installer.ps1 | iex"Install prebuilt binaries via Homebrew
brew install crocodile-labs/tap/moatDownload openmoat 0.5.7
| File | Platform | Checksum |
|---|---|---|
| openmoat-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| openmoat-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| openmoat-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| openmoat-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| openmoat-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| openmoat-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| openmoat-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Verifying GitHub Artifact Attestations
The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the GitHub CLI:
gh attestation verify <file-path of downloaded artifact> --repo crocodile-labs/openmoatYou can also download the attestation from GitHub and verify against that directly:
gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>