Skip to content

Add blocking PermissionRequest hook for external approval UIs #15311

Closed

Description

@RousselPaul

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_persistent to 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

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    sandboxIssues related to permissions or sandboxing
    tool-callsIssues related to tool calling
    on Mar 20, 2026
  2. RousselPaul commented on Mar 20, 2026

    @RousselPaul
    Author

    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.

  3. added
    agentIssues related to the core agent loop
    and removed
    sandboxIssues related to permissions or sandboxing
    CLIIssues related to the Codex CLI
    tool-callsIssues related to tool calling
    on Mar 20, 2026
  4. added
    hooksIssues related to event hooks
    and removed
    agentIssues related to the core agent loop
    on Apr 2, 2026
  5. abhinav-oai commented on Apr 22, 2026

    @abhinav-oai
    Contributor
  6. oxysoft commented on May 8, 2026

    @oxysoft

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthooksIssues related to event hooks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions