Skip to content

Conversation

@bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Dec 18, 2025

This implements the new config design where config requirements are loaded separately (and with a special schema) as compared to config settings. In particular, on UNIX, with this PR, you could define /etc/codex/requirements.toml with:

allowed_approval_policies = ["never", "on-request"]

to enforce that Config.approval_policy must be one of those two values when Codex runs.

We plan to expand the set of things that can be restricted by /etc/codex/requirements.toml in short order.

Note that requirements can come from several sources:

  • new MDM key on macOS (not implemented yet)
  • /etc/codex/requirements.toml
  • re-interpretation of legacy MDM key on macOS (com.openai.codex/config_toml_base64)
  • re-interpretation of legacy /etc/codex/managed_config.toml

So our resolution strategy is to load TOML data from those sources, in order. Later TOMLs are "merged" into previous TOMLs, but any field that is already set cannot be overwritten. See ConfigRequirementsToml::merge_unset_fields().


/// If available, apply requirements from `/etc/codex/requirements.toml` to
/// `config_requirements_toml` by filling in any unset fields.
async fn load_requirements_toml(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Side note: we should also consider (and I think we are) exposing requirements config in CLI and app-server to show only available options (i.e. sandbox policies).

@bolinfest bolinfest merged commit 2f048f2 into main Dec 18, 2025
50 of 52 checks passed
@bolinfest bolinfest deleted the pr8277 branch December 18, 2025 21:36
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2025
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.

3 participants