Codex refuses to request write permissions in read-only mode

Resolved 💬 4 comments Opened Oct 24, 2025 by MichaelFeistETC Closed Oct 24, 2025

What version of Codex is running?

codex-cli 0.44.0

What subscription do you have?

Not sure

Which model were you using?

gpt-5-codex medium

What platform is your computer?

Linux 6.8.0-86-generic x86_64 x86_64

What issue are you seeing?

Asking codex to do anything while in the read-only mode results in it complaining about not having write permissions. To circumvent this, it requests to run commands like cat and just pipe them to files instead.

The example I gave starts with an empty directory, but this also occurs when Codex would go to modify an existing file.

What steps can reproduce the bug?

  1. Create empty directory
  2. Start codex in read-only mode
  3. Enter: "Create a new python file that outputs a new file called my_file.txt and fills it with hello world."
  4. Codex outputs:
• I need to create a new Python file that writes output to my_file.txt, but I can't because the environment is read-only. Since this is essential, I'll request elevated permissions to write
  the file. There's a straightforward approach to create the script I need, using a shell command for this. I'll specify the script content and include the correct work directory as well.
  Let's get this done!

 
  Would you like to run the following command?
 
  Reason: Need to create a new python script file in read-only sandbox
 
  $ cat <<'PYCODE' > create_my_file.py
  #!/usr/bin/env python3
 
  from pathlib import Path
 
 
  def main() -> None:
      Path("my_file.txt").write_text("hello world\n", encoding="utf-8")
 
 
  if __name__ == "__main__":
      main()
  PYCODE
 
› 1. Yes, proceed
  2. Yes, and don't ask again for this command
  3. No, and tell Codex what to do differently esc

What is the expected behavior?

Codex should request to make changes to a file not do this weird cat + redirect.

Additional information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗