Skip to content

Bind declared Codex MCP servers after workspace trust - #776

Merged
SaladDay merged 1 commit into
mainfrom
bind-declared-codex-mcp-servers-after-workspace-trust
Oct 19, 2026
Merged

SaladDay merged 1 commit into
mainfrom
bind-declared-codex-mcp-servers-after-workspace-trust

Conversation

@SaladDay

@SaladDay SaladDay commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Codex now loads the workspace's native project configuration, as a local run does, and verifies the declared MCP servers against the configuration the native thread actually uses.

  • Before config/read, the adapter writes the native trust entry for the workspace project ([projects."<root>"] trust_level = "trusted", keyed like native: symlinks resolved, git root when there is one). Natively, thread/start under danger-full-access trusts a cwd-bound project anyway, so preparation used to verify an untrusted snapshot while the thread loaded the workspace's .codex/config.toml: a workspace could redefine a declared server after the check. The verified snapshot now equals the one thread/start and thread/resume use, and a workspace redefinition of a declared server fails start and cold resume.
  • Workspace and operator MCP servers beside the declared ones are admitted, and features.plugins and features.apps keep their native values. The checks that required exactly the declared servers and forced those features off are removed; they ran against the pre-trust snapshot.
  • default_tools_approval_mode = "approve" is removed: with approval_policy = never and danger-full-access, native already auto-approves MCP tool calls.
  • The Runtime's MCP secret variables (OAC_RUNTIME_MCP_*) join the provider key in shell_environment_policy.exclude, so native shells do not inherit them.

Docs: execution-tools.md with zh mirror, the Codex adapter README.

Tests: unit tests for the trust entry, binding verification and shell exclusion, and a gated native test against the pinned Codex 0.153.4 binary: workspace project config loads on start and cold resume, an extra workspace server is admitted, plugins and apps stay native, and a workspace redefinition of the declared server's URL fails start and resume. Reverting the trust write makes that test fail.

The independent review found no defects introduced by this change. It noted one existing exposure that this change does not alter: workspace configuration can reference the provider key's environment variable. That stays within the accepted workspace-trust risk in model-execution.md#session-override.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@SaladDay
SaladDay merged commit 44b4ded into main Oct 19, 2026
21 checks passed
@SaladDay
SaladDay deleted the bind-declared-codex-mcp-servers-after-workspace-trust branch October 19, 2026 09:14
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