All guides

Codex approval prompt options explained: allow once, this session, or don't ask again

Updated 27 November 2026 · 5 min read

When the Codex CLI asks for approval, each choice lasts a different length of time. "Yes, proceed" allows only this one request. "...in this session" and "...for this conversation" choices last until you close that session. "Yes, and don't ask again for commands that start with ..." is permanent: Codex saves a rule to ~/.codex/rules/default.rules, so future sessions run matching commands without asking. "No, and tell Codex what to do differently" stops the turn and waits for your next message. Which options you see depends on the kind of request.

The labels below come from Codex's terminal UI source (approval_overlay.rs) and its test snapshots. The letter in brackets is the default shortcut.

01Running a command

"Would you like to run the following command?"

OptionLasts
Yes, proceed (y)This command, this once
Yes, and don't ask again for commands that start with <prefix> (p)Every future session, until you remove the rule
Yes, and don't ask again for this command in this session (a)The rest of this session
No, continue without running it (d)This request; Codex keeps going and tries something else
No, and tell Codex what to do differently (esc)Stops the turn until you type

Not every option appears every time. The prefix option shows only when Codex proposes a prefix for the command (it's left out for multi-line commands), and the session and "continue without running it" options only when Codex offers those decisions for that request. A common set is just "Yes, proceed", the prefix option and "No, and tell Codex what to do differently".

"Yes, and don't ask again for commands that start with ..."

This is the "always allow" choice. OpenAI's rules documentation says that when you add a command to the allow list in the terminal UI, Codex writes to the user layer at ~/.codex/rules/default.rules, so future runs can skip the prompt. It's saved as a prefix_rule, which allows any command that starts with the same words, outside the sandbox, in every project.

Read the prefix before you pick it. With Smart approvals on (the default), Codex proposes the prefix, and the docs advise reviewing it carefully. git status is a narrow prefix; something like python or npm run covers far more than the command in front of you. To undo it, open ~/.codex/rules/default.rules and delete the line. The Codex rules guide explains the file.

"No" versus "No, and tell Codex what to do differently"

The two refusals behave differently. "No, continue without running it" denies this command, and Codex carries on with the task, trying another approach. "No, and tell Codex what to do differently" denies it and stops: in Codex's protocol it means the agent shouldn't do anything until your next message. Use it when the plan itself is wrong, then type what you want instead.

02Network access

"Do you want to approve network access to "example.com"?"

OptionLasts
Yes, just this once (y)This request
Yes, and allow this host for this conversation (a)The rest of this session
Yes, and allow this host in the future (p)Saved as a network rule for that host
No, and block this host in the futureSaved as a block rule for that host
No, and tell Codex what to do differently (esc)Stops the turn

The "in the future" choices persist a network policy rule for the same host. The documentation we checked doesn't say which file holds it. If Codex keeps asking about the network while it works inside your project, it may be simpler to turn on sandbox_workspace_write.network_access; see approval modes explained.

03Editing files

"Would you like to make the following edits?"

OptionLasts
Yes, proceed (y)These edits
Yes, and don't ask again for these files (a)The rest of this session, for these files
No, and tell Codex what to do differently (esc)Stops the turn

"Don't ask again for these files" is a session approval, not a saved rule. Next time you start Codex, edits to the same files ask again.

04Granting extra permissions

"Would you like to grant these permissions?" appears when Codex asks for more access, such as network or reading and writing specific paths, shown on a "Permission rule:" line.

OptionLasts
Yes, grant these permissions for this turn (y)Until Codex finishes this turn
Yes, grant for this turn with strict auto review (r)This turn, under strict auto review
Yes, grant these permissions for this session (a)The rest of this session
No, continue without permissions (d)Codex carries on without them

A turn is one round of work from your message to Codex's reply. Granting for the turn is the narrower choice.

05Which to pick

  • Once when you're unsure, or the command touches something that matters.
  • This session for a task that will repeat the same command many times, like a test run.
  • Don't ask again for the prefix only for narrow, harmless prefixes you'd approve every time in every project.
  • Tell Codex what to do differently when the approach is wrong, not just the command.

06Answering from your phone

Every approval request runs Codex's PermissionRequest hook first, and a hook's answer is allow or deny for that one request. Notifier for Codex uses this to send approvals to an iPhone or Android app, so a phone answer always works like "Yes, proceed" or a refusal with a note, never "don't ask again". It is independent and not affiliated with OpenAI. See approving Codex commands from your phone.

07FAQ

What's the difference between "allow once" and "always allow" in Codex?

"Yes, proceed" allows only the current request. "Yes, and don't ask again for commands that start with ..." saves a rule to ~/.codex/rules/default.rules that allows matching commands in every future session.

How do I undo "don't ask again" in Codex?

Edit ~/.codex/rules/default.rules, remove the prefix_rule line for that prefix, and restart Codex. Session approvals end on their own when you close the session.

Does "don't ask again for this command in this session" carry over to new sessions?

No. Session and conversation approvals last only until that session ends.

Why doesn't Codex offer "don't ask again" for some commands?

The prefix option appears only when Codex proposes a prefix for that command, and it's hidden for multi-line commands, network prompts and requests for extra permissions.

Notifier for Codex Get a push on your phone when Codex finishes or needs you, then approve, reject or answer from there. The codex-notifier command line tool is free on Mac, Windows and Linux.