Skip to content

Support PermissionRequest hook deny interrupts#17750

Closed
abhinav-oai wants to merge 2 commits into
codex/permission-request-hooks-basefrom
codex/permission-request-hook-deny-interrupt
Closed

Support PermissionRequest hook deny interrupts#17750
abhinav-oai wants to merge 2 commits into
codex/permission-request-hooks-basefrom
codex/permission-request-hook-deny-interrupt

Conversation

@abhinav-oai

Copy link
Copy Markdown
Collaborator

Summary

  • allow PermissionRequest hooks to return decision.interrupt: true alongside behavior: "deny"
  • route interrupting denies through the same turn-abort path used by an Esc interrupt
  • add integration coverage for shell, exec_command, network approval, and a verified subagent smoke path

Why

PermissionRequest hooks could deny a request, but they could not force the active agent loop to stop immediately. That made policy-driven hard stops behave differently from a user interrupt even when the hook author wanted the turn to terminate.

Impact

  • hook authors can now short-circuit a denied request cleanly by setting interrupt: true
  • denied requests without interrupt: true keep the existing rejection behavior
  • interrupt semantics are preserved across the command-execution and approval paths that can hit PermissionRequest hooks

Validation

  • cargo test -p codex-hooks permission_request_
  • cargo test -p codex-core permission_request_hook_
  • cargo run -p codex-hooks --bin write_hooks_schema_fixtures
  • just fix -p codex-hooks
  • just fix -p codex-core
  • just fmt
  • interactive TUI smoke test confirming an interrupting deny from a spawned subagent request

Stack

  • base branch: codex/permission-request-hooks-base

Co-authored-by: Codex <noreply@openai.com>
@abhinav-oai abhinav-oai changed the title [codex] Support PermissionRequest hook deny interrupts Support PermissionRequest hook deny interrupts Apr 14, 2026
Abort the originating turn synchronously for interrupting permission hook denials so the current turn cannot complete before cancellation lands.

Co-authored-by: Codex <noreply@openai.com>
@abhinav-oai abhinav-oai deleted the codex/permission-request-hook-deny-interrupt branch April 14, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant