fix(exec): tighten Seatbelt filesystem and launcher boundaries
Keep temporary work inside the granted workspace instead of exposing host scratch trees, enforce read-only roots, and pin the system sandbox launcher before PATH lookup. Preserve documented network access and the narrow system paths needed by shell and Git. Add native macOS containment and launcher regressions plus shared backend contract coverage. Document scratch and custom-tool requirements without changing existing bwrap or Windows behavior.
This commit is contained in:
1 parent
947ed17e8b
commit
8b9e35bf78
8 files changed
+241
-55
No files matched your search
@@ -2110,7 +2110,7 @@ For API keys, tokens, and other secrets, see [Environment Variables for Secrets]
|
||||
|--------|---------|-------------|
|
||||
| `tools.restrictToWorkspace` | `false` | When `true`, enables nanobot's application-level workspace guards for workspace-aware tools. File tools resolve paths under the active workspace; selected internal roots can be added as read-only or explicitly write-enabled roots, and media uploads are read-only by default. Shell execution rejects workspace-external `working_dir` values and applies best-effort command path checks, but this is not an OS sandbox. |
|
||||
| `tools.maxSessionMessagesPerMinute` | `6` | Maximum messages one source session may send during any rolling 60-second window. Additional sends are rejected to stop runaway agent loops. |
|
||||
| `tools.exec.sandbox` | `""` | Sandbox backend for shell commands. Set to `"bwrap"` (Linux) or `"seatbelt"` (macOS) to wrap exec calls in an OS sandbox — the process can only see the workspace (read-write) and media directory (read-only); config files and API keys are hidden. Automatically enables workspace restriction for file tools. `"bwrap"` requires `bwrap` installed (`apt install bubblewrap`; pre-installed in the Docker image) and depends on Linux kernel namespaces. `"seatbelt"` uses the `sandbox-exec(1)` binary shipped with macOS. Neither backend is available on Windows, where nanobot logs a warning and runs commands unsandboxed. |
|
||||
| `tools.exec.sandbox` | `""` | Sandbox backend for shell commands. `"bwrap"` (Linux) or `"seatbelt"` (macOS) restricts filesystem access to the workspace (read-write), media (read-only), required system paths and configured extra binds. The workspace's parent is denied except for allowed roots; keep secrets outside the workspace and binds. Automatically enables workspace restriction for file tools. `"bwrap"` requires bubblewrap (`apt install bubblewrap`; pre-installed in Docker). `"seatbelt"` uses macOS `sandbox-exec(1)`; it sets `HOME` and `TMPDIR` to the workspace rather than sharing host temporary directories. Use `mktemp "$TMPDIR/job.XXXXXX"` for macOS shell scratch files. Neither backend restricts network access. Windows logs a warning and runs commands without OS sandboxing. |
|
||||
| `tools.exec.enable` | `true` | When `false`, the shell `exec` tool is not registered at all. Use this to completely disable shell command execution. |
|
||||
| `tools.exec.timeout` | `60` | Default hard timeout in seconds for shell commands. Config values may exceed the per-call tool cap; set `0` to disable the hard timeout for trusted long-running commands. |
|
||||
| `tools.exec.pathPrepend` | `""` | Extra directories to prepend to `PATH` when running shell commands. Use this when configured tools should win executable lookup precedence, such as a Python virtual environment's `bin` or `Scripts` directory. |
|
||||
|
||||
Reference in new issue
Block a user