feat: add support for /etc/codex/requirements.toml on UNIX #8277
+186
−16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.tomlwith:to enforce that
Config.approval_policymust 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.tomlin short order.Note that requirements can come from several sources:
/etc/codex/requirements.tomlcom.openai.codex/config_toml_base64)/etc/codex/managed_config.tomlSo 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().