Skip to content

run_shell_command fails with "Command rejected because it could not be parsed safely" for all commands on WindowsΒ #15556

@alexeystrelkov

Description

@alexeystrelkov

What happened?

Hello Gemini Team,

I am experiencing a critical issue with the Gemini CLI on Windows where the run_shell_command tool is unable to execute any commands.

Problem Description:
Every attempt by the agent to use the run_shell_command tool results in the error: "Command rejected because it could not be parsed safely". This occurs for all attempted commands, from simple
system commands (dir) to more complex ones (curl, wmic), completely preventing any command-line operations.

Environment:
 * Operating System: win32
 * Tool: Gemini CLI

Commands Attempted (all failed):
 * dir
 * wmic cpu get loadpercentage
 * wsl curl -I http://104.194.156.137:8082

Expected Behavior:
The commands should be executed by the shell, and their output returned to the agent.

Actual Behavior:
The tool consistently returns the error: Command rejected because it could not be parsed safely.

This appears to be a bug in the tool's internal safety parser on the Windows platform, which is currently preventing all shell command execution. This makes a core part of the agent's
functionality unusable.

Thank you for your attention to this matter.

What did you expect to happen?

The commands should be executed by the shell, and their output returned to the agent.

Client information

  • CLI Version: 0.22.2
  • Git Commit: d0cdeda
  • Session ID: 899a114a-cc94-47e4-aa16-176745319e0b
  • Operating System: win32 v22.20.0
  • Sandbox Environment: no sandbox
  • Model Version: auto-gemini-2.5
  • Memory Usage: 149.9 MB

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions