Skip to content

0.2.0 - 2026-10-10

Choose a tag to compare

@github-actions github-actions released this 10 Oct 06:43
02ec68c

Alpha: the hook's decisions are not enforced by the operating system (ADR-013). Only commands inside the host sandboxes moat init configures, or under moat 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.json or .codex/hooks.json (#434). Claude Code's sandbox on Linux drops every glob in denyWrite, and moat init used to add a working-directory Edit(./…) 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; .claude is left to Claude Code, which keeps its own settings read-only. New differential rows write-cursor-hooks and write-codex-hooks run 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 moat profile 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.json did not stop mkdir -p .claude && echo '{}' > .claude/settings.local.json; the differential suite showed it on the first Linux run. The policy already denies writing .claude and .cursor themselves, 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 .claude or .cursor on Linux, listed as codex.linux-agent-dirs. Codex keeps .codex read-only itself; such directories in a subdirectory are still listed under codex.linux-write-globs.
  • moat proxy now refuses three HTTP smuggling shapes its ambiguous-framing gate used to pass through (#396, #397). check_framing in openmoat-proxy::request already rejected a Content-Length next to a Transfer-Encoding and a repeated Content-Length; it now also rejects more than one Transfer-Encoding header on a request head (TE.TE smuggling), a Transfer-Encoding whose comma-separated, lowercased tokens are anything but exactly ["chunked"] (so identity, gzip, chunked, identity, gzip, chunked and chunked, gzip are refused), and a Content-Length whose single value is not one plain decimal u64 (so the list form 10, 10, the signed form +10, embedded whitespace 10 10 and hex 0x0a are refused). A value with only surrounding whitespace ( 10) still parses as a legitimate single length. The existing request/tests.rs::ambiguous_or_unsupported_http_is_refused gained one fixture per shape and a sibling test asserts the whitespace-only accept path.
  • Three P1 findings in openmoat-core closed in one change (#398, #399, #400). (a) The session-taint rule-matcher now recognises secrets-paths wherever a policy puts it, repository policies included: RepoPolicy::merge renames every repo rule to repo:<id>, so the previous equality check against "secrets-paths" missed repo:secrets-paths and let an approved secret read leave the session untainted; names_secret now matches the base id with or without the repo: prefix and iterates repo_ask alongside deny, allow and ask. (b) CompiledPolicy::compile now rejects an EvalContext::moved_dirs entry whose default is empty, whitespace, a bare /, not an absolute or ~/-rooted directory, or a duplicate; without that check an empty default aliased every pattern body in spellings() and silently widened every rule — the engine now fails closed, so the CLI is no longer the only line of defence. (c) paths::expand_home no longer guesses that other users' homes sit next to the current user's: ~<otheruser> is unresolvable from the pure core, so resolve returns None and a shell token with it asks through unparseable, while a direct fs.read of ~alice/.ssh/id_rsa falls back to the literal word (never to a wrong absolute path the OS does not read). A new T1-tilde-other-user-unresolvable conformance attack covers (c); existing fixtures using ~me (self) keep their deny verdict. docs/POLICY.md names secrets-paths as a taint-significant rule id and documents the ~<otheruser> rule.
  • Claude Code's sandbox.credentials generator no longer widens HTTPS-only brokered secrets through its block-scoped allowPlaintextInject flag (#401, ADR-019). When a policy mixed one plain_http: true secret with one plain_http: false secret, OpenMoat emitted both as mask entries and set allowPlaintextInject: true on 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 sets allowPlaintextInject: true only when every emitted mask entry sets plain_http: true; in a mixed block the plain_http: true entries are dropped from Claude Code's mask list with a loss row that names each one, and moat proxy still 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! and unreachable! 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 from serde_json::Value, which cannot fail, with the same bytes as before, and the audit redaction patterns are compiled into an Option. 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's moat profile, plus sandbox_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, so cp src/main.rs ~/stolen.txt and echo … >> ~/.zshrc complete there and are discarded; scenarios.yaml records those rows as contained: [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_exec now runs moat init with the pinned codex on PATH, as after a user installs it (#371); without that, Codex on Linux started no command.
  • On Windows, moat proxy status now refuses with exit 64 and the hint to run moat proxy in 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_attributes and allow_attributes_without_reason keep #[allow] out of the workspace (a needed exception is an #[expect] with a reason), dbg_macro, todo and unimplemented warn, and the four library crates warn on print_stdout/print_stderr. The one library print moved to the binary: openmoat-proxy::Recorder has a new provided method unrecorded, called when a record fails, and moat proxy implements it with the same moat 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::BrokeredSecret changed from an enum to a struct and no longer derives Copy. The policy compiler now carries brokered secrets in the enforcement IR (#167, ADR-019). openmoat-core::ir::BrokeredSecret is a populated struct (id, host, header, source, plain_http) and lower() fills Enforcement.secrets from the policy's secrets: list, so OS backends read one source of truth. Claude Code's sandbox.credentials generator (#363) now consumes ir.secrets directly; no behaviour change on the generated settings. The existing ir_consistency test, "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 identifier sandbox-exec only recognises from macOS 13 onwards; on macOS 12 and earlier sandbox-exec refuses to parse the profile and moat run exits without starting the agent (fail closed). GitHub Actions no longer offers a macos-13 runner, so CI covers macos-14 and macos-15-intel only, and macOS 13 is unsupported in practice. The hook, moat init and moat status keep 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's containerization toolchain, with virtiofs projecting the project and the deny-coverage mounts the Linux Isolated tier already builds, a vsock relay to moat proxy on 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's containerization, and picks containerization for 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 --isolate on macOS now ships a stub that refuses with exit 64 and either prints the install hint when container is 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 install runs moat proxy as 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.plist and is bootstrapped into gui/<uid>; on Linux a systemd user unit lands at ~/.config/systemd/user/moat-proxy.service and is enable --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 doctor and moat proxy status surface the state (not installed, stopped, running, drift-blocked, crashlooping). moat sandbox sync restarts the service after re-pinning the lock so the proxy picks up the new policy, and moat uninstall removes the service alongside the hooks. The plist/unit holds only MOAT_HOME (a path, never a secret) and the pinned moat binary; on Linux the file is owner-only (0o600), on macOS ~/Library/LaunchAgents is 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); run moat proxy in a terminal there to keep the proxy up by hand.
  • moat init and moat sandbox sync compile the policy's secrets: entries into Claude Code's native sandbox.credentials block (#363). Each env and file source becomes a mask entry with the policy's host in injectHosts, and network.tlsTerminate turns on because Claude Code's broker needs it; credentials.allowPlaintextInject turns on when any mask entry sets plain_http: true, listed as an allowance. Claude Code's own proxy then substitutes the sentinel inside HTTPS requests for sandboxed Bash, PowerShell and Monitor commands, so the broker works for Claude Code without the TLS termination moat proxy still lacks (#247). A secret whose host is not in the policy's net allow is skipped with a loss, and a keychain source Claude Code's broker cannot read is skipped the same way; both still work through moat proxy. On macOS a file source falls back to a read deny, so a tool that reads the file does not authenticate; moat sandbox show lists both. Removing a secret from the policy strips the stale credentials entry and tlsTerminate on the next sync, and moat uninstall removes them whole.
  • scripts/ci/quality-gate.sh checks the fuzz targets' formatting with rustfmt --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, so cargo fmt --all and 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 | sh

Install 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/moat

Download 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/openmoat

You 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>