Skip to content

Add prompt-for-writes MCP tool approval mode#23778

Draft
kylepatel-oai wants to merge 1 commit into
mainfrom
dev/kylepatel/prompt-for-writes-mcp-approval
Draft

Add prompt-for-writes MCP tool approval mode#23778
kylepatel-oai wants to merge 1 commit into
mainfrom
dev/kylepatel/prompt-for-writes-mcp-approval

Conversation

@kylepatel-oai
Copy link
Copy Markdown

Summary

  • Add prompt_for_writes as a new MCP/app tool approval mode in config and app-server protocol schemas.
  • Runtime behavior: tools with explicit read_only_hint == Some(true) skip approval; all other calls use the normal MCP approval elicitation and bypass Guardian auto-review.
  • Preserve session and persistent approval keys for this mode so "allow in this chat" and "always allow" continue to work; persistent always-allow still writes a per-tool approval_mode = "approve" override.

Notes

  • The generated app-server protocol fixtures in this repo are updated.
  • I did not update codex-apps generated app-server-types in this PR: its mcp-codegen script currently uses the released dotslash Codex binary, while generating from this local runtime into a temp directory showed broad unrelated type churn. The runtime schema fixture here contains the new AppToolApproval value for downstream consumption.

Tests

  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p codex-core mcp_tool_call_tests (matches 0 tests with this filter)
  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p codex-core mcp_tool_call::tests
  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p codex-core config_schema
  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p codex-mcp prompt_for_writes
  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p codex-config
  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p codex-app-server-protocol
  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p codex-app-server config_manager_service_tests (matches 0 tests with this filter)
  • CARGO_NET_GIT_FETCH_WITH_CLI=true cargo test -p codex-app-server write_value_supports

@github-actions
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.

@kylepatel-oai kylepatel-oai force-pushed the dev/kylepatel/prompt-for-writes-mcp-approval branch from 4bff793 to cd7627d Compare May 20, 2026 23:54
@kylepatel-oai kylepatel-oai force-pushed the dev/kylepatel/prompt-for-writes-mcp-approval branch from cd7627d to 5e86a50 Compare May 21, 2026 00:02
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