Skip to content

clients: send permission profiles to app-server#18280

Open
bolinfest wants to merge 1 commit intopr18279from
pr18280
Open

clients: send permission profiles to app-server#18280
bolinfest wants to merge 1 commit intopr18279from
pr18280

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 17, 2026

Why

After app-server can accept PermissionProfile, first-party clients should stop preferring legacy sandbox fields when they have canonical permission information available. This keeps the migration moving without removing legacy compatibility yet.

What changed

This updates the exec and TUI app-server clients to send permissionProfile overrides derived from config, while preserving legacy sandbox fallback behavior when a profile is not available.

Verification

  • cargo test -p codex-tui permissions -- --nocapture
  • cargo test -p codex-core --test all permissions_messages -- --nocapture

Stack created with Sapling. Best reviewed with ReviewStack.

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad29119e25

ℹ️ 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".

Comment on lines +930 to +933
let permission_profile = permission_profile_override_from_config(config);
let sandbox = permission_profile
.is_none()
.then(|| sandbox_mode_from_policy(config.permissions.sandbox_policy.get().clone()))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Gate permission_profile overrides for remote app-server sessions

These lines always derive permission_profile from the local Config and then suppress sandbox, even when ThreadParamsMode::Remote is in use. In remote mode we already avoid forwarding local-only values like cwd/model_provider, but config.permissions.permission_profile() is runtime-expanded with local filesystem entries, so sending it to a remote app-server can apply client-local absolute paths and miss the server-side workspace carveouts it would normally derive. This affects thread/start, thread/resume, and thread/fork because they all share this override path.

Useful? React with 👍 / 👎.

@bolinfest bolinfest force-pushed the pr18280 branch 2 times, most recently from ee0a15a to a56ac61 Compare April 21, 2026 00:47
@bolinfest bolinfest force-pushed the pr18279 branch 2 times, most recently from 929878c to 69ab9eb Compare April 21, 2026 01:59
bolinfest added a commit that referenced this pull request Apr 21, 2026
## Why

#18274 made `PermissionProfile` the canonical file-system permissions
shape, but the round-trip from `FileSystemSandboxPolicy` to
`PermissionProfile` still dropped one piece of policy metadata:
`glob_scan_max_depth`.

That field is security-relevant for deny-read globs such as `**/*.env`.
On Linux, bubblewrap sandbox construction uses it to bound unreadable
glob expansion. If a profile copied from active runtime permissions
loses this value and is submitted back as an override, the resulting
`FileSystemSandboxPolicy` can behave differently even though the visible
permission entries look equivalent.

## What changed

- Add `glob_scan_max_depth` to protocol `FileSystemPermissions` and
preserve it when converting to/from `FileSystemSandboxPolicy`.
- Keep legacy `read`/`write` JSON for simple path-only permissions, but
force canonical JSON when glob scan depth is present so the metadata is
not silently dropped.
- Carry `globScanMaxDepth` through app-server
`AdditionalFileSystemPermissions`, generated JSON/TypeScript schemas,
and app-server/TUI conversion call sites.
- Preserve the metadata through sandboxing permission normalization,
merging, and intersection.
- Carry the merged scan depth into the effective
`FileSystemSandboxPolicy` used for command execution, so bounded
deny-read globs reach Linux bubblewrap materialization.

## Verification

- `cargo test -p codex-sandboxing glob_scan -- --nocapture`
- `cargo test -p codex-sandboxing policy_transforms -- --nocapture`
- `just fix -p codex-sandboxing`





---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/18713).
* #18288
* #18287
* #18286
* #18285
* #18284
* #18283
* #18282
* #18281
* #18280
* #18279
* #18278
* #18277
* #18276
* #18275
* __->__ #18713
@bolinfest bolinfest force-pushed the pr18279 branch 2 times, most recently from 3c66e19 to e99a496 Compare April 21, 2026 05:31
@bolinfest bolinfest force-pushed the pr18280 branch 2 times, most recently from 44c5e27 to ea8eb64 Compare April 21, 2026 06:10
@bolinfest bolinfest force-pushed the pr18279 branch 2 times, most recently from 1a9b5dc to 9d354ba Compare April 21, 2026 06:18
@bolinfest bolinfest force-pushed the pr18280 branch 2 times, most recently from ab0e270 to c013a96 Compare April 21, 2026 16:19
@bolinfest bolinfest force-pushed the pr18279 branch 2 times, most recently from 0d7a36c to c897233 Compare April 21, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant