Nice to document which files under writeable root are protected

Resolved 💬 9 comments Opened Feb 17, 2026 by solomatov Closed Feb 17, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What is the type of issue?

Documentation is missing

What is the issue?

According to this file, it seems that .git, .codex, and .agents aren't writeable for an agent. Nice to document this somewhere since it's not obvious.

https://github.com/openai/codex/blob/08f689843f48f20c075179b9a279649cb55fbe9e/codex-rs/protocol/src/protocol.rs#L755

Where did you find it?

_No response_

View original on GitHub ↗

9 Comments

solomatov · 5 months ago

Interestingly if I run codex agent with a prompt which directs it to create a git commit, it's able to do so. So, it seems the behavior is more complicated than I expected.

P.S. I run it on linux

solomatov · 5 months ago

Interestingly, if I run a command with codex sandbox linux git commit -a -m "test commit" it results in:

user@agent-server:~/backend$ codex sandbox linux git commit -a -m "Test commit"
fatal: Unable to create '/home/user/backend/.git/index.lock': Permission denied
solomatov · 5 months ago

I asked codex, about how it works, and it's pretty complicated. E.g. it looks like it does what is expected, but the behavior doesn't seem to be documented anywhere.

etraut-openai contributor · 5 months ago

Thanks for the suggestion. I'm working on documenting this.

solomatov · 5 months ago

@etraut-openai Thanks! BTW, my understanding is that when bubblewrap is the default, the behavior will be much nice. Do you have any timeline for this?

etraut-openai contributor · 5 months ago

Here's the new documentation.

solomatov · 5 months ago

@etraut-openai BTW, it's an offtopic, but are you Eric Traut who worked on pyright? I read the code in a lot of details, and like it very much :-)

solomatov · 5 months ago

@etraut-openai Thanks!

solomatov · 5 months ago

@etraut-openai BTW, in the docs you have this:

<writable_root>/.git is protected as read-only whether it appears as a directory or file.

But according to the my running of codex, this isn't correct, e.g. I could create a commit under a sandbox