core-agent-ide/codex-rs/cli/src
Michael Bolin a4cc1a4a85
feat: introduce Permissions (#11633)
## Why
We currently carry multiple permission-related concepts directly on
`Config` for shell/unified-exec behavior (`approval_policy`,
`sandbox_policy`, `network`, `shell_environment_policy`,
`windows_sandbox_mode`).

Consolidating these into one in-memory struct makes permission handling
easier to reason about and sets up the next step: supporting named
permission profiles (`[permissions.PROFILE_NAME]`) without changing
behavior now.

This change is mostly mechanical: it updates existing callsites to go
through `config.permissions`, but it does not yet refactor those
callsites to take a single `Permissions` value in places where multiple
permission fields are still threaded separately.

This PR intentionally **does not** change the on-disk `config.toml`
format yet and keeps compatibility with legacy config keys.

## What Changed
- Introduced `Permissions` in `core/src/config/mod.rs`.
- Added `Config::permissions` and moved effective runtime permission
fields under it:
  - `approval_policy`
  - `sandbox_policy`
  - `network`
  - `shell_environment_policy`
  - `windows_sandbox_mode`
- Updated config loading/building so these effective values are still
derived from the same existing config inputs and constraints.
- Updated Windows sandbox helpers/resolution to read/write via
`permissions`.
- Threaded the new field through all permission consumers across core
runtime, app-server, CLI/exec, TUI, and sandbox summary code.
- Updated affected tests to reference `config.permissions.*`.
- Renamed the struct/field from
`EffectivePermissions`/`effective_permissions` to
`Permissions`/`permissions` and aligned variable naming accordingly.

## Verification
- `just fix -p codex-core -p codex-tui -p codex-cli -p codex-app-server
-p codex-exec -p codex-utils-sandbox-summary`
- `cargo build -p codex-core -p codex-tui -p codex-cli -p
codex-app-server -p codex-exec -p codex-utils-sandbox-summary`
2026-02-12 14:42:54 -08:00
..
debug_sandbox add codex debug seatbelt --log-denials (#4098) 2025-11-10 22:48:14 +00:00
desktop_app Add codex app macOS launcher (#10418) 2026-02-02 17:37:04 -08:00
app_cmd.rs Add codex app macOS launcher (#10418) 2026-02-02 17:37:04 -08:00
debug_sandbox.rs feat: introduce Permissions (#11633) 2026-02-12 14:42:54 -08:00
exit_status.rs feat: experimental env var: CODEX_SANDBOX_NETWORK_DISABLED (#879) 2025-05-09 18:29:34 -07:00
lib.rs feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
login.rs feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
main.rs Reapply "Add app-server transport layer with websocket support" (#11370) 2026-02-11 18:13:39 +00:00
mcp_cmd.rs feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
wsl_paths.rs Fix toasts on Windows under WSL 2 (#7137) 2025-12-11 15:09:00 -08:00