mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Enforce non-interactive approval policy for Codex delegates (#38205)
## What changed - Require delegated Codex sessions to use the `never` approval policy and reject delegate creation with any prompt-capable policy. - Stop forwarding delegate approval and permission requests to the parent session. Approval-requiring commands and MCP tool calls are denied within the delegate instead. - Skip prompts for missing skill MCP dependencies when approvals are disabled. ## Testing Add coverage for review and Guardian delegates to verify that command escalations, MCP approvals, and skill dependency installation do not prompt or execute approval-gated actions. GitOrigin-RevId: fee96a97624352cd25c904592ba7eebe2ae3fd63
This commit is contained in:
1 parent
3d7f9b4637
commit
95aada11c4
11 files changed
+483
-1199
No files matched your search
@@ -7,6 +7,7 @@ use codex_config::McpServerTransportConfig;
|
||||
use codex_config::load_global_mcp_servers;
|
||||
use codex_login::default_client::is_first_party_originator;
|
||||
use codex_login::default_client::originator;
|
||||
use codex_protocol::protocol::AskForApproval;
|
||||
use codex_protocol::request_user_input::RequestUserInputArgs;
|
||||
use codex_protocol::request_user_input::RequestUserInputQuestion;
|
||||
use codex_protocol::request_user_input::RequestUserInputQuestionOption;
|
||||
@@ -246,6 +247,10 @@ async fn should_install_mcp_dependencies(
|
||||
return true;
|
||||
}
|
||||
|
||||
if turn_context.approval_policy() == AskForApproval::Never {
|
||||
return false;
|
||||
}
|
||||
|
||||
let server_list = format_missing_mcp_dependencies(missing);
|
||||
let question = RequestUserInputQuestion {
|
||||
id: SKILL_MCP_DEPENDENCY_PROMPT_ID.to_string(),
|
||||
|
||||
Reference in new issue
Block a user