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?"
<prefix> (p)Every future session, until you remove the ruleNot 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"?"
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?"
"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.
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.