Middleware that exposes Anthropic's native bash tool to models.
ClaudeBashToolMiddleware(
self,
workspace_root: str | None = None,
*,
startup_commands: tuple[str, ...] | list[str] | str | None = None,
shutdown_commands: tuple[str, ...] | list[str] | str | None = None,
execution_policy: Any | None = None,
redaction_rules: tuple[Any, ...] | list[Any] | None = None,
tool_description: str | None = None,
env: dict[str, Any] | None = None
)| Name | Type | Description |
|---|---|---|
workspace_root | str | None | Default: NoneBase directory for the shell session. If omitted, a temporary directory is created. |
startup_commands | tuple[str, ...] | list[str] | str | None | Default: NoneOptional commands executed after the session starts. |
shutdown_commands | tuple[str, ...] | list[str] | str | None | Default: NoneOptional commands executed before session shutdown. |
execution_policy | Any | None | Default: NoneExecution policy controlling timeouts and limits. |
redaction_rules | tuple[Any, ...] | list[Any] | None | Default: NoneOptional redaction rules to sanitize output. |
tool_description | str | None | Default: NoneOptional override for tool description. |
env | dict[str, Any] | None | Default: NoneOptional environment variables for the shell session. |