openai / openai/codex

Expose a fail-closed pre-delivery hook that can hold normal Codex responses before rendering

Open
#43,254 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app enhancement hooks
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What variant of Codex are you using?

Codex App, CLI, and response lifecycle hooks

What feature would you like to see?

Problem

Codex currently exposes lifecycle hooks such as Stop, but no documented response-lifecycle event runs after final assistant response bytes exist and before a normal response is rendered.

Stop is not sufficient. It receives last_assistant_message after the turn stops; a blocking result creates a continuation prompt. It cannot make a mandatory, fail-closed decision that prevents an unsupported completion claim from becoming visible.

This leaves no native enforcement point for organizations that need a separate validator to stop a response whose complete, fixed, reviewed, or accepted claim exceeds recorded evidence.

Related but not duplicate: #34418 documents post-response Stop behavior in Codex Desktop. This request is for a mandatory pre-render/pre-send interface across all normal delivery routes.

Requested capability

Provide a platform-owned PreDelivery or PreResponse lifecycle event that runs after final response bytes form and before the response is rendered or sent.

The event should receive immutable final response bytes, thread and turn identifiers, delivery route, delegated/subagent context, retry/reconnect/resume state, and an optional evidence-packet identifier.

It should return only:

  • DELIVER, including the exact response hash and a persisted receipt identifier; or
  • HOLD_DELIVERY, including user-safe reason codes.

The response must be held if the hook is absent, errors, times out, returns malformed data, cannot persist/reopen its receipt, or finds a hash mismatch. There must be no client, configuration, prompt, tool-event, retry, reconnect, or alternate-renderer bypass.

Required route coverage

  1. Codex Desktop interactive responses
  2. Codex CLI/TUI responses
  3. Delegated and subagent results
  4. Retries, reconnects, and resumed turns
  5. Tool-using responses
  6. Tool-free responses

Acceptance tests

  1. An unsupported complete, fixed, or accepted claim is held before it becomes visible on every listed route.
  2. A valid claim delivers only after its receipt is persisted, reopened, and hash-matched to the exact rendered response.
  3. Validator absence, timeout, error, malformed output, receipt failure, or hash mismatch holds delivery.
  4. An independent reviewer reruns the complete route and adverse-case suite against the integrated build.
Additional information

Official hooks documentation: https://learn.chatgpt.com/docs/hooks
Official issue/feedback route: https://learn.chatgpt.com/docs/reference/troubleshooting
Related issue: https://github.com/openai/codex/issues/34418

Prompts, PreToolUse, PostToolUse, Stop, wrappers, and local checklists cannot provide mandatory protection for normal tool-free Codex responses; a response-level fail-closed enforcement point is required.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked hooks documentation and related issue #34418, then trace the listed Desktop, CLI/TUI, delegated, retry, reconnect, resumed, tool-using, and tool-free delivery routes. Done means the requested pre-delivery event and all acceptance tests cover every route, fail closed for each listed failure, and verify persisted receipts and response hashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, desktop, devtools, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.