Skip to content

Enforce application network policy in standalone MCP commands - #52215

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/f91401b51d6e6b9472bb01838f0d0903f83d62f3
Oct 8, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/f91401b51d6e6b9472bb01838f0d0903f83d62f3

Conversation

@copyberry

@copyberry copyberry Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Enforce application network policy in standalone MCP commands

Why

Standalone MCP commands must honor application.network restrictions during OAuth discovery and login, even when the MCP server is allowed by its identity requirements.

What changed

  • Apply local network policy to cloud configuration bootstrap authentication and activate the effective policy on the loaded CLI configuration.
  • Load codex mcp add through the shared cloud configuration loader and use its resolved codex_home when saving server configuration.
  • Block disallowed OAuth discovery requests before connecting while preserving the ability to save a server when discovery is unavailable.

Testing

Add isolated regression tests for blocked MCP discovery and login, discovery with network policy disabled, allowed and denied HTTPS destinations, and rejection of malformed managed network policy. Connection checks verify that denied requests never reach a TCP listener.

## Why

Standalone MCP commands must honor `application.network` restrictions during OAuth discovery and login, even when the MCP server is allowed by its identity requirements.

## What changed

- Apply local network policy to cloud configuration bootstrap authentication and activate the effective policy on the loaded CLI configuration.
- Load `codex mcp add` through the shared cloud configuration loader and use its resolved `codex_home` when saving server configuration.
- Block disallowed OAuth discovery requests before connecting while preserving the ability to save a server when discovery is unavailable.

## Testing

Add isolated regression tests for blocked MCP discovery and login, discovery with network policy disabled, allowed and denied HTTPS destinations, and rejection of malformed managed network policy. Connection checks verify that denied requests never reach a TCP listener.

GitOrigin-RevId: f91401b51d6e6b9472bb01838f0d0903f83d62f3
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Note

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/f91401b51d6e6b9472bb01838f0d0903f83d62f3 branch from 58cbc91 to 79773e8 Compare October 8, 2026 18:22
@copyberry
copyberry Bot merged commit 79773e8 into main Oct 8, 2026
1 check failed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/f91401b51d6e6b9472bb01838f0d0903f83d62f3 branch October 8, 2026 18:22
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 8, 2026
@EffeHubben
EffeHubben deployed to issue-triage October 8, 2026 18:29 — with Image GitHub Actions Active
@EffeHubben
EffeHubben deployed to issue-triage October 8, 2026 18:29 — with Image GitHub Actions Active
@EffeHubben
EffeHubben deployed to issue-triage October 8, 2026 18:29 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 18:29 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 18:29 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 18:29 — with Image GitHub Actions Active
@COOLak
COOLak deployed to issue-triage October 8, 2026 18:30 — with Image GitHub Actions Active
@ddk78ddk
ddk78ddk deployed to issue-triage October 8, 2026 18:36 — with Image GitHub Actions Active
@ddk78ddk
ddk78ddk deployed to issue-triage October 8, 2026 18:36 — with Image GitHub Actions Active
@ddk78ddk
ddk78ddk deployed to issue-triage October 8, 2026 18:36 — with Image GitHub Actions Active
@ddk78ddk
ddk78ddk deployed to issue-triage October 8, 2026 18:37 — with Image GitHub Actions Active

This branch was successfully deployed

1 active deployment
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.

5 participants