Skip to content

Constrain Windows sandbox requirements#23766

Merged
abhinav-oai merged 13 commits into
mainfrom
abhinav/windows-sandbox-requirements
May 29, 2026
Merged

Constrain Windows sandbox requirements#23766
abhinav-oai merged 13 commits into
mainfrom
abhinav/windows-sandbox-requirements

Conversation

@abhinav-oai
Copy link
Copy Markdown
Collaborator

@abhinav-oai abhinav-oai commented May 20, 2026

Why

Managed requirements can already constrain sandbox policy choices, but Windows sandbox implementation selection was still resolved independently from those requirements. That left the TUI able to continue through the unelevated fallback even when an organization wants to require the elevated Windows sandbox implementation.

What

  • Add [windows].allowed_sandbox_implementations requirements support for the Windows elevated and unelevated implementations.
  • Apply that allowlist during core config resolution so disallowed configured or feature-selected Windows sandbox implementations fall back to an allowed implementation with the existing requirements warning path.
  • Reuse the existing TUI Windows setup prompts to block disallowed unelevated continuation, keep required elevated setup in front of the user, and refuse to persist a TUI-selected Windows sandbox mode that requirements disallow.

Semantics

Allowed Selected Effective
["elevated"] unelevated / unset elevated
["unelevated"] elevated / unset unelevated
["elevated", "unelevated"] elevated elevated
["elevated", "unelevated"] unelevated unelevated
["elevated", "unelevated"] unset elevated

Availability is handled by interactive setup surfaces after allowlist resolution. If the effective elevated implementation is not ready, elevated-only requirements block on setup. When unelevated is also allowed, the UI may offer the existing unelevated fallback.

TUI Screens

If elevated setup is not already complete:

  Your organization requires the default Codex agent sandbox to continue. Set it up to protect your files and control
  network access.
  Learn more <https://developers.openai.com/codex/windows>

› 1. Set up default sandbox (requires Administrator permissions)
  2. Quit

If admin setup fails under ["elevated"]:

  Couldn't set up your sandbox with Administrator permissions

  Your organization requires the default sandbox before Codex can continue.
  Learn more <https://developers.openai.com/codex/windows>

› 1. Try setting up admin sandbox again
  2. Quit

Next Steps

  • extend the requirements/readout surface, such as configRequirements/read, so clients can inspect the loaded [windows].allowed_sandbox_implementations requirement instead of inferring it from Windows setup state
  • consider extending windowsSandbox/readiness as well
  • update the App startup guide, setup flow, and banner surfaces so an elevated-only requirement omits any continue-unelevated escape hatch and blocks startup until a permitted implementation is ready;
  • preserve the existing unelevated fallback path when requirements allow it, including the ["unelevated"] case where elevated is disallowed

@abhinav-oai abhinav-oai changed the title [codex] Constrain Windows sandbox requirements Constrain Windows sandbox requirements May 20, 2026
@abhinav-oai abhinav-oai force-pushed the abhinav/windows-sandbox-requirements branch 2 times, most recently from cecd93c to e5e02f8 Compare May 20, 2026 22:53
@abhinav-oai abhinav-oai force-pushed the abhinav/windows-sandbox-requirements branch from e5e02f8 to 3d81774 Compare May 20, 2026 23:12
@abhinav-oai abhinav-oai marked this pull request as ready for review May 21, 2026 21:53
@abhinav-oai abhinav-oai requested a review from a team as a code owner May 21, 2026 21:53
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0e6ca07486

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/lib.rs Outdated
Comment thread codex-rs/tui/src/app/event_dispatch.rs
Comment thread codex-rs/core/src/config/mod.rs Outdated
Comment thread codex-rs/tui/src/lib.rs Outdated
@abhinav-oai abhinav-oai force-pushed the abhinav/windows-sandbox-requirements branch from 5fb25b2 to 2c46222 Compare May 29, 2026 17:53
# Conflicts:
#	codex-rs/app-server/src/request_processors/windows_sandbox_processor.rs
#	codex-rs/tui/src/lib.rs
)
.await
.map_err(|err| config_load_error(&err))?;
let (mode, requested_mode) = match params.mode {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit, this looks like mode = current and requested_mode = new mode, but they are both the requested mode. maybe rename mode to something else

}))
}),
);
let (outgoing_tx, mut outgoing_rx) = tokio::sync::mpsc::channel(1);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lots of setup for this test. non-blocking but maybe consider more of a unit test that just tests the logic, without requiring tokio channels, an analyticseventsclient etc.

@abhinav-oai abhinav-oai merged commit a5a94ee into main May 29, 2026
31 checks passed
@abhinav-oai abhinav-oai deleted the abhinav/windows-sandbox-requirements branch May 29, 2026 23:31
@github-actions github-actions Bot locked and limited conversation to collaborators May 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants