diff --git a/README.md b/README.md index 8a8c864d0..98d3a7810 100644 --- a/README.md +++ b/README.md @@ -1387,6 +1387,8 @@ MCP tools are automatically discovered and registered on startup. The LLM can us | `tools.restrictToWorkspace` | `false` | When `true`, restricts **all** agent tools (shell, file read/write/edit, list) to the workspace directory. Prevents path traversal and out-of-scope access. | | `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.pathAppend` | `""` | Extra directories to append to `PATH` when running shell commands (e.g. `/usr/sbin` for `ufw`). | +| `tools.exec.commandWrapper` | `""` | Sandbox wrapper command template. See [Exec Tool Sandbox](docs/COMMAND_WRAPPER.md) for details and examples. | + | `channels.*.allowFrom` | `[]` (deny all) | Whitelist of user IDs. Empty denies all; use `["*"]` to allow everyone. | diff --git a/docs/COMMAND_WRAPPER.md b/docs/COMMAND_WRAPPER.md new file mode 100644 index 000000000..da63a9f08 --- /dev/null +++ b/docs/COMMAND_WRAPPER.md @@ -0,0 +1,86 @@ +# Exec Tool Sandbox (`commandWrapper`) + +The `tools.exec.commandWrapper` config option wraps every shell command in a user-defined template before execution. This allows you to add a sandbox layer (e.g. bubblewrap, firejail, nsjail) without any code changes to nanobot. + +## Configuration + +```json +{ + "tools": { + "exec": { + "commandWrapper": "