Skip to content

app-server: expose thread permission profiles#18278

Open
bolinfest wants to merge 1 commit intopr18277from
pr18278
Open

app-server: expose thread permission profiles#18278
bolinfest wants to merge 1 commit intopr18277from
pr18278

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 17, 2026

Why

App-server clients need a canonical view of the permissions that are active for a thread. Returning only legacy sandbox fields forces clients to keep interpreting SandboxPolicy even after core can derive a constrained PermissionProfile.

What changed

This adds the app-server v2 PermissionProfile API shape, includes permissionProfile in thread start/resume/fork responses, populates it from the config snapshot, and regenerates the TypeScript and JSON schema fixtures.

Verification

  • cargo test -p codex-app-server-protocol permission -- --nocapture
  • cargo test -p codex-tui permissions -- --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: afb44ee779

ℹ️ 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 2964 to 2966
pub sandbox: SandboxPolicy,
pub permission_profile: PermissionProfile,
pub reasoning_effort: Option<ReasoningEffort>,
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 Keep thread response deserialization tolerant of missing profile

Adding permission_profile as a required field makes ThreadStartResponse/ThreadResumeResponse/ThreadForkResponse fail to deserialize when that field is absent, which breaks mixed-version clients and any stored payloads from older servers that predate this field. Existing lifecycle parsing paths intentionally tolerate some missing response fields, so this strict requirement is a wire-compatibility regression unless permission_profile is given a default (or made optional) during deserialization.

Useful? React with 👍 / 👎.

@bolinfest bolinfest force-pushed the pr18278 branch 2 times, most recently from 11e76d0 to 880130c 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 pr18277 branch 2 times, most recently from 31d1b49 to ef231cf Compare April 21, 2026 05:15
@bolinfest bolinfest force-pushed the pr18278 branch 2 times, most recently from 4b6f600 to 50a4ca2 Compare April 21, 2026 05:49
@bolinfest bolinfest force-pushed the pr18277 branch 2 times, most recently from 5ae72d8 to 8618f64 Compare April 21, 2026 06:18
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