Gemini CLI: tool "always" approval not persisting across terminal sessions?
Using the Google Gemini CLI (google-gemini/gemini-cli, July 2025) on Pop!_OS Linux with the fish shell, I select "always" at tool approval prompts (e.g. run_shell_command, write_file, showing
Approve? (y/n/always)), but every new terminal session asks for approval again.~/.gemini/settings.jsonhas no persistence option and the docs are silent. How do I make tool permissions persist across sessions, or is there a supported workaround?Originally asked on GitHub: https://github.com/google-gemini/gemini-cli/issues/4340
5 answers
The issue was closed as NOT_PLANNED, and a contributor flagged it as a duplicate of a broader permissions issue (#2417). The thread does not confirm any implemented setting for persisting tool approvals; the reported behavior is that choosing
alwaysat a prompt (e.g.Approve? (y/n/always)) only applies for that terminal session, and a new session prompts again. The reporter also found no related option in~/.gemini/settings.jsonor in the repository docs (GEMINI.md, README.md, docs/cli/configuration.md, docs/troubleshooting.md, docs/sandbox.md, docs/index.md).The only workaround mentioned is launching the CLI with the
gemini -yoloflag, which skips all approval prompts for that session. It is all-or-nothing, and commenters expressed safety concerns; one commenter called it "a fast track to rm -rf /".Two community proposals were made for per-tool control, but the thread does not confirm either is implemented:
- A
permissionsblock in.gemini/settings.jsonwith anallowed_toolslist of tool names (e.g.view,ls,grep,edit). - A
toolPermissionssection insettings.jsonwithalwaysAllow,alwaysDeny, andalwaysAskarrays; the proposal also suggested thatalwaysDenyshould remain effective even in YOLO mode.
Security note:
gemini -yolodisables every confirmation, including for destructive commands, so it is not a substitute for per-tool allow/deny control.Did this work for you?- A
What a GitHub user tried on GitHub (Didn't work)
The reporter searched
~/.gemini/settings.jsonand the repository documentation (GEMINI.md, README.md, docs/cli/configuration.md, docs/troubleshooting.md, docs/sandbox.md, docs/index.md) for a persistence setting and found none.Source: https://github.com/google-gemini/gemini-cli/issues/4340 (opens external site)
Did this work for you?What @SkybuckFlying tried on GitHub (Outcome unclear)
A commenter mentioned a startup YOLO mode flag,
gemini -yolo, that bypasses approval prompts, but said they keep forgetting it and have not actually used it.Did this work for you?What @quocvu tried on GitHub (Outcome unclear)
A commenter proposed adding a
permissionsblock with anallowed_toolslist to.gemini/settings.json; this was a suggestion and was not tested in the thread.Did this work for you?What @riteshsinglagoogle tried on GitHub (Outcome unclear)
A commenter proposed a new
toolPermissionssection insettings.jsonwithalwaysAllow,alwaysDeny, andalwaysAskarrays; this was a design proposal only and was not confirmed as implemented.Did this work for you?
Related questions
- gemini-cli 400: "only 'enum' and 'date-time' are supported for STRING type"
- Gemini CLI: API Error 'Model stream ended with an invalid chunk or missing finish reason' after ReadFile or Edit tool calls
- gemini-cli stuck on "This is taking a bit longer" after Esc cancel — is there a fix?
- Is there a way to get codebase indexing in gemini-cli?
- How can I use voice input instead of typing with Gemini CLI?