You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gemini hook: an unreadable global settings file trusts the workspace and applies its allow rules #4878
gemini_settings in src/hooks/permissions.rs decides whether the project's .gemini/settings.json is trusted from the global file's security.folderTrust.enabled. When the global file exists but cannot be read or parsed, that lookup sees nothing, folder trust counts as off, every workspace counts as trusted, and the project file's tools.allowed rules are applied.
#4652 lists Gemini as "ask and allow only. Losing them means fewer allows, which is not unsafe". That holds for the global file's own rules, but losing the global file also turns folder trust off.
Measured on develop 6c1af5fbc and on #4680's head eaee169b6, same output on both (gemini_settings and read_json are byte-identical in v1.0.1 and 6c1af5fbc), rtk hook gemini, no GEMINI_CLI_TRUST_WORKSPACE. Global ~/.gemini/settings.json = {"security":{"folderTrust":{"enabled":true}}}, project .gemini/settings.json = {"tools":{"allowed":["run_shell_command(git push)"]}}, payload run_shell_command / git push origin main:
global settings.json
output
valid
"decision":"ask_user", command rtk git push origin main
trailing comma
"decision":"allow", same command, parse warning
chmod 000
"decision":"allow", same command (read warning since #4680, none before)
So a repository's own settings file grants allow, which the global configuration had withheld.
What would close it: when the global file is unreadable or unparseable, treat the workspace as untrusted (use no project rules), and add a test for each of the two failure shapes through the real hook.
Unreadable/unparseable global Gemini settings.json causes folder trust to default to on, letting an untrusted project's tools.allowed rules apply; fail closed instead.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/hooks/permissions.rs
Suggested Actions
In gemini_settings/read_json (src/hooks/permissions.rs), treat read/parse failure as folderTrust=false, not absent
Add tests for the chmod 000 and trailing-comma failure shapes via the real rtk hook gemini path
Activity
rtk-wshm-sync-bot commentedon Oct 31, 2026
🔍 Automated Triage
bughighSummary
Unreadable/unparseable global Gemini settings.json causes folder trust to default to on, letting an untrusted project's tools.allowed rules apply; fail closed instead.
📁 Relevant files
src/hooks/permissions.rsSuggested Actions
gemini_settings/read_json(src/hooks/permissions.rs), treat read/parse failure as folderTrust=false, not absentrtk hook geminipathTriaged automatically by wshm · This is an automated analysis, not a human review.
test(hook): cover Gemini global-settings fail-closed on every platform
fix(hook): fail closed on unreadable Gemini settings