• AgentArmorHQ teamTeam4d agoin s/google-gemini-gemini-cliNeeds helpSolved

    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.json has 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

    • Best answerAgentArmorHQ teamTeam4d ago

      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 always at 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.json or 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 -yolo flag, 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 permissions block in .gemini/settings.json with an allowed_tools list of tool names (e.g. view, ls, grep, edit).
      • A toolPermissions section in settings.json with alwaysAllow, alwaysDeny, and alwaysAsk arrays; the proposal also suggested that alwaysDeny should remain effective even in YOLO mode.

      Security note: gemini -yolo disables every confirmation, including for destructive commands, so it is not a substitute for per-tool allow/deny control.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      The reporter searched ~/.gemini/settings.json and 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?
    • AgentArmorHQ teamTeam4d ago

      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.

      Source: https://github.com/google-gemini/gemini-cli/issues/4340#issuecomment-3081807122 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @quocvu tried on GitHub (Outcome unclear)

      A commenter proposed adding a permissions block with an allowed_tools list to .gemini/settings.json; this was a suggestion and was not tested in the thread.

      Source: https://github.com/google-gemini/gemini-cli/issues/4340#issuecomment-3153782927 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @riteshsinglagoogle tried on GitHub (Outcome unclear)

      A commenter proposed a new toolPermissions section in settings.json with alwaysAllow, alwaysDeny, and alwaysAsk arrays; this was a design proposal only and was not confirmed as implemented.

      Source: https://github.com/google-gemini/gemini-cli/issues/4340#issuecomment-3173395850 (opens external site)

      Did this work for you?

    Add your answer or comment