Repository navigation
0.2.0 - 2026-10-10
Alpha: the hook's decisions are not enforced by the operating system (ADR-013). Only commands inside the host sandboxes
moat initconfigures, or undermoat run, are confined by the OS. Elsewhere an allowed call runs with your permissions, so a classifier mistake is a security bug.
Release Notes
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
- 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 (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.
Added
- 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.
Install openmoat 0.2.0
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/crocodile-labs/openmoat/releases/download/v0.2.0/openmoat-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/crocodile-labs/openmoat/releases/download/v0.2.0/openmoat-installer.ps1 | iex"Install prebuilt binaries via Homebrew
brew install crocodile-labs/tap/moatDownload openmoat 0.2.0
| File | Platform | Checksum |
|---|---|---|
| openmoat-aarch64-apple-darwin.tar.xz | Apple Silicon macOS | checksum |
| openmoat-x86_64-apple-darwin.tar.xz | Intel macOS | checksum |
| openmoat-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| openmoat-aarch64-unknown-linux-gnu.tar.xz | ARM64 Linux | checksum |
| openmoat-x86_64-unknown-linux-gnu.tar.xz | x64 Linux | checksum |
| openmoat-aarch64-unknown-linux-musl.tar.xz | ARM64 MUSL Linux | checksum |
| openmoat-x86_64-unknown-linux-musl.tar.xz | x64 MUSL Linux | checksum |
Verifying GitHub Artifact Attestations
The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the GitHub CLI:
gh attestation verify <file-path of downloaded artifact> --repo crocodile-labs/openmoatYou can also download the attestation from GitHub and verify against that directly:
gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>