Skip to content

feat(exec): Add --disable-builtin-tools flag for MCP-only mode - #5001

Closed
provencher wants to merge 3 commits into
openai:mainfrom
provencher:feat/exec-tool-control-flags
Closed

feat(exec): Add --disable-builtin-tools flag for MCP-only mode#5001
provencher wants to merge 3 commits into
openai:mainfrom
provencher:feat/exec-tool-control-flags

Conversation

@provencher

@provencher provencher commented Oct 9, 2025

Copy link
Copy Markdown

Summary

Adds a new --disable-builtin-tools CLI flag to codex exec that allows users to disable all built-in tools (shell, file operations, plan, apply_patch) while keeping MCP tools and web search available.

This is useful for running codex exec in headless mode with only custom MCP tools, enabling better control over the agent's capabilities.

Changes

  • Add --disable-builtin-tools CLI flag to exec
  • Thread flag through ConfigOverrides and Config
  • Update ToolsConfig to conditionally register built-in tools based on flag
  • Keep MCP tools, web_search, and view_image available when flag is set

Testing

Verified the flag works correctly:

  • With flag: Agent uses only MCP tools (no built-in shell/file tools)
  • Without flag: Agent has access to all built-in tools as normal

Built and tested successfully with both configurations.

This adds a new CLI flag that allows users to disable all built-in tools
(shell, file operations, plan, apply_patch) while keeping MCP tools and
web search available. This is useful for running codex exec in headless
mode with only custom MCP tools.

Changes:
- Add --disable-builtin-tools CLI flag to exec
- Thread flag through ConfigOverrides and Config
- Update ToolsConfig to conditionally register built-in tools
- Keep MCP tools, web_search, and view_image available

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@provencher

Copy link
Copy Markdown
Author

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

@provencher

Copy link
Copy Markdown
Author

recheck

github-actions Bot added a commit that referenced this pull request Oct 9, 2025
@amittell

Copy link
Copy Markdown

+1 on needing this flag

@etraut-openai

Copy link
Copy Markdown
Contributor

Thanks for the contribution, and apologies for the slow response. We've received many PRs, and we don't have the bandwidth on the codex team to review all of them.

We've updated our contribution guidelines to clarify that we're currently accepting contributions for bugs and security fixes, but we're not generally accepting new features at this time. We need to make sure that all new features compose well with both existing and upcoming features and fit into our roadmap. If you would like to propose a new feature, please file or upvote an enhancement request in the issue tracker. We will generally prioritize new features based on community feedback.

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 31, 2025
@openai openai unlocked this conversation Oct 31, 2025
@provencher

Copy link
Copy Markdown
Author

Thanks for the contribution, and apologies for the slow response. We've received many PRs, and we don't have the bandwidth on the codex team to review all of them.

We've updated our contribution guidelines to clarify that we're currently accepting contributions for bugs and security fixes, but we're not generally accepting new features at this time. We need to make sure that all new features compose well with both existing and upcoming features and fit into our roadmap. If you would like to propose a new feature, please file or upvote an enhancement request in the issue tracker. We will generally prioritize new features based on community feedback.

Really too bad that this was closed. I think it's a large omission that codex does not permit even disabling the shell execution, as it's a security risk in many cases.

I opened an issue to track the request
#6049 (comment)

youta7 added a commit to youta7/ta-codex that referenced this pull request Nov 10, 2025
swordfish444 pushed a commit to swordfish444/codex that referenced this pull request Feb 26, 2026
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.

3 participants