feat: add --dangerously-bypass-approvals-and-sandbox (#1384)
This PR reworks `assess_command_safety()` so that the combination of `AskForApproval::Never` and `SandboxPolicy::DangerFullAccess` ensures that commands are run without _any_ sandbox and the user should never be prompted. In turn, it adds support for a new `--dangerously-bypass-approvals-and-sandbox` flag (that cannot be used with `--approval-policy` or `--full-auto`) that sets both of those options. Fixes https://github.com/openai/codex/issues/1254
This commit is contained in:
@@ -51,6 +51,11 @@ pub fn run_main(cli: Cli, codex_linux_sandbox_exe: Option<PathBuf>) -> std::io::
|
||||
Some(SandboxPolicy::new_workspace_write_policy()),
|
||||
Some(AskForApproval::OnFailure),
|
||||
)
|
||||
} else if cli.dangerously_bypass_approvals_and_sandbox {
|
||||
(
|
||||
Some(SandboxPolicy::DangerFullAccess),
|
||||
Some(AskForApproval::Never),
|
||||
)
|
||||
} else {
|
||||
let sandbox_policy = None;
|
||||
(sandbox_policy, cli.approval_policy.map(Into::into))
|
||||
|
||||
Reference in New Issue
Block a user