Skip to content

feat(connectors): support managed app tool approval requirements#21061

Merged
viyatb-oai merged 7 commits into
mainfrom
codex/viyatb/managed-app-tool-requirements
May 11, 2026
Merged

feat(connectors): support managed app tool approval requirements#21061
viyatb-oai merged 7 commits into
mainfrom
codex/viyatb/managed-app-tool-requirements

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

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

Why

Managed requirements can already centrally disable apps, but they could not express the per-tool app approval rules that normal config already supports. That left admins without a way to enforce connector tool approvals through /etc/codex/requirements.toml or cloud requirements.

What changed

  • Extend app requirements with per-tool approval_mode entries.
  • Merge managed app tool requirements across managed sources while preserving higher-precedence exact tool settings.
  • Apply managed tool approvals separately from user app config so managed policy is matched only on raw MCP tool.name, while user config keeps the existing raw-name-then-title convenience fallback.
  • Add coverage for local requirements, cloud requirements parsing, managed-over-user precedence, and a title-collision case that must not widen managed auto-approval.

Configuration shape

Local /etc/codex/requirements.toml and cloud requirements use the same TOML shape:

[apps.connector_123123.tools."calendar/list_events"]
approval_mode = "approve"

This is a per-tool approval rule keyed by app ID and raw MCP tool name, not an app-level boolean such as apps.connector_123123.approve = true.

viyatb-oai added 3 commits May 4, 2026 11:59
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 requested a review from mzeng-openai May 4, 2026 19:16
@viyatb-oai viyatb-oai marked this pull request as ready for review May 4, 2026 19:16
@viyatb-oai viyatb-oai requested a review from a team as a code owner May 4, 2026 19:16
Comment thread codex-rs/core/src/connectors.rs Outdated
Co-authored-by: Codex noreply@openai.com
@viyatb-oai viyatb-oai changed the title [codex] support managed app tool approval requirements feat(connectors): support managed app tool approval requirements May 5, 2026
@viyatb-oai viyatb-oai requested a review from mzeng-openai May 5, 2026 17:55
Comment thread codex-rs/core/src/connectors_tests.rs
@viyatb-oai viyatb-oai enabled auto-merge (squash) May 7, 2026 07:29
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.

Something that I don't see referenced in this PR is the use of Constrained. Parsing requirements.toml and ensuring the appropriate values get creation is relatively easy, but ensuring that someone doesn't mutate that value later in a way that is disallowed by requirements.toml later is much harder. This is why we have Constrained<T> and it appears to me that we should be using it for the approval field.

Comment thread codex-rs/core/src/connectors.rs Outdated
Co-authored-by: Codex noreply@openai.com
@bolinfest bolinfest self-requested a review May 11, 2026 18:26
@viyatb-oai viyatb-oai merged commit d0fa2d8 into main May 11, 2026
37 of 38 checks passed
@viyatb-oai viyatb-oai deleted the codex/viyatb/managed-app-tool-requirements branch May 11, 2026 19:08
@github-actions github-actions Bot locked and limited conversation to collaborators May 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants