mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
## Why Forced `rm` commands can appear inside complex shell syntax or use option and wrapper variants that the existing dangerous-command heuristic does not recognize. ## What changed - Detect literal forced `rm` invocations in control flow, substitutions, pipelines, traps, nested shells, and `sudo` or `env` wrappers. - Recognize combined, separate, and long-form force options, including when they follow operands. - Require approval for these commands, or reject them with a safer-alternative explanation when approvals are disabled, even when the sandbox is disabled. - Preserve existing rejection reasons for other dangerous commands and explicit policy rules. ## Testing Add unit, policy, and end-to-end coverage for forced `rm` variants, complex shell scripts, approval requests, and rejection messages. GitOrigin-RevId: e1fabc55324e788bae00ab24aae50d089eb7b058