gemini-cli - 💡(How to fix) Fix OAuth/Policy Error: "Tool execution denied by policy" prevents basic read/write tool usage [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25283Fetched 2026-04-14 05:56:16
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2

Error Message

The Gemini CLI is consistently throwing a Tool execution denied by policy error. This is a generalized blockade affecting all tool invocations, but it severely impacts fundamental I/O operations (file reading, file writing, and shell command execution). The environment security system actively blocks these tools, rendering file-dependent workflows and codebase context gathering completely unusable. The CLI should successfully execute read/write file operations and shell commands when requested by the prompt. Or, otherwise, at least ask for permittion to do it (do not happen). If there is a missing scope or local configuration preventing tool usage, the CLI should output a clear, actionable error message pointing to the specific IAM permission or local tool_execution_policy flag, rather than a generic policy denial. The CLI should successfully execute read/write file operations and shell commands when requested by the prompt. If there is a missing scope or local configuration preventing tool usage, the CLI should output a clear, actionable error message pointing to the specific IAM permission or local tool_execution_policy flag, rather than a generic policy denial.

Code Example

> /about
About Gemini CLI│                                                                                                                      │
CLI Version                              0.37.1Git Commit                               3b2d4f100                                                                   │
Model                                    Auto (Gemini 3)Sandbox                                  no sandbox                                                                  │
OS                                       win32                                                                       │
Auth Method                              Signed in with Google (ramonpiacente@gmail.com)Tier                                     Gemini Code Assist in Google One AI Pro
RAW_BUFFERClick to expand / collapse

What happened?

What happened? The Gemini CLI is consistently throwing a Tool execution denied by policy error. This is a generalized blockade affecting all tool invocations, but it severely impacts fundamental I/O operations (file reading, file writing, and shell command execution). The environment security system actively blocks these tools, rendering file-dependent workflows and codebase context gathering completely unusable.

What did you expect to happen? The CLI should successfully execute read/write file operations and shell commands when requested by the prompt. Or, otherwise, at least ask for permittion to do it (do not happen). If there is a missing scope or local configuration preventing tool usage, the CLI should output a clear, actionable error message pointing to the specific IAM permission or local tool_execution_policy flag, rather than a generic policy denial.

Client information:

  • OS: Windows (PowerShell)
  • Auth Type: OAuth
  • CLI Version: 0.37.1
  • Model Version: all of them

Login information:

  • Authenticated via gcloud auth application-default login (OAuth user context).

Anything else we need to know? The problem persists even after forcefully revoking and regenerating application default credentials or reinstalling gemini cli. The issue seems to stem from an overly restrictive "fail-closed" default architecture regarding tool execution in the CLI wrapper, or a severe mismatch between documented OAuth scopes and the actual Vertex AI/Google AI Studio backend requirements for Function Calling.

What did you expect to happen?

What did you expect to happen? The CLI should successfully execute read/write file operations and shell commands when requested by the prompt. If there is a missing scope or local configuration preventing tool usage, the CLI should output a clear, actionable error message pointing to the specific IAM permission or local tool_execution_policy flag, rather than a generic policy denial.

Client information

<details> **Client information:** - **OS:** Windows (PowerShell) - **Auth Type:** OAuth - **CLI Version:** 0.37.1 - **Model Version:** all of them <summary>Client Information</summary>

Run gemini to enter the interactive CLI, then run the /about command.

> /about
│ About Gemini CLI                                                                                                     │
│                                                                                                                      │
│ CLI Version                              0.37.1                                                                      │
│ Git Commit                               3b2d4f100                                                                   │
│ Model                                    Auto (Gemini 3)                                                             │
│ Sandbox                                  no sandbox                                                                  │
│ OS                                       win32                                                                       │
│ Auth Method                              Signed in with Google ([email protected])                             │
│ Tier                                     Gemini Code Assist in Google One AI Pro                                     │
│                                                                                                 ```

</details>/about

### Login information

- Authenticated via `gcloud auth application-default login` (OAuth user context).


### Anything else we need to know?

The problem persists even after forcefully revoking and regenerating application default credentials or reinstalling gemini cli. The issue seems to stem from an overly restrictive "fail-closed" default architecture regarding tool execution in the CLI wrapper, or a severe mismatch between documented OAuth scopes and the actual Vertex AI/Google AI Studio backend requirements for Function Calling.

extent analysis

TL;DR

The Gemini CLI's "Tool execution denied by policy" error may be resolved by adjusting the tool_execution_policy flag or verifying the OAuth scopes to match the Vertex AI/Google AI Studio backend requirements.

Guidance

  • Review the OAuth scopes used for authentication to ensure they align with the requirements for tool execution in Vertex AI/Google AI Studio.
  • Check the tool_execution_policy flag in the local configuration to see if it's set to a restrictive mode that's causing the denial.
  • Verify that the Gemini CLI version (0.37.1) is compatible with the Vertex AI/Google AI Studio backend and that there are no known issues with this version.
  • Consider checking the documentation for any specific IAM permissions required for tool execution and ensure they are properly configured.

Example

No specific code example is provided as the issue seems to be related to configuration and authentication rather than code.

Notes

The issue might be due to an overly restrictive default architecture or a mismatch between documented OAuth scopes and actual backend requirements. Further investigation into the specific requirements for Vertex AI/Google AI Studio and the configuration of the Gemini CLI is needed.

Recommendation

Apply workaround: Adjust the tool_execution_policy flag or OAuth scopes to match the requirements for tool execution in Vertex AI/Google AI Studio, as the issue seems to stem from a configuration or authentication mismatch rather than a version-related problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING