Repository navigation
How should I configure Gemini CLI tool permissions when allowed tools expose capabilities of disabled tools? #30098
Replies: 1 comment
|
Hey @LLLLLQ-4, hope you're doing well! Thanks for writing this up so clearly, the policy file and the two statement example made it really easy to follow. From what I can see on main, the policy engine decides per tool call. It matches the tool name (plus The tool names look like crystaldba's postgres-mcp, is that the one you're using? If so, it has a mode for exactly this: start it with You could also add a higher priority deny rule with an |
Uh oh!
There was an error while loading. Please reload this page.
I am trying to use Gemini CLI for read-only database inspection and query-plan analysis. The agent should be able to inspect schemas and run
EXPLAIN, but it should not be able to execute SQL that creates or modifies database objects.I configured an admin policy that denies every tool by default and then allows a small set of PostgreSQL inspection and analysis tools with higher-priority rules:
The policy also allowed the server's three named analysis helpers. I did not add an allow rule for
execute_sql, somcp_postgres_execute_sqlremained denied by the wildcard rule. Shell execution and file reads and writes also remained denied. The model's tool list contained only the seven explicitly allowed PostgreSQL inspection and analysis tools;mcp_postgres_execute_sqlwas absent.The intended read-only boundary was bypassed through the arguments and effect of the allowed
explain_querytool. It accepted more than one SQL statement, for example:The tool returned
Error: No results returned from EXPLAIN, but the index had actually been created in the database. The same route created a second composite index. The agent never called the deniedexecute_sqltool; it obtained the prohibited write effect through the allowed plan-analysis tool.How should I correctly configure this read-only use case in Gemini CLI?
All reactions