Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Auto-approve DangerFullAccess patches on non-sandboxed platforms (#2988)

Sing3030e827b6598d2
diff --git a/codex-rs/core/src/safety.rs b/codex-rs/core/src/safety.rs
index 752177ed01..790267f55a 100644
--- a/codex-rs/core/src/safety.rs
+++ b/codex-rs/core/src/safety.rs
@@ -53,6 +53,13 @@ pub fn assess_patch_safety(
// paths outside the project.
match get_platform_sandbox() {
Some(sandbox_type) => SafetyCheck::AutoApprove { sandbox_type },
+ None if sandbox_policy == &SandboxPolicy::DangerFullAccess => {
+ // If the user has explicitly requested DangerFullAccess, then
+ // we can auto-approve even without a sandbox.
+ SafetyCheck::AutoApprove {
+ sandbox_type: SandboxType::None,
+ }
+ }
None => SafetyCheck::AskUser,
}
} else if policy == AskForApproval::Never {