Skip to content

Tool Control

Fresh

Control which built-in tools agent mode can access in VS Code.

VS Code only

Tool control via coreTools/excludeTools settings is not available in JetBrains IDEs.

Configuration

Edit ~/.gemini/settings.json:

Allow only specific tools

json
{
  "coreTools": ["FileReadTool", "GrepTool", "ShellTool(ls -l)"]
}

Block specific tools or commands

json
{
  "excludeTools": ["ShellTool(rm -rf)", "ShellTool(sudo)"]
}

Allow list with specific command exclusions

json
{
  "coreTools": ["FileReadTool", "FileWriteTool", "ShellTool"],
  "excludeTools": ["ShellTool(rm -rf)", "ShellTool(sudo)", "ShellTool(curl)"]
}

Conflict resolution

A tool listed in both excludeTools and coreTools is excluded (exclusion wins).

Built-in Tools

ToolWhat it does
FileReadToolRead files from disk
FileWriteToolWrite and edit files
GrepToolSearch file contents with regex
ShellToolExecute terminal commands

Full reference: Gemini CLI tools API docs

Command-Specific Restrictions

You can allow a tool but restrict specific commands:

json
{
  "coreTools": ["ShellTool(ls -l)", "ShellTool(git status)", "ShellTool(npm install)"]
}

This allows only ls -l, git status, and npm install shell commands — all others are blocked.

List Active Tools

In agent mode chat, type:

/tools

Apply Changes

After editing settings.json:

  • Command Palette > Developer: Reload Window

Yolo Mode (Auto-Approve All)

To skip all approval prompts:

json
{
  "geminicodeassist.agentYoloMode": true
}

Trust required

Yolo mode only works in trusted workspaces. In restricted workspaces, agent still prompts regardless of this setting.

Based on official Google Gemini Code Assist documentation.