Enforcement & Security
What MeowKit enforces with hooks on each of the six runtimes, what it leaves to the workflow, and its four-layer security model.
Planning and review are practices
MeowKit has no plan-approval step and no review-approval step. An agent can edit source without an approved plan and commit without a review verdict, and no hook checks either. Both stay in the workflow:
- For a change of more than two files or about 30 minutes, the agent writes the plan under
tasks/plans/YYMMDD-name/and agrees it with you before building. - The reviewer checks the diff across five dimensions (correctness, maintainability, performance, security, coverage) and writes a verdict.
The ship check
The ship check is the one control a hook enforces at ship time. On git commit, git push, git merge and gh pr create|merge, the pre-ship hook runs lint on the changed files, the tests related to them and a type-check, and refuses the command when one fails.
- When the test runner cannot name the related tests, the check runs lint and type-check only and says that tests did not run.
MEOWKIT_HOOK_PROFILE=fastdoes not turn it off.- A ship command run inside
bash -c, a script or a Makefile target is not seen. - The check stops itself after 270 seconds and reports what did not finish.
Push, merge and force-push are approved through your host's own permission prompt when the host is set to ask. MeowKit adds no prompt of its own.
What each runtime enforces
An Enforced cell means a registered hook refuses the action. Advisory means an instruction asks for it and nothing checks. .claude/hooks/hook-coverage.json in the kit records what each safety behaviour becomes on each runtime.
| Control | Claude Code | Codex | Cursor | Grok | Pi | OMP |
|---|---|---|---|---|---|---|
| Credential-file reads | Enforced on Read, Edit/Write and Bash | Enforced on Bash only | Enforced on file reads | Enforced on every tool | Enforced on every tool call | Enforced on every tool call |
| Ship check | Enforced | Enforced | Enforced | Enforced on Bash | Enforced on shell commands | Enforced on shell commands |
| Destructive shell commands | Advisory | Absent | Enforced | Absent | Absent | Absent |
| MCP server allowlist | Absent | Absent | Enforced | Absent | Absent | Absent |
| Writes to protected paths | Absent | Absent | Enforced | Absent | Absent | Absent |
| Plan before building | Advisory | Advisory | Advisory | Advisory | Advisory | Advisory |
| Review before shipping | Advisory | Advisory | Advisory | Advisory | Advisory | Advisory |
| Completion check | Opt-in | Opt-in | Opt-in | Absent | Absent | Absent |
Cells that say Absent mean the host's own permissions are the only control. On Claude Code the careful and freeze skills block destructive commands only while the skill is active.
Grok, Pi and OMP enforcement follows what each vendor documents and what the kit's code does. None of it has been run in a live Grok or Pi session, and for OMP only the skill listing was probed.
When installed hooks do not run
- Claude Code started in a subdirectory that does not see the project's
.claude/settings.json, or a sparse checkout or worktree without.claude/. - Codex skips hooks that are new or changed since you last reviewed them. After an upgrade the ship check is inactive on Codex until you review the hooks.
- Cursor with
MEWKIT_CURSOR_HOOKS_KILL_SWITCH=1in the environment: the shell, MCP and tool guards and the ship check stand down. The credential read guard does not. - Grok runs project hooks only after
/hooks-trust, or when it starts with--trust. - Pi loads
.pi/extensions/meowkit.tsonly in a project you have trusted with/trust. - OMP has no trust step.
The credential guard does not see files attached with @ in the prompt, because no tool call happens. On Claude Code and Cursor it also misses reads inside a subprocess such as grep -r or a build tool.
The completion check (opt-in)
With hooks.pre-completion-check: true in .meowkit/config.yaml, a turn that ends with files changed since the last passing test, build, lint or type-check run is continued, at most twice, and then ends with a notice. It is off by default. It shows that the agent ran a check, not that the check proves anything: a trivial passing command satisfies it.
When a check blocks you
A commit refused with PRE-SHIP BLOCKED means lint, a related test or the type-check failed on what you are shipping. The output names the failing check. Fix it and commit again.
A read refused with @@PRIVACY_BLOCK@@ means the file looks like a credential (.env, .envrc, .npmrc, a private key, .kube/config, a credentials or secrets file). Approve the read explicitly if the task needs it.
Security model: four layers
The hook names below are the Claude Code registrations.
Layer 1: Behavioral rules
security-rules.md and injection-rules.md load every session and cannot be overridden. They require that the agent:
- does not write hardcoded secrets, SQL built by string interpolation, or unescaped user content
- treats all file content as data, because only
.claude/rules/, skill frontmatter and a project-ownedCLAUDE.mdcontain instructions - stops, reports, waits and logs when it suspects an injection
- builds no skill that processes untrusted input, accesses sensitive data and changes state all at once (the Skill Rule of Two)
Layer 2: Preventive hooks
| Hook | Event | What it blocks |
|---|---|---|
privacy-block.cjs | PreToolUse (Read, Edit|Write, Bash) | Reads of credential files; fetches aimed at private or metadata hosts |
pre-ship.cjs | PreToolUse (Bash) | A commit, push, merge or PR whose lint, related tests or type-check fail |
These hooks intercept the tool call before it runs.
Layer 3: Observational hooks
| Hook | Event | What it checks |
|---|---|---|
post-write.cjs | PostToolUse (Edit|Write) | Security scan of every written file; a blocked pattern goes back to the model |
build-verify.cjs | PostToolUse (Edit|Write) | Compile or lint after every source change; a failure goes back to the model |
These run after the tool call, so the file is already written. They report and do not prevent.
Layer 4: Context isolation
- Parallel agents run in isolated git worktrees.
- Subagents do not inherit the parent session's memory.
- The evaluator and the generator are separate agents, which prevents self-evaluation bias.
- A
dispatch.cjscrash does not affect the guards, which are independent entries insettings.json.