Provides the concrete tool implementations that agents use to interact with the filesystem, git, and shell within a workspace root. All file operations are path-sandboxed to the workspace root.
- Path sandboxing — every file operation resolves the path relative to
workspace_rootand rejects any path that escapes it (path traversal prevention viaresolve_workspace_path). - Write size limits —
workspace_write_fileandworkspace_apply_patchenforce a maximum write size (fromWorkspaceToolConfig.max_write_bytes). - Hash-anchored edits —
workspace_edit_at_hashrequires the caller to provide the current line's SHA-256 hash, preventing stale edits to files changed since the agent last read them. - Gitignore respect —
workspace_list_filesandworkspace_search_filesfilter out paths matching.gitignorepatterns when configured. - Shell isolation —
workspace_shellruns commands in the workspace root with a timeout; environment is sanitized. - Knowledge backend fallback — search/parse operations use
FallbackKnowledgeBackendwhich chains code-analysis backends and falls back gracefully when none are available.
| Tool name | Category | Read-only? | Destructive? |
|---|---|---|---|
workspace_read_file |
Files | Yes | No |
workspace_write_file |
Files | No | Yes |
workspace_apply_patch |
Files | No | Yes |
workspace_edit_at_hash |
Files | No | Yes |
workspace_list_files |
Files | Yes | No |
workspace_search_files |
Files | Yes | No |
workspace_search_code |
Code | Yes | No |
workspace_parse_code |
Code | Yes | No |
workspace_shell |
Shell | No | Yes |
git_status |
Git | Yes | No |
git_diff |
Git | Yes | No |
git_commit |
Git | No | Yes |
git_log |
Git | Yes | No |
- No tool may read or write outside
workspace_root. workspace_edit_at_hashfails if the provided hash does not match the current line content.- Shell timeout is always finite; no tool hangs indefinitely.