Security concern: CodexSandboxOffline/Online assigned to entire user profile tree on Windows 11
What version of Codex CLI is running?
0.101.0
What subscription do you have?
Bring Your Own Key
Which model were you using?
gpt-5.2-codex
What platform is your computer?
Windows 11 Pro
What terminal emulator and version are you using (if applicable)?
PowerShell
What issue are you seeing?
On Windows 11, Codex’s experimental sandbox creates two local users (CodexSandboxOffline and CodexSandboxOnline) that belong to the CodexSandboxUsers group.
These users are granted permissions on the project folders (and subfolders) where Codex-CLI is executed.
While this is understandable (the goal is to add an extra security layer when running commands), what I find unacceptable is that these users are also granted access to C:\Users\<USER> and—indiscriminately—to _ALL_ subfolders under that directory. Aside from the fact that this approach dirties the environment (after uninstalling codex-cli and removing the Windows users, stale/unreferenced user SIDs can still remain on ACLs), it looks like a potential attack surface in the event of malicious commands executed via codex-cli.
The same behavior can be observed when using the IDE extension (which effectively downloads precompiled Windows binaries, but ultimately codex-windows-sandbox.exe mirrors the same behavior).
Other than using WSL, is there any way to avoid this pollution? And why isn’t this explicitly stated in the documentation? (It wouldn’t fix the issue, but at least users would be aware of it.)
What steps can reproduce the bug?
Install codex-cli on Windows and choose to setup the default sandbox when asked.
What is the expected behavior?
_No response_
Additional information
_No response_
22 Comments
It might also pollute your SSH configuration in
~/.ssh, as mentioned here: https://github.com/openai/codex/issues/12226I just noticed the same problem. I have Windows 11 Controlled Folder Access active, meaning every application trying to access my user folder needs to be given explicit permission to do so.
I just installed the latest Codex extension for VS Code and started a conversation about reading and understanding the code of a simple test project and am getting absolutely swamped by Windows Notification about how Codex tries to access all kinds of files in my user directory, causing a new security notification every 2-3 seconds.
Why is it constantly trying to access my favorites? What is its deal trying to access my documents? The simple task I have given it does not warrant the try to read through my personal profile at all.
I see no reason why it should have any business inside my user profile at all.
I am having the same problem as 686d7066, IT messaged me pretty quickly.
Two other issues where Codex granted itself NTFS permissions:
In my case it added CodexSandboxOffline (or CodexSandboxOnline; i didn't realize there were two) to
D:\.And it removed all other ACLs that were present (blocking all users from the
D:drive).I noticed the same and got swamped by security warnings. This is really ugly and dangerous behaviour.
How has no one from Open AI replied to this? How is this still an ongoing issue? This also affects VSCode Codex extension users.
Does anyone know how to broadly and easily remove the ACL permissions for CodexSandboxUsers? Why the hell does Codex need read access for basically my entire computer?
Seems like a massive invasion of privacy and a serious screw up that Codex now has read access to basically my whole computer. And the weirdest thing is, I never had any issues before using Codex with VSCode, it was restricted to the project folder, it worked fine, and there was no invasive privacy problems. Then I was forced to accept this sandbox option 2-3 weeks ago and not only did it break functionality, it seems it's also a major privacy invasion whether intentional or not.
In my case it was correctly getting access denied. So it probably ran a powershell script call to
icaclsto try to resolve it. I assume it was running as me; who hasWRITE_DACLpermission on theD:\folder. I didn't notice any such call. And when i asked it to review the chat conversataion: it couldn't find any call either.In order to protect against this, i removed my
WRITE_DACLpermission fromD:\.I got hit by this issue after trying to SSH using private key but gave me an error to remove the SID first that has access to my SSH private key, that SID is associated to Codex users and I'm as surprised it assigned to every directory even AppData with Codex SIDs
I think I managed to resolve this though not sure if this is the broad solution, by removing two users from lusrmgr (for Windows Pro, home must use net comamnd) then on the user profile directory, on file explorer you need to click Give Access To > "Remove Access" which would take time
I believe you can also do this via icacls command though I don't fully use it
IMO unprivileged sandbox is more than enough, or just use WSL2
My biggest issue is that the modifications to user system are invasive but very poorly documented.
The Windows page only says,
IT cannot possibly make decisions just based on this sentence alone.
Fortunately, codex is open source, and I figured out what
codex-command-runner.exedoes (implemented incodex-rs/windows-sandbox-rs) and was able to provide more details for IT to review. But the fact that this process is opaque is very concerning.P.S. Plus there is no easy way to undo all of this, it seems.
---
I created a GitHub Gist that lists all changes to user system. I was not able to verify every detail but could confirm some of the most impactful changes.
thanks for reporting this. For now we likely won't change this, but if it bothers you for the codex sandbox users to have broad read access, you can change your sandbox (in
config.toml) toand remove the ACLs. The
unelevatedsandbox will not recreate them.This response misses the point entirely.
The problem is not that “Codex sandbox users have broad read access” and that this might merely “bother” someone. The real issue is that Codex appears to modify ACLs in a way that can break unrelated third-party applications on Windows, and that those effects can persist even after Codex has been uninstalled.
In my case, this was not theoretical and not cosmetic:
That is a serious regression, not a matter of preference about Codex having read access.
Saying “we likely won't change this” and suggesting users switch to
sandbox = "unelevated"is not an acceptable answer to a bug report like this. Users should not have to weaken or reconfigure sandboxing, manually inspect ACLs across their user profile, and repair broken third-party applications after installing or uninstalling a developer tool.Even worse, this is not limited to Codex being installed. The damage can remain after uninstall, which makes it substantially more severe. A tool must not leave behind deeply inherited ACL changes in sensitive per-user paths if those changes can interfere with Electron apps, browser DRM, or other software that relies on sandboxed subprocesses.
This needs to be treated as an actual Windows bug:
Right now, the response reads as though the issue is being dismissed as a minor annoyance. It is not. Breaking unrelated applications and DRM playback on a user system is an absolute no-go.
I'd also like to point out I still have to manually correct permissions for
my SSH keys that I have on my computer, not something I'd do every time
sandboxing is being used, because Open SSH does not like that
I agree this does break applications where ACLs matter a lot, IMHO there should be other better ways to sandbox than resorting through this... and the unelevated sandboxing is more than enough for most users, and elevated should be for users who matter more on security.
On Sun, Apr 19, 2026, 3:54 AM seh-len @.***> wrote:
Just popping in to mention that this particular feature breaks windows built in ssh client, as it introduces bad permissions on ~/.ssh/config
Man, reading all this I feel lucky that Controlled Folder Access prevented this shit show for me and the worst of my problems was the constant notifications from Windows Security about Codex TRYING to apply this mess.
I really cant understand how the Codex team seemingly is simply brushing this of as nothing serious.
Open code app is a better alternative...
For anyone who has run into this problem and wants a quick fix, you can do the following in powershell, and then stop using codex
This is not a solution for this case, because the unwanted ACL entries were not only present on the profile root but had been stamped explicitly onto many individual subfolders throughout the user profile. Removing the ACE from
%USERPROFILE%alone only changes that single directory and does nothing to clean up the large number of separate child-folder ACLs that were already written.@seh-len I'm not super familiar with windows permissions, but it did in fact remove all of the entries from subdirectories and files when I ran it.
All of the subdirectories and files inherit the permission from the root due to inheritance, so when you remove the root, all the children lose it as well.
In my case, it wasn't inherited from the root folder, but was set separately for each individual subfolder.
so we have found temporary solutions by removing the permissions of lets say the 'home' directory but what about the sub folders in the ACL entries? Why is no OpenAI employee solving this major issue?
So in short what this thread is trying to say is that my windows machine is now cooked and I will have to boot up a fresh install?
a bunch of my scripts for SSH just stopped working because ssh refused to accept the private keys after Codex gave itself permissions to the key files.
This happens also on windows 10, just discovered it a while ago accidently. Codex definitely shouldn't create other users, even if they are labled as "Sandboxed users"; I don't see any reason for that to happen, and yes, opposed to what some of you may think, it is a security risk. Also if OpenAI doesn't want to change that behavior, the minimum is to alert the user that this is going to happen when installing the sandbox environment.