Codex CLI 0.172.0 was released on 24 November 2026, and it fixes sandbox permissions in codex exec resume. A session that starts as read-only now stays read-only when it resumes, even when your default configuration gives write access.
The Codex sandbox is the permission limit that controls if the agentAI agentAn AI program that performs work steps by itself, for example reading a message, drafting a reply, and recording the result.Open the glossary can read files, write files, or use the network. codex exec resume is the command that continues an old non-interactive session from a script, a cron job, or a CI pipeline. This release also starts an optional MCPMCPA standard that lets an AI program use your tools and data under clear permissions.Open the glossary server only when its first tool is called.
What changed in codex exec resume?
From 0.172.0, Codex restores the saved permission selection, working directory, and workspace roots of the old session. Before this release, codex exec resume sent the sandbox defaults of the current process as overrides, according to pull request #62194 in the Codex CLI 0.172.0 release notes.
Thus, a session that started with -s read-only could continue with write access when your default configuration gave write access to the workspace. The permission limit from the start of the session did not stay with the session.
| Condition | Before 0.172.0 | From 0.172.0 |
|---|---|---|
| Read-only first session, default configuration gives write access | Resume uses the process default and can write files | Resume restores the read-only permission from the session |
| Working directory and workspace roots | Not restored by default | Restored from the saved session |
Explicit override -c sandbox_mode | Used | Still used |
Option --add-dir | Not described in the release notes | Added to the workspace roots of the session |
| Named permission profile that cannot load | Not described in the release notes | Codex asks for an explicit permission selection |
What did users report before this fix?
A user reported this problem in issue #40149 on 22 August 2026, with Codex CLI 0.147.0 on a Linux server without an interactive terminal. The user told the model to write a test file, canary.txt, and then checked the disk after each step.
codex exec -s workspace-write: the file was created, as expected.codex exec -s read-only: the file was not created, as expected.codex exec resumewithout an override: the file was created. This is the problem.codex exec resume -c sandbox_mode="read-only": the file was not created.
The report also shows that codex exec resume refuses the -s option. The workaround in old versions is to add -c sandbox_mode="read-only" to each resume command. The official fix came approximately 3 months later, in 0.172.0. On 24 November 2026, the issue was still open on GitHub.

What did our check on the build server show?
We checked Codex CLI on our Linux build server on 24 November 2026, and the installed version was codex-cli 0.172.0. The help text of codex exec resume --help still has no -s or --sandbox option. To change permissions on resume, use -c sandbox_mode="...". We also read the source code at tag rust-v0.172.0: the resume-specific arguments are only the session id, --last, --all, images, and the prompt. We did not test model calls in this check.
Who must upgrade now?
Teams that run codex exec resume from cron, scripts, or CI must upgrade first. The highest risk is on machines where the default configuration gives write access, or in folders that are marked as trusted.
- Developers and DevOps teams: Examine each script that uses resume. In old versions, a read-only session for an audit or a log summary can become a session that writes files.
- Business owners and marketers: If your team uses Codex only in interactive sessions or in the app, this fix is not urgent. You can upgrade on your usual schedule.
- Teams that cannot upgrade yet: Add
-c sandbox_mode="read-only", or the mode that you want, to each resume command.
Example scenario: A small team runs codex exec -s read-only each morning to read server logs, and a script sends the summary to Telegram. Then the script calls codex exec resume --last for a follow-up question. In old versions with a write-access default, the second step can change files in the working folder. In 0.172.0, the second step stays read-only.
What does lazy MCP startup mean for daily use?
From 0.172.0, an optional stdio MCP server starts only when its first tool is called, if Codex has the tool list of that server in its cache. Pull request #62366 marks the mcp_lazy_stdio_startup feature as stable and turns it on by default. A server with required = true still connects when the session starts.
MCP (Model Context Protocol) is a standard that connects AI agents to external tools, for example a database, a calendar, or a browser. Our MCP guide gives the full explanation.
- What is better: Codex does not wait for optional servers when a session starts. Users asked for this for a long time: issue #2335 was opened on 15 August 2025 and has 47 reactions.
- What can cause problems: A broken server, for example with a wrong command or an expired login, fails only when its first tool is called. In a non-interactive session, the error comes in the middle of the task, not at the start.
- How to set it: Mark important servers with
required = truein[mcp_servers.<name>]. To go back to the old behavior, use--disable mcp_lazy_stdio_startupor writemcp_lazy_stdio_startup = falsein the[features]section.

Which other changes in 0.172.0 are useful?
Other changes in 0.172.0 touch APIAPIThe official door 2 systems use to exchange data, without anybody copying it by hand.Open the glossary spend limits, per-tool approvals, and terminal comfort.
| Change | Effect for users | Source |
|---|---|---|
| API spend limit errors name the scope: API key, project, or organization | Codex stops retries, even when the provider sends Retry-After. You know which limit to increase. | PR #62329 |
| Approval reviewer for each tool in config.toml | Example: you approve calendar event creation yourself, and other tools keep automatic review. | PR #62360 |
| Tab completes slash command arguments | /mcp lo becomes /mcp login. | Release notes |
| Shift+Up and Shift+Down in the agent command center | You move between task groups faster. | Release notes |
| Child agent replies stay in the queue when you stop the parent turn | Subagent results are not lost when you stop the main task. | Release notes |
| Amazon Bedrock Runtime selection during setup | For app-server clients that use AWS. | Release notes |
One release earlier, Codex CLI 0.171.0 on 20 November 2026 added GPT-6.2 Sol and Astra and made Sol the default catalog selection. If the cost per task is important to you, read our GPT-6.2 Astra and Sol test before you change models.
How do you upgrade safely?
Upgrade to 0.172.0 in 6 steps, and test the scripts that use resume first.
- Check the installed version with
codex --version. - Find the scripts that use resume with
grep -rn "codex exec resume" <script-folder>, and then examinecrontab -l. - Upgrade with
npm install -g @openai/codex@0.172.0, or with the package manager that you use. - Test in a temporary folder: run
codex exec -s read-onlyand tell the model to write 1 test file. Continue that session withcodex exec resume, and make sure that the test file is not created. - Mark the MCP servers that must always run with
required = true. - Make sure that your script sends an alert when Codex stops at an API spend limit, because Codex no longer retries this error.
Pin the Codex version in automation scripts. Then the next release does not change cron behavior without your knowledge. If you need help to set up AI agents in your work process, read about our AI business process automation service.
What is the operational conclusion?
Upgrade to Codex CLI 0.172.0 this week if your scripts use codex exec resume. Until the upgrade is complete, write the sandbox mode explicitly with -c sandbox_mode on each resume. Then mark the MCP servers that must always run with required = true, so that errors do not come in the middle of a task. For the previous trust change, read our Codex CLI 0.169.0 article.
FAQ
Must I upgrade if I do not use codex exec resume?
It is not urgent. The sandbox permission fix applies only to resumed sessions. The upgrade still gives MCP fixes, clearer spend limit errors, and terminal improvements.
How do I set sandbox permissions on resume?
Use -c sandbox_mode="read-only" or another mode on the resume command. The -s option is not available on codex exec resume in 0.172.0.
Can I turn off lazy MCP startup?
Yes. Use --disable mcp_lazy_stdio_startup on the command, or write mcp_lazy_stdio_startup = false in the [features] section of config.toml.
Do required MCP servers still start at the beginning of a session?
Yes. A server with required = true still opens a connection when the session starts, even when its tool list is in the cache.
Are old sessions from previous versions safe too?
Codex 0.172.0 restores the built-in read-only permission from old history without wider read access. If a named permission profile cannot load, Codex asks you to select the permissions explicitly.

