Codex refuses to request write permissions in read-only mode

Resolved 💬 4 comments Opened Oct 24, 2025 by MichaelFeistETC Closed Oct 24, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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 ↗

4 Comments

github-actions[bot] contributor · 10 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #5312
  • #4421
  • #5199
  • #4600

Powered by Codex Action

dylan-hurd-oai contributor · 10 months ago

This should be fixed by #4718 and #4742 which are in 0.45.0 and above. Please re-report if you're seeing this on recent versions.

viktorchak · 9 months ago

still see the behavior. my codex CLI asked me to get .git writable permission for it

etraut-openai contributor · 9 months ago

@Viktorzhai, if you're seeing this behavior with the latest version of the CLI, please use the /feedback slash command to upload the thread and file a new bug report.