Replies: 2 comments
-
It's a good idea. I have to admit that the cognitive load between 3 and 4 options feels significant, but I wonder if we could keep the permissions.yaml idea without necessarily needing to expose a fourth option in the terminal 🤔 |
Beta Was this translation helpful? Give feedback.
0 replies
-
We've been looking at using https://github.com/vorpaljs/bash-parser to help with this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The Core Idea
First, a big thank you to the team for the security-first design of the Gemini CLI. The interactive prompt for tool execution is a fantastic safety feature.
Based on prompts the "allow always" option is scoped to the command, like
mkdir
.This works well for simple commands. However, for powerful, multi-purpose tools like
git
,docker
, orkubectl
, theYes, allow always "git ..."
option is still too permissive. It would treat a safe, read-only command likegit status
the same as a potentially destructive one likegit push --force
.My proposal is to introduce a more granular permission level: allowing users to persistently approve specific subcommands (e.g.,
git status
) while ensuring that other, unapproved subcommands from the same tool (e.g.,git push
) still require a prompt.The Problem
For complex tools, the current model creates a security vs. convenience dilemma. When Gemini wants to run
git status
, the prompt looks like this:Choosing
Yes, allow always "git ..."
is a security risk because it would also implicitly approvegit reset --hard
or other dangerous commands. To stay safe, the user must repeatedly select "allow once" for very common and harmless commands, which leads to prompt fatigue.Proposed Solution
I propose enhancing the prompt to include a subcommand-specific option, supported by a persistent configuration file and management commands.
1. An Enhanced Interactive Prompt
Let's evolve the prompt to include a more granular "always allow" choice.
Proposed New Prompt (for a
git status
command):Yes, allow always "git status"
(New!): This is the core of the idea. It would add only thestatus
subcommand to an allowlist for thegit
tool. A futuregit status
call would run without a prompt, but agit push
call would still trigger one.Yes, allow always "git ..."
: This would retain the current behavior, granting blanket permission for the entiregit
tool for users who want that convenience.2. Persistent Permissions via Configuration File
This functionality would be backed by a human-readable config file (
~/.gemini/permissions.yaml
or similar) where these granular permissions are stored.Example
permissions.yaml
:This makes the system transparent and allows power users to manage permissions by directly editing the file.
3. Dedicated Permission Management Commands
To complete the feature, users should be able to manage these permissions without having to wait for a prompt:
gemini tool permissions list
: Displays the allowlist in a clean format.gemini tool permissions add '<tool> <subcommand>'
: Proactively adds a permission (e.g.,gemini tool permissions add 'git log'
).gemini tool permissions remove '<tool> <subcommand>'
: Revokes a specific permission.Benefits
Beta Was this translation helpful? Give feedback.
All reactions