Skip to content

Codex refuses to request write permissions in read-only mode #5639

Closed

Description

@MichaelFeistETC

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

Activity

  1. added
    bug
    on Oct 24, 2025
  2. github-actions commented on Oct 24, 2025

    @github-actions
    Contributor
  3. dylan-hurd-oai commented on Oct 24, 2025

    @dylan-hurd-oai
    Contributor

    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.

  4. viktorchak commented on Nov 21, 2025

    @viktorchak

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

  5. etraut-openai commented on Nov 21, 2025

    @etraut-openai
    Contributor

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions