Workspace is a local-machine toolkit scoped to a single root directory. Reads (read, list, search) run silently; destructive operations (write, edit, move, delete, shell) require human confirmation by default, which AgentOS renders as approval prompts in the run timeline.
Example
cookbook/91_tools/workspace_tools/basic_usage.py
Permission Model
allowed and confirm are mutually exclusive partitions of short aliases:
When both lists are
None, reads auto-pass and writes require confirmation (the safe default). When only one is set, the other defaults to []. Use Workspace.ALL_TOOLS to register every tool.
Toolkit Params
list_files and search_content skip common noise directories (.venv, .git, __pycache__, node_modules, etc.) by default.
Confirmation Flow
With aliases inconfirm, the run pauses when the agent calls a gated tool. Resolve the requirement and continue the run:
Developer Resources
- Tools source
- Basic usage
- With confirmation
- WorkspaceContextProvider wraps this toolkit read-only as a context provider