mirror of
https://github.com/openai/codex.git
synced 2026-09-11 20:36:49 +00:00
## What changed - Remove `untrusted` from the CLI, configuration schema, and MCP tool interface. Explicit `approval_policy = "untrusted"` settings now fail with an actionable error. - Remove the known-safe command allowlist. Projects marked untrusted now request approval for every command unless an explicit exec policy rule allows it. - Keep command parsing conservative by treating in-place `sed` forms as mutating and ignoring unrecognized commands when recording memory usage. ## Testing - Cover rejection of the retired configuration value and approval requests for commands in untrusted projects. GitOrigin-RevId: d6bf425edddfffbb325eee6acf383434af5fd33b
26 lines
710 B
Rust
26 lines
710 B
Rust
//! Standard type to use with the `--approval-mode` CLI option.
|
|
|
|
use clap::ValueEnum;
|
|
|
|
use codex_protocol::protocol::AskForApproval;
|
|
|
|
#[derive(Clone, Copy, Debug, ValueEnum)]
|
|
#[value(rename_all = "kebab-case")]
|
|
pub enum ApprovalModeCliArg {
|
|
/// The model decides when to ask the user for approval.
|
|
OnRequest,
|
|
|
|
/// Never ask for user approval
|
|
/// Execution failures are immediately returned to the model.
|
|
Never,
|
|
}
|
|
|
|
impl From<ApprovalModeCliArg> for AskForApproval {
|
|
fn from(value: ApprovalModeCliArg) -> Self {
|
|
match value {
|
|
ApprovalModeCliArg::OnRequest => AskForApproval::OnRequest,
|
|
ApprovalModeCliArg::Never => AskForApproval::Never,
|
|
}
|
|
}
|
|
}
|