Skip to content

Update ADK doc according to issue #1438 - 5 Add documentation for ExecuteBashTool - merge#1442

Closed
adk-bot wants to merge 1 commit into
mainfrom
agent-changes-20260316-013647
Closed

Update ADK doc according to issue #1438 - 5 Add documentation for ExecuteBashTool - merge#1442
adk-bot wants to merge 1 commit into
mainfrom
agent-changes-20260316-013647

Conversation

@adk-bot

@adk-bot adk-bot commented Mar 16, 2026

Copy link
Copy Markdown
Collaborator

5. Create documentation for the new ExecuteBashTool

Doc file: docs/tools/built-in-tools/bash.md

Current state:

(New file)

Proposed Change:

Bash Tool

The ExecuteBashTool allows an agent to execute bash commands within a local workspace directory. This tool is useful for file system operations, running scripts, or interacting with the local environment.

Usage

To use the Bash tool, instantiate ExecuteBashTool and add it to your agent's tools.

from google.adk.tools.bash_tool import ExecuteBashTool, BashToolPolicy
from google.adk.agents import LlmAgent

# Create the tool with a policy
bash_tool = ExecuteBashTool(
    workspace="/path/to/workspace", # Defaults to current working directory
    policy=BashToolPolicy(allowed_command_prefixes=("ls", "cat", "grep")) # Whitelist commands
)

agent = LlmAgent(
    name="system_helper",
    model="gemini-2.0-flash",
    tools=[bash_tool],
    instruction="You can execute bash commands to help the user."
)

Security

The ExecuteBashTool includes several security features:

  1. Prefix Policy: You can restrict which commands are allowed using BashToolPolicy(allowed_command_prefixes=...). By default, all commands are allowed (("*",)).
  2. User Confirmation: The tool always requests user confirmation before executing a command. The framework will pause execution and wait for the user (or client application) to approve the command via the adk_request_confirmation flow.

Configuration

  • workspace (pathlib.Path | None): The directory where commands will be executed. Defaults to the current working directory.
  • policy (BashToolPolicy | None): Configuration for allowed command prefixes.

Reasoning:
The ExecuteBashTool is a new built-in tool that provides capability to run bash commands. It has specific security policies and confirmation requirements that should be documented.

Reference: src/google/adk/tools/bash_tool.py

@netlify

netlify Bot commented Mar 16, 2026

Copy link
Copy Markdown

Deploy Preview for adk-docs-preview ready!

Name Link
🔨 Latest commit 34b8d87
🔍 Latest deploy log https://app.netlify.com/projects/adk-docs-preview/deploys/69b75eb33758b70008a37872
😎 Deploy Preview https://deploy-preview-1442--adk-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@jcwriter74

Copy link
Copy Markdown
Collaborator

Proposed changes already added to https://github.com/google/adk-docs/pull/1442/changes

@jcwriter74 jcwriter74 closed this Jun 12, 2026
@jcwriter74 jcwriter74 self-assigned this Jun 12, 2026
@jcwriter74

Copy link
Copy Markdown
Collaborator

@jcwriter74 jcwriter74 changed the title Update ADK doc according to issue #1438 - 5 Update ADK doc according to issue #1438 - 5 Add documentation for ExecuteBashTool - merge Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants