mirror of
https://github.com/openai/codex.git
synced 2026-11-14 21:40:39 +00:00
Require explicit project trust in non-interactive runs (#60041)
## What changed Keep untrusted project configuration and MCP servers disabled in exec runs, even with `--sandbox workspace-write`, and warn when project configuration is disabled. Add `--trust` to `codex exec` and `codex review` to save project trust for the current and future chats, including MCP commands outside the sandbox. The grant persists with `--ephemeral`, refuses explicitly untrusted projects, and cannot be combined with `--ignore-user-config`. Pass the working directory as a configuration default so embedded server startup does not implicitly grant trust. Preserve the selected `--oss` provider across configuration reloads. ## Testing Extend CLI parsing and MCP integration coverage for explicit trust, persistence across ephemeral runs, disabled project configuration with write access, and rejection of conflicting or explicitly untrusted settings. GitOrigin-RevId: b57f4f8829f98d77c5487fa8405c7f29b5d70d0c
This commit is contained in:
@@ -37,6 +37,11 @@ pub struct Cli {
|
||||
#[arg(long = "skip-git-repo-check", global = true, default_value_t = false)]
|
||||
pub skip_git_repo_check: bool,
|
||||
|
||||
/// Save trust for this project and future chats, including MCP commands outside the sandbox.
|
||||
/// Persists even with --ephemeral. Does not override an explicitly untrusted project.
|
||||
#[arg(long, global = true)]
|
||||
pub trust: bool,
|
||||
|
||||
/// Run without persisting session files to disk.
|
||||
#[arg(long = "ephemeral", global = true, default_value_t = false)]
|
||||
pub ephemeral: bool,
|
||||
|
||||
Reference in New Issue
Block a user