Skip to content

feat: support managed permission profiles in requirements.toml#23433

Merged
bolinfest merged 7 commits into
mainfrom
codex/viyatb/requirements-permissions
May 21, 2026
Merged

feat: support managed permission profiles in requirements.toml#23433
bolinfest merged 7 commits into
mainfrom
codex/viyatb/requirements-permissions

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

@viyatb-oai viyatb-oai commented May 19, 2026

Why

Cloud-managed requirements.toml should be able to define the managed permission profiles a client may select and constrain that selectable set without requiring local user config to recreate the profile catalog.

This keeps requirements focused on restrictions. The selected default remains a config or session choice, while requirements contribute the managed profile bodies and allowed_permissions allowlist that the config-loading boundary validates before a resolved runtime PermissionProfile is installed.

What changed

  • Add requirements.toml support for a managed permission-profile catalog plus its allowlist:
allowed_permissions = ["review", "build"]

[permissions.review]
extends = ":read-only"

[permissions.build]
extends = ":workspace"
  • Merge requirements-defined profile bodies into the effective permission catalog and reject profile ids that collide with config-defined profiles.
  • Validate that every allowed_permissions entry resolves to a built-in or catalog profile before selection uses it.
  • Preserve allowed configured named-profile selections. When a configured named profile is disallowed, fall back to the first allowed requirements profile with a startup warning.
  • Keep built-in selections and the stock trust-based :read-only / :workspace fallback path intact when no permission profile is explicitly selected.
  • Centralize the managed catalog and allowlist selection path in EffectivePermissionSelection so the requirements boundary is visible in config loading.
  • Surface allowedPermissions through configRequirements/read, and update the generated app-server schema fixtures plus the app-server README.

Validation

  • cargo test -p codex-config
  • cargo test -p codex-core system_requirements_
  • cargo test -p codex-core system_allowed_permissions_
  • cargo test -p codex-app-server-protocol
  • just write-app-server-schema

Related work

@viyatb-oai viyatb-oai requested a review from a team as a code owner May 19, 2026 05:57
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: 2525dd0355

ℹ️ 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 thread codex-rs/core/src/config/mod.rs Outdated
Comment thread codex-rs/core/src/config/mod.rs Outdated
Comment thread codex-rs/core/src/config/mod.rs Outdated
Comment thread codex-rs/config/src/config_requirements.rs
Comment thread codex-rs/config/src/config_requirements.rs Outdated
Comment thread codex-rs/config/src/config_requirements.rs
Comment thread codex-rs/core/src/config/mod.rs
@viyatb-oai viyatb-oai changed the title Support managed permissions in requirements.toml feat: support managed permissions in requirements.toml May 20, 2026
@viyatb-oai viyatb-oai force-pushed the codex/viyatb/requirements-permissions branch from 993dc86 to 1451511 Compare May 20, 2026 01:57
@viyatb-oai viyatb-oai changed the title feat: support managed permissions in requirements.toml feat: support managed permission profiles in requirements.toml May 20, 2026
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

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

I will finish this review tomorrow!

Comment thread codex-rs/config/src/config_requirements.rs
Comment thread codex-rs/config/src/config_requirements.rs
Comment thread codex-rs/app-server-protocol/src/protocol/v2/config.rs Outdated
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
@viyatb-oai viyatb-oai force-pushed the codex/viyatb/requirements-permissions branch from 3d59efc to e0073d2 Compare May 20, 2026 21:58
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
@bolinfest bolinfest self-requested a review May 20, 2026 23:39
@bolinfest bolinfest merged commit 713a5b1 into main May 21, 2026
43 of 47 checks passed
@bolinfest bolinfest deleted the codex/viyatb/requirements-permissions branch May 21, 2026 00:33
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants