Conversation
viyatb-oai
approved these changes
Jun 2, 2026
Collaborator
viyatb-oai
left a comment
There was a problem hiding this comment.
Looks good overall. Please add an additional regression test for inherited :slash_tmp. The new test covers :tmpdir, but would still pass if the parser branch at codex-rs/core/src/config/permissions.rs:787 vanished, silently dropping /tmp writes from profiles extending :workspace.
d965c89 to
e287f53
Compare
viyatb-oai
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
Permission profiles that extend a built-in profile should behave like other TOML inheritance: parent entries provide defaults, and child keys override matching fields before the profile is compiled.
That was not true for
:workspace. Previously, a profile withextends = ":workspace"seeded the compiled runtimePermissionProfile::workspace_write()policy and then appended child filesystem entries. A child override such as":tmpdir" = "read"therefore left the inherited":tmpdir" = "write"entry in the final policy. Since same-targetwritewins overreadduring runtime resolution, the child override was ineffective.This also needs a clear source of truth for the built-in profiles. The protocol-level sandbox policy constructors now define the raw built-in filesystem entries, and both
PermissionProfilepresets and config-profile inheritance derive from those same values.What Changed
FileSystemSandboxPolicy::read_only()constructor while keeping the read-only and workspace-write raw filesystem entries explicit and independent.PermissionProfile::read_only()fromFileSystemSandboxPolicy::read_only();PermissionProfile::workspace_write()continues to derive fromFileSystemSandboxPolicy::workspace_write().:read-onlyand:workspaceparent profiles by projecting those canonical sandbox policies intoPermissionProfileToml, then merge user overrides at the TOML layer before compilation.:slash_tmpso the built-in:workspaceparent can be expressed in the same TOML-shaped filesystem table as user profiles.PermissionsToml::resolve_profile()returns an already-mergedPermissionProfileToml, and return that profile directly after removing the resolved-profile wrapper.extends = ":workspace"to assert that inherited":slash_tmp" = "write"is preserved and that a child":tmpdir" = "read"entry replaces the inheritedwriteentry.Verification
just test -p codex-configjust test -p codex-protocoljust test -p codex-core permissions_profiles_resolve_extends_parent_first_with_child_overridesjust test -p codex-core default_permissions_profile_can_extend_builtin_workspacejust test -p codex-coresuite::user_shell_cmd::user_shell_command_does_not_set_network_sandbox_env_var,suite::user_shell_cmd::user_shell_command_history_is_persisted_and_shared_with_model,suite::abort_tasks::interrupt_persists_turn_aborted_marker_in_next_request,suite::abort_tasks::interrupt_tool_records_history_entries, andthread_manager::tests::start_thread_uses_all_default_environments_from_codex_home.