codex-windows-sandbox-setup.exe keeps giving full read/execute permissions to CodexSandboxUsers recursively on entire user directory

Open 💬 3 comments Opened Jul 8, 2026 by Rooni
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Running Process Monitor filtered on Operation is SetSecurityFile reveals that codex-windows-sandbox-setup.exe keeps giving most files/directories inside the user directory read/execute permission to CodexSandboxUsers (recursively), no matter the context or location of the project directory.

This includes:

  • the entirety of the AppData folder
  • Specific private ssh keys causing ssh to complain about unsafe file permissions (.pub gets ignored)
  • .bash_history
  • Tons of other sensitive files

This seems like an extreme breach of security and I can't find this documented and only mentioned in some dead tickets.

Seems to get triggered in the background randomly when using codex, after which it takes a few minutes to change the permissions of files and folders under the user folder

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 1 month ago

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

  • #31140
  • #31468

Powered by Codex Action

Rooni · 1 month ago

Managed to mitigate some of the security concerns by modifying user\.codex\config.toml with the following new entries:

default_permissions = "project-only"

[permissions.project-only]
description = "Stop reading my files"

[permissions.project-only.filesystem]
":minimal" = "read"
":tmpdir" = "write"
":slash_tmp" = "write"

[permissions.project-only.filesystem.":workspace_roots"]
"." = "write"
"**/*.env" = "deny"

After which I mostly only get codex accessing its own AppData directory, project directory, and Temp directory.

Temp folder is still an issue but at least I don't get my entire file system permissions modified anymore.

chk-mk · 1 month ago

I also encountered this, in the form of the permission warning with SSH keys. Everything in my Documents folder is affected.

Mass changing of file permissions is a potentially damaging action. I expect a fix, if not done already, and also an apology.