feat(permissions): support inheritable permissions profiles#22270
feat(permissions): support inheritable permissions profiles#22270viyatb-oai wants to merge 6 commits into
Conversation
6d6f15c to
b129da1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a8a8ed4dff
ℹ️ 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".
| ) { | ||
| let parsed = network_tables_from_toml(&layer.config)?; | ||
| merge_toml_values(&mut merged, &layer.config); | ||
| let parsed = network_tables_from_toml(&merged)?; |
There was a problem hiding this comment.
Recompute proxy config when the selected profile changes
When a higher-precedence layer changes default_permissions to a profile with no network table (or to a built-in profile), selected_network_from_tables returns None, so the subsequent apply leaves any domains/proxy options that were already applied from a lower-precedence selected profile in config. Since this loop now parses the cumulative merged config on each iteration, the effective proxy policy can retain a lower-layer allowlist even though the final merged default_permissions no longer selects that profile; compute/apply from the final merged config, or reset the mutable proxy config before applying each cumulative selection.
Useful? React with 👍 / 👎.
Co-authored-by: Codex noreply@openai.com
a8a8ed4 to
c2cd30a
Compare
Why
Named permission profiles need a reuse mechanism so we can define a shared base once, then specialize it without copying large filesystem and network tables. The motivating case is a profile that keeps Codex's canonical workspace sandbox behavior while opting into additional policy, for example:
That should inherit the real built-in
:workspacebehavior rather than a hand-maintained approximation.What changed
extendsto[permissions.<profile>]entries and resolve inherited profiles parent-first with child overrides.:workspaceprofile while preserving its runtime semantics before layering child overrides.default_permissionsselections consistently with the main config path.extendsmetadata through the active-profile protocol types and refresh the config schema.Relevant implementation areas:
codex-rs/config/src/permissions_toml.rscodex-rs/core/src/config/permissions.rscodex-rs/core/src/network_proxy_loader.rsVerification
cargo test -p codex-configcargo test -p codex-core permissions_profiles_cargo test -p codex-core config_from_layers_resolves_inherited_profiles_across_layerscargo test -p codex-core selected_network_from_tables_cargo test -p codex-core default_permissions_profile_can_extend_builtin_workspacecargo test -p codex-core selected_network_from_tables_resolves_builtin_workspace_parentDocumentation
The Codex permissions docs on developers.openai.com should be updated alongside rollout to describe profile inheritance and
extends = ":workspace".