Codex CLI security hooks
Muzzle checks each command, patch, file write and MCP call Codex makes before it runs, and the requests its commands send.
"PreToolUse": [ { "matcher": "^(Bash|apply_patch|Edit|Write|mcp__.*)$", "hooks": [ … "muzzle hook codex" … ] } ],
"PostToolUse": [ { "matcher": "^(WebFetch|WebSearch|Bash|Read|mcp__.*)$", … } ],
"SessionStart": [ … ]
$ codex
› /hooks
Set it up
- Download Muzzle, open it and click Get started.
- Enter what should never leave your Mac: your email, name and phone number. Muzzle suggests your git email and account name.
- Switch Codex on and click Protect. Muzzle adds its hooks to
~/.codex/hooks.jsonand acodexshell function to~/.zshrc, and to~/.bashrcif you have one. - Open a new terminal, start Codex and type
/hooksto turn the hooks on. - Get Pro with a key, or by contributing to the Threat Feed with a confirmed email.
- Muzzle scans your projects and shows anything that already leaks. For the first week it only watches, then you turn blocking on.
What's covered
Leaks in commands, patches, file writes and MCP calls
ProSettings lock
FreeCredential files and package check
ProPrompt injection alerts on results
ProInstruction files and risky folders at session start
ProRequests made by commands Codex runs
ProQuestions
What happens when Pro ends?
The settings lock keeps working. The other checks let Codex through; nothing is uninstalled.
How do I remove it?
Switch Codex off in Muzzle's Settings. Muzzle removes its hooks and the shell function.
Related
Put Muzzle between your agents and the internet
Download for Mac
Free · Apple Silicon · macOS 12 or later
Pro from $8/month, or free while you contribute to the Threat Feed