codex - 💡(How to fix) Fix Typing is unsafe: auth/approval popups steal focus and consume composer keystrokes; persisted rules do not reliably prevent prompts [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18207Fetched 2026-04-17 08:31:21
View on GitHub
Comments
1
Participants
2
Timeline
12
Reactions
0
Author
Timeline (top)
labeled ×6unlabeled ×4closed ×1commented ×1

Root Cause

This makes the interface feel unsafe to type in, because ordinary prompt text can accidentally answer a privileged request.

Code Example

profile = "yolo"
[profiles.yolo]
approval_policy = "never"
sandbox_mode = "danger-full-access"
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.121.0

What subscription do you have?

pro

Which model were you using?

gpt-5.4

What platform is your computer?

Rocky-8 Linux

What terminal emulator and version are you using (if applicable)?

tmux - ssh - windows terminal

What issue are you seeing?

At high typing speed, even a brief focus flip is enough to misroute multiple keystrokes before the user notices.

While typing continuously in Codex at high speed, spontaneous auth/approval popups can appear and steal focus from the normal message composer. Keystrokes intended for the prompt are then consumed by the popup as auth/approval input instead of remaining in the composer.

This makes the interface feel unsafe to type in, because ordinary prompt text can accidentally answer a privileged request.

Separately, persisted permissions/rules do not seem sufficient to prevent later prompts in cases where I expected previously accepted permissions or ~/.codex/rules/default.rules coverage to suppress them.

Why this is a problem

Focus-management/input-routing bug:

  • ordinary composer input is reinterpreted as dialog input
  • auth/approval prompts can consume buffered keystrokes
  • prompt text gets corrupted or lost
  • the user cannot safely keep typing through background events
  • the user cannot trust that typing freeform text will remain in the composer

Annoying AND an input-integrity failure with approval/auth implications.

Severity

High UX severity and possible safety issue, because privileged popups can consume ordinary composer keystrokes.

Suggested fixes

  • Make approval/auth dialogs hard-modal with explicit focus handling.
  • Never redirect composer keystrokes into newly appearing popups.
  • Buffer and restore composer input if an overlay appears mid-typing.
  • Add a visible “pending approval request” indicator.
  • When re-prompting despite an existing rule, show an explicit “not covered because …” explanation with the rule mismatch.

What steps can reproduce the bug?

  1. Open Codex in interactive mode.
  2. Begin typing continuously in the normal composer at speed.
  3. Trigger or wait for an auth/approval request to appear during typing.
  4. Observe that the popup takes focus and consumes keystrokes that were intended for the composer.

A second issue:

  1. Allow or persist a rule / “don’t ask again” decision for an action.
  2. Continue using Codex in later interactions.
  3. Observe that Codex may still prompt again in situations where the existing rule/decision appears like it should have covered the request.

What is the expected behavior?

  • Auth/approval popups must not capture ordinary composer input unless explicitly focused.
  • If a popup appears while typing, pending keystrokes should remain in the composer.
  • Composer text should be preserved exactly across popup appearance/dismissal.
  • Approval/auth UI should be strongly modal and visually distinct so accidental typing cannot answer it.
  • If an existing persisted rule matches, Codex should not re-prompt.
  • If Codex does re-prompt, it should explain exactly why the request was not covered by the existing rule.

Actual behavior

  • Random auth/approval popups appear during typing.
  • Focus shifts implicitly.
  • Keystrokes are eaten by the popup.
  • I can no longer trust that typing is safe.
  • Existing persisted rules/permissions are not always sufficient to prevent later prompts.

Additional information

  • Variant: CLI
  • Codex version: codex-cli 0.121.0
  • OS: Linux rocky-8
  • Sandbox mode / approval policy:
profile = "yolo"
[profiles.yolo]
approval_policy = "never"
sandbox_mode = "danger-full-access"

also many default.rules expressly allowing common commands

  • Smart approvals enabled?: yes w/ guardian_subagent

extent analysis

TL;DR

Implementing hard-modal approval/auth dialogs with explicit focus handling and buffering composer input when an overlay appears can prevent keystrokes from being misrouted to popups.

Guidance

  • Review the approval policy configuration to ensure it aligns with the expected behavior, specifically the approval_policy = "never" setting in the yolo profile.
  • Consider modifying the default.rules to include more specific allowances for common commands to reduce unnecessary prompts.
  • Investigate the guardian_subagent configuration to ensure it's not contributing to the issue with smart approvals enabled.
  • Test the behavior with different typing speeds and focus changes to isolate the conditions under which the issue occurs.

Example

No specific code snippet can be provided without modifying the existing Codex CLI codebase, but the fix might involve adjusting event listeners for keyboard input and focus changes in the composer and popup components.

Notes

The issue seems to be related to the interaction between the composer, approval/auth popups, and focus management. The provided configuration and rules might not be sufficient to prevent all unnecessary prompts, and the guardian_subagent could be a factor. Further investigation into the Codex CLI code and its event handling is necessary for a comprehensive fix.

Recommendation

Apply a workaround by adjusting the approval policy and default.rules to minimize unnecessary prompts until a more permanent fix can be implemented in the Codex CLI, focusing on making approval/auth dialogs hard-modal and improving focus handling.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING