Files
gemini-cli/packages
Spencer 883f265234 feat(core): restrict auto-approve checkbox to safe commands
Hide the "Allow for all future sessions" checkbox during exec tool
confirmation unless every command in the input passes a strict allowlist.

- Introduce safeCommandAllowlist for read-only utilities (ls, cat, grep, etc.)
- Introduce editCommandAllowlist for file-mutating commands, gated behind
  ApprovalMode.AUTO_EDIT
- Use getCommandRoots (Wasm parser) to extract all base executables from
  piped, chained, and wrapped commands
- Fail closed: hide checkbox if parser fails or any command root is unknown
- Exclude find/awk/sed from safe list (can execute arbitrary commands)

Ref: google-gemini/maintainers-gemini-cli#1578
2026-03-19 06:06:12 +00:00
..