Enabling the Feature
The Trusted Folders feature is disabled by default. To use it, you must first enable it in your settings. Add the following to your usersettings.json file:
How It Works: The Trust Dialog
Once the feature is enabled, the first time you run the Gemini CLI from a folder, a dialog will automatically appear, prompting you to make a choice:Trust folder
Grants full trust to the current folder (e.g.,
my-project).Trust parent folder
Grants trust to the parent directory (e.g.,
safe-projects), which automatically trusts all of its subdirectories as well. This is useful if you keep all your safe projects in one place.Don't trust
Marks the folder as untrusted. The CLI will operate in a restricted “safe mode.”
Your choice is saved in a central file (
~/.gemini/trustedFolders.json), so you will only be asked once per folder.Understanding Folder Contents
Before you make a choice, the Gemini CLI performs a discovery phase to scan the folder for potential configurations. This information is displayed in the trust dialog to help you make an informed decision. The discovery UI lists the following categories of items found in the project:Commands
Commands
Custom
.toml command definitions that add new functionality.MCP Servers
MCP Servers
Configured Model Context Protocol servers that the CLI will attempt to connect to.
Hooks
Hooks
System or custom hooks that can intercept and modify CLI behavior.
Skills
Skills
Local agent skills that provide specialized capabilities.
Setting overrides
Setting overrides
Any project-specific configurations that override your global user settings.
Security Warnings and Errors
The trust dialog also highlights critical information that requires your attention: By reviewing these details, you can ensure that you only grant trust to projects that you know are safe.Impact of an Untrusted Workspace
When a folder is untrusted, the Gemini CLI runs in a restricted “safe mode” to protect you. In this mode, the following features are disabled:Workspace settings are ignored
The CLI will not load the
.gemini/settings.json file from the project. This prevents the loading of custom tools and other potentially dangerous configurations.Tool auto-acceptance is disabled
You will always be prompted before any tool is run, even if you have auto-acceptance enabled globally.
Automatic memory loading is disabled
The CLI will not automatically load files into context from directories specified in local settings.
MCP servers do not connect
The CLI will not attempt to connect to any Model Context Protocol (MCP) servers.
Granting trust to a folder unlocks the full functionality of the Gemini CLI for that workspace.
Managing Your Trust Settings
If you need to change a decision or see all your settings, you have a couple of options:Change Current Folder’s Trust
Run the/permissions command from within the CLI. This will bring up the same interactive dialog, allowing you to change the trust level for the current folder.
View All Trust Rules
To see a complete list of all your trusted and untrusted folder rules, you can inspect the contents of the~/.gemini/trustedFolders.json file in your home directory.