Add blocking PermissionRequest hook for external approval UIs
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
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗