Add blocking PermissionRequest hook for external approval UIs
Resolved 💬 4 comments Opened Mar 20, 2026 by RousselPaul Closed Apr 22, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
The hooks system (UserPromptSubmit, SessionStart, Stop) is great for observability. What's missing is a blocking hook for tool approval - letting external processes approve/deny commands before execution.
Use case: Desktop overlays, IDE extensions, and CI/CD pipelines that want to handle approval flows outside the TUI.
We hit this building Masko Code (desktop overlay for Codex + Claude Code) - currently we can ingest Codex session logs but can't send approval responses back.
Proposed contract (similar to Claude Code's):
- Hook fires when Codex needs approval for a command
- Blocks until hook script exits
- Exit 0 = allow, exit 2 = deny
- Payload includes: command, tool name,
prefix_rule, sandbox permissions - Hook output can include
allow_persistentto auto-approve the prefix
PreToolUse (#15211) is close but is bash-only and deny-only. This would cover all tool types with bidirectional responses.
Related: #14882, #13498, #15211
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Not a duplicate - #14882 and #14754 propose PreToolUse/PostToolUse for observability and code quality enforcement. This requests a blocking approval hook with bidirectional response (allow/deny/allow_persistent), which is different from deny-only PreToolUse (#15211). The key difference is that the hook script can respond with an approval decision, not just block execution.
Added in https://github.com/openai/codex/pull/17563
https://developers.openai.com/codex/hooks#permissionrequest
Indexed this hook ticket in the umbrella tracker: #21753
Goal: collect the scattered Codex hook requests and bugs into one parity matrix for Full Claude Code Hook Parity (29+), while preserving this issue as the detailed thread for its specific behavior.