Gemini Agent Mode in Android Studio may stop when it attempts to run a command and reports “Shell command is not available in Sandbox of GIAS.” Google tracks this message as Issue #500338962 and lists the fix in Android Studio Quail 4 Canary 4.
Representative error
Shell command is not available in Sandbox of GIAS
The failure appears when the agent needs a shell command for a build, test, search, or another development step. The tool does not start, so the broader agent task cannot continue.
Cause
This is a known problem between Gemini in Android Studio’s agent execution environment and its sandboxed shell tool. It is not, by itself, evidence of a Gradle configuration error, invalid shell syntax, or project corruption. Google’s public entry does not disclose the deeper implementation cause, so permission settings should not be described as the confirmed root cause.
Conditions and affected versions
- Gemini Agent Mode is active in Android Studio.
- The agent’s plan includes a terminal or shell command.
- The Android Studio build does not contain the fix for Issue #500338962.
Google records the fix in Android Studio Quail 4 Canary 4. Where the stable Quail 4 release is available, prefer the stable release or a newer supported version.
Recommended fix
- Open Help > About, or Android Studio > About Android Studio on macOS, and record the exact IDE build.
- Choose Help > Check for Updates and install Android Studio Quail 4 or newer. Preview-channel users need Quail 4 Canary 4 or later.
- Restart the IDE and sign back in to Gemini if required.
- Run the same Agent Mode task again and review any command confirmation before allowing execution.
Workarounds when you cannot update immediately
Do not delegate command execution to Agent Mode. Review the proposed command, then run it manually in Android Studio’s Terminal.
./gradlew assembleDebug
./gradlew test
You can also limit Gemini to explaining code or preparing a patch while builds and tests run manually or in CI. This bypasses the unavailable tool but does not repair the sandbox integration.
How to verify the fix
- Agent Mode reaches a step that requires the shell.
- The GIAS sandbox error no longer appears.
- The agent receives the result of an approved command and continues to its next step.
Cautions
Always inspect an agent-generated command before approval. Be especially careful with file deletion, Git operations, dependency upgrades, and other hard-to-reverse changes. If an organization policy intentionally blocks shell access, an administrator may still need to change that policy even after the IDE bug is fixed.
Summary
“Shell command is not available in Sandbox of GIAS” is a documented Gemini Agent Mode tooling failure. Upgrade to Android Studio Quail 4 or later. Until then, run reviewed commands manually in the Terminal and use the agent only for steps that do not require shell access.
