· 6 minute read
Codex CLI approval prompts explained.
Codex CLI asks for approval when a task needs an action outside the access its current sandbox allows and its approval policy permits asking. A normal workspace-write session can edit files and run commands inside the project without a prompt. Network access, protected paths, or work outside the workspace may stop the run until you answer.
key takeaways.
- The sandbox limits what Codex can reach. The approval policy determines whether it can ask to cross that limit.
workspace-writepluson-requestlets work inside the project proceed and surfaces requests for actions that need more access.- Read the exact command, destination and scope before approving. A familiar command can still have surprising effects.
- If Codex pauses while you are away, a Mac alert, phone push or ringing call can help you notice the request.
when does Codex CLI ask?
Codex CLI can work inside the permissions of its current session without asking about every file edit or shell command. In the common workspace-write sandbox, it can read files and write inside the workspace, subject to protected paths. Network access is off by default. An operation that needs a write outside the workspace, a protected path such as .git, or a network request may need additional access. Whether Codex asks you or simply reports the block depends on the approval policy and the situation.
The terminal shows the action Codex wants to take and an approval choice. Read the command and any path or network destination before answering. A prompt may offer a narrow one-time approval or a broader reusable permission; choose the smallest scope that gets the job done. If you leave that prompt unanswered, the session cannot continue past that action.
Not every long task will produce a prompt. A task that stays within the workspace can finish unattended. A task that needs a dependency download, a Git operation or another restricted action may stop early. See OpenAI’s approval and security guide for the current model.
two settings control the pause.
sandbox_mode defines the access boundary. read-only allows inspection but blocks writes. workspace-write lets Codex edit the project while protecting some paths and limiting network access by default. danger-full-access removes the sandbox boundary. Set the boundary to match the work you actually intend to allow.
approval_policy controls interactive requests. With on-request, Codex can ask you when an action needs permission. With never, it cannot ask for interactive approval; a blocked action is returned as a failure. The current CLI also offers --approve-for-me for automatic review of eligible requests. Automatic review is a separate choice and does not guarantee every request will be approved.
For a typical coding session that should edit this repository and ask before crossing its boundary, put this in ~/.codex/config.toml:
approval_policy = "on-request"
sandbox_mode = "workspace-write"
You can also select these settings when launching Codex with codex -a on-request -s workspace-write. Check codex --help on your machine before copying a flag: available options can change between CLI releases. OpenAI’s sandboxing guide explains the boundary in more detail.
approve the action you can explain.
First read the exact operation, its working directory and its target. A test command inside the project is usually easy to check. A command that downloads a package, writes to a file outside the repository or changes Git metadata needs closer attention. A short command name alone is not enough: flags, shell pipes and the destination matter.
Approve a request when it matches the task you gave Codex and the access is proportionate. If it asks for more than the task needs, reject it and tell Codex what to do instead. For example, a dependency install may justify network access for that step; it does not require changing the whole session to unrestricted access. A command such as curl ... | sh deserves inspection of the source and effect before execution, even if the agent describes it as setup.
If a prompt offers a reusable rule, consider what future commands it would cover. A one-time approval is easier to reason about when you are unsure. You can review the resulting files and Git diff after the session, too.
why does it keep asking?
Repeated prompts usually mean the task keeps crossing the same boundary: fetching packages with network access off, writing outside the workspace, or touching a protected directory. Read the actual requested action before changing settings. If the access is routine and expected for this project, configure a narrow allowance for it. If the request is unexpected, leave the boundary in place and change the task.
Older guides may list suggest, auto-edit, full-auto, on-failure or untrusted as current CLI approval modes or policy values. Those names do not match the current CLI’s --ask-for-approval choices. In particular, copying approval_policy = "on-failure" into a current configuration is not a working way to reduce interruptions. Check your installed codex --help and the current docs before reusing an older example.
when you leave the Mac.
If a run needs an approval while you are away, Codex waits at that step. A local terminal or desktop alert is enough if you are nearby. A phone notification works if you want to inspect the session on your phone. For an option that is harder to miss, CallMyAgent watches Codex and calls after the delay you set when you are away and outside quiet hours. It reads the request and can take one spoken answer. At your Mac, it plays a sound instead.
A call depends on a real waiting request and your app settings; simply starting Codex or leaving it idle will not trigger one. If you use approval_policy = "never", there is no interactive approval request for a call to answer. You can try two test calls without a card and choose a delay that works for you.
For a push-first route, see Pushary. If you work in Claude Code and want to see the whole conversation on your phone, Anthropic’s Remote Control may fit better. The comparison hub lays out those choices.
questions.
Does Codex ask before every file edit?
No. In a workspace-write session, edits inside the permitted workspace normally proceed without an individual approval prompt. Other boundaries and session settings can change that behavior.
What happens if I choose never?
approval_policy = "never" prevents interactive approval requests. If an action is blocked by the sandbox, Codex receives a failure instead of asking you to approve it.
Will CallMyAgent ring as soon as I open Codex?
No. It needs a real agent event and follows the delay, presence and quiet-hour settings in the Mac app. An idle session does not create a permission request.
what we checked.
Settings and behavior were checked against the installed Codex CLI and OpenAI’s first-party guidance on 24 November 2026. Check your installed version for its exact options.