Skip to content

Hooks, the lock and the binary

Every call is denied with kernel-integrity

Section titled “Every call is denied with kernel-integrity”
Terminal window
moat: deny [kernel-integrity] — /Users/you/.moat/policy.yaml was modified;
run `openmoat doctor` to inspect; `openmoat doctor --accept` or `openmoat init` to re-pin

A pinned file (the policy, a hook, an agent’s settings) changed without you accepting it. Run openmoat: it shows the change and asks whether to accept it. If you did not make the change, you caught what OpenMoat exists for: look at openmoat doctor before accepting.

A policy pack you installed is pinned the same way, and so are the keys you trusted: a change to a file in ~/.moat/policy.d/packs/ or to ~/.moat/allowed_signers blocks every call too. openmoat doctor names the file.

After an upgrade from 0.7 or earlier, openmoat doctor says a hook still uses the old name. It keeps working, because every install puts a moat beside openmoat that runs it, but the moat name will be removed in a later release. Run openmoat init once: it backs up each agent’s file, rewrites OpenMoat’s hooks to run openmoat and re-pins. See Upgrading from 0.7 or earlier.

openmoat doctor or openmoat status says hook runs …, which does not exist, hook runs …, a different OpenMoat binary than this one or lock expects …, running …: openmoat moved, or a second install (Homebrew beside cargo install) is on the machine. Keep one, run openmoat init with it, and restart the agents (Keep one OpenMoat installed).

An agent shows “hook only” or “not protected”

Section titled “An agent shows “hook only” or “not protected””
Terminal window
openmoat status
It says Run
not protected: hook missing openmoat init
the hook is out of date (after an upgrade) openmoat init
not protected with a settings file named, such as disableAllHooks or [features] hooks = false Remove that setting from the file it names
sandbox differs from the policy openmoat sandbox sync, then start a new agent session
hook only for OpenClaw, GitHub Copilot CLI, pi or Gemini CLI Expected: OpenMoat sets up no OS sandbox for them. Use openmoat run for one
hook only for Claude Code or Cursor on native Windows Expected: use WSL2 for the OS sandbox

Codex shows its hook as installed but runs it only after you trust it: open /hooks in Codex and trust OpenMoat’s. openmoat doctor reminds you on Codex’s line. See Supported agents.

openmoat status says an agent ran sessions and OpenMoat saw no call

Section titled “openmoat status says an agent ran sessions and OpenMoat saw no call”

Since 0.25.0, openmoat status, openmoat doctor and openmoat watch warn when an agent wrote sessions since its hook, settings or program changed and none of its calls reached OpenMoat. Restart the agent; if the line stays, run openmoat init and check what turns its hook off, and for Codex trust OpenMoat’s hooks in /hooks. See Is my agent still protected?

openmoat doctor warns about a project’s .claude settings

Section titled “openmoat doctor warns about a project’s .claude settings”

The project’s .claude/settings.json or .claude/settings.local.json turns hooks off (disableAllHooks) or sets its own hooks, env or a command. Claude Code loads it when a session starts, before OpenMoat’s hook runs, so check the file before you start an agent there. See Project settings that turn hooks off.

Hooks are read when a session starts. Start a new agent session after openmoat init, and check openmoat status. Restart OpenClaw’s Gateway and pi, which load OpenMoat’s plugin and extension when they start. Gemini CLI runs hooks only in folders it trusts.

Codex, and Claude Code before 2.1.295, then run calls without the check; Cursor, OpenClaw, GitHub Copilot CLI, pi, Gemini CLI, OpenCode, Hermes Agent and goose block them, and for the Cline CLI OpenMoat’s own hook script blocks them.

With Claude Code 2.1.295 or later, openmoat init sets "onFailure": "block" on OpenMoat’s hook, so a call is blocked when openmoat cannot start, crashes or times out. It writes the key only when the claude on your PATH reports that version, and openmoat doctor warns when Claude Code is older or not found.

Reinstall it (brew reinstall crocodile-labs/tap/openmoat, or the installer), then run openmoat status.

A call is denied with no decision within 30 s

Section titled “A call is denied with no decision within 30 s”

OpenMoat could not decide the call in 30 seconds, usually on a heavily loaded machine, and denied it rather than let it run. Ask the agent to try again. openmoat doctor names the step most such calls were stuck in.

Every call denied this way right after upgrading from 0.13 to 0.14.0, with a large audit log? 0.14.0’s first hook call copied the whole log to accept the review verdict and ran past the time limit, then started again on the next call. Upgrade to 0.15.0 or later, which changes the log’s check in place (0.15.0).

openmoat run needs macOS 13 or later, and says so on earlier versions. The agent hooks still apply the policy to each tool call there.