Codex

"patch rejected: writing is blocked by read-only sandbox"

Last checked

The error

patch rejected: writing is blocked by read-only sandbox; rejected by user approval settings

Returned when the agent tries to create or edit a file. Reported in ChatGPT Work on web, Windows desktop and Android.

The agent's sandbox is in read-only mode, so every file write or edit is refused. On openai/codex#56688, ChatGPT Work sessions on personal Plus accounts start with full access and are then downgraded to read-only, so file creation fails. Reports started on 24 October 2026 and grew from 3 November. As of 10 November the issue is open with no fix or statement from OpenAI. Users report that starting a fresh Work session from the desktop app restored file writes; check your approval settings, retry in a new session, and watch the issue.

Why it happens

Codex and ChatGPT Work run file changes inside a sandbox whose mode decides what the agent may do. In read-only mode, applying a patch is refused with this message. The reported bug is the mode changing to read-only during the session on its own.

  1. A sandbox downgrade during the session (openai/codex#56688): it starts as full access and ends up read-only, reported on ChatGPT Work Cloud with personal Plus accounts.
  2. Your approval settings really are read-only. In Codex, the sandbox and approval mode you chose can block writes by design.
  3. A project folder the session cannot write to.

The fix

  1. 1 Check the session's permissions or approval setting and set it to allow edits, if it offers that.
  2. 2 Start a new Work session. One user on the issue reported that switching to Work mode in the desktop app restored file creation. This is a user report, not an OpenAI fix.
  3. 3 If you need the change now, ask the agent for the full file contents or a diff and apply it yourself.
  4. 4 In the Codex CLI, check the sandbox mode you started with and restart with a writable mode for that folder.
  5. 5 Follow openai/codex#56688 for an official fix, and check OpenAI's release notes.

Still failing?

  • Only one site or app fails, not file writes. That is the site-safety policy, see the page below.
  • You hit a usage limit message instead. See the Codex and Work mode limit page.

Related errors

Full guideChatGPT and Codex Usage Limits by Plan: What Is SharedEvery error, one pageClaude Code and ChatGPT rate limit alternatives

Hit a different error?

Paste any agent error and get the cause and fix in seconds.

Open the decoder

Frequently asked questions

What does "patch rejected: writing is blocked by read-only sandbox" mean?

The agent tried to write or edit a file, but its sandbox was read-only, so the patch was refused. Either your settings are read-only, or the session dropped to read-only on its own, which is the open bug.

Is this a known ChatGPT bug?

Yes. openai/codex#56688 tracks ChatGPT Work sessions on Plus accounts being downgraded from full access to read-only. It was first reported on 24 October 2026 and is open as of 10 November.

How do I get file editing back?

Start a fresh Work session and check its permissions. Users report a new Work session in the desktop app works again. Otherwise, have the agent output the file and apply it yourself.

Do I need Codex mode in the desktop app to edit files?

OpenAI has not said so. The reports point to a sandbox bug in Work sessions, not a new rule.

Stop firefighting agent errors

Decoding errors one at a time is the manual version of what BetterClaw automates. Run your agents on a no-code AI agent platform with managed models, retries and config validation built in.

Free plan available · Pro $49/mo · BYOK · 7-day free trial