Skip to content

Quick start

  1. Install moat

    macOS and Linux.

    Terminal window
    brew install crocodile-labs/tap/moat
  2. Set it up for your agents

    Terminal window
    moat init

    moat init writes the default policy to ~/.moat, then lists the agents it finds and asks once for each:

    Found these agents:
    Claude Code /Users/you/.claude (changes settings.json)
    Codex /Users/you/.codex (changes hooks.json, config.toml)
    Protect Claude Code (/Users/you/.claude)? [Y/n]
    Protect Codex (/Users/you/.codex)? [Y/n]

    It backs up every file before it changes it. moat uninstall puts them all back.

  3. Start your agent in a new session

    Hooks are read when a session starts, so open a new one. Then work as usual: most calls run exactly as before.

  4. Check that it works

    Terminal window
    moat status # each agent: hook + OS sandbox, hook only, or not protected
    moat policy check "cat ~/.ssh/id_rsa" # the verdict for a command, without running it
    ⛔ deny
    rules : secrets-paths
    reason: secret material: read /Users/you/.ssh/id_rsa
    also : shell "cat ~/.ssh/id_rsa"