Skip to content

Grant sandbox users access to desktop runtime bin#21564

Merged
iceweasel-oai merged 1 commit into
mainfrom
codex/windows-runtime-bin-acl
May 7, 2026
Merged

Grant sandbox users access to desktop runtime bin#21564
iceweasel-oai merged 1 commit into
mainfrom
codex/windows-runtime-bin-acl

Conversation

@iceweasel-oai
Copy link
Copy Markdown
Collaborator

Why

Codex desktop copies bundled Windows binaries out of WindowsApps into a LocalAppData runtime cache before launching codex.exe. Sandboxed commands can then need to execute helpers from that cache, but the sandbox user group may not have read/execute access to the runtime bin directory.

This makes the Windows sandbox refresh path repair that access directly so the packaged desktop runtime remains usable from sandboxed sessions.

What changed

  • Added setup_runtime_bin to locate %LOCALAPPDATA%\OpenAI\Codex\bin, matching the desktop bundled-binaries destination path, with the same USERPROFILE\AppData\Local fallback shape.
  • During refresh setup, check whether CodexSandboxUsers already has read/execute access to the runtime bin directory.
  • If access is missing, grant CodexSandboxUsers OI/CI/RX inheritance on that directory.
  • If the runtime bin directory does not exist, no-op cleanly.

Verification

  • cargo build -p codex-windows-sandbox --bin codex-windows-sandbox-setup
  • cargo test -p codex-windows-sandbox --bin codex-windows-sandbox-setup
  • Manual Windows ACL exercise against the installed packaged runtime bin:
    • existing inherited CodexSandboxUsers:(I)(OI)(CI)(RX) no-ops without changing SDDL
    • after disabling inheritance and removing the group ACE, setup adds CodexSandboxUsers:(OI)(CI)(RX)
    • with LOCALAPPDATA pointed at a fake location without OpenAI\Codex\bin, setup exits successfully and does not create the directory
    • restored the real runtime bin with inherited ACLs and confirmed the final SDDL matched the baseline exactly

@iceweasel-oai iceweasel-oai force-pushed the codex/windows-runtime-bin-acl branch from 20a80e1 to c428356 Compare May 7, 2026 17:31
Copy link
Copy Markdown

@johnl-oai johnl-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome

@iceweasel-oai iceweasel-oai merged commit 163eac9 into main May 7, 2026
26 checks passed
@iceweasel-oai iceweasel-oai deleted the codex/windows-runtime-bin-acl branch May 7, 2026 18:38
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants