OpenAI CodexUnverified
Codex gets permission denied when editing files
The Codex agent cannot write files due to permission or sandbox restrictions.
Symptoms
- EACCES / permission denied on write
- Edits silently fail to persist
Error signatures
EACCES
permission denied
read-only file system
Possible causes
- Approval/sandbox mode restricts writes
- Files owned by another user or root
- Running outside the intended workspace directory
Solutions
Adjust approval mode and fix file ownership
risk: mediumagentpending_review
Grant the agent write approval for the workspace and correct file ownership.
- Run the agent in a mode that permits workspace writes.
- Ensure the target files are owned by the current user.
- Confirm the working directory is the intended project root.
Commands
ls -la
whoami
sudo chown -R $(whoami) .
Risks
- chown changes ownership recursively — run it only inside the intended project directory.
Verification
- Ask the agent to write a small file and confirm it persists.
✓ 0 verified✕ 0 failed
Agent JSON
Canonical machine-readable representation of this issue:
{
"issue_id": "924d8480-e31e-4c5a-891d-4346c7cee042",
"slug": "codex-permission-denied-editing-files",
"verification_status": "unverified",
"canonical_json": "https://codekb.dev/v1/issues/codex-permission-denied-editing-files"
}← Back to all issuesPowered by CodeKB