core-agent-ide/codex-rs/utils
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
..
absolute-path fix: Fix tilde expansion to avoid absolute-path escape (#9621) 2026-01-21 10:43:10 -08:00
approval-presets feat: make sandbox read access configurable with ReadOnlyAccess (#11387) 2026-02-11 18:31:14 -08:00
cache feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
cargo-bin feat: experimental flags (#10231) 2026-02-02 11:06:50 +00:00
cli chore(core) Deprecate approval_policy: on-failure (#11631) 2026-02-12 13:23:30 -08:00
elapsed feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
fuzzy-match feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
git feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
home-dir Validate CODEX_HOME before resolving (#10249) 2026-01-30 15:46:33 -08:00
image adding image support for gif and webp (#11237) 2026-02-09 14:47:22 -08:00
json-to-toml feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
oss feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
pty Fix flaky windows CI test (#10993) 2026-02-07 08:55:42 -08:00
readiness feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
rustls-provider chore: put crypto provider logic in a shared crate (#11294) 2026-02-10 01:04:31 -08:00
sandbox-summary feat: introduce Permissions (#11633) 2026-02-12 14:42:54 -08:00
sanitizer chore: drop and clean from phase 1 (#11605) 2026-02-12 17:23:00 +00:00
string Include real OS info in metrics. (#10425) 2026-02-05 06:30:31 -08:00