fix(my): report current workspace access in self-inspection

This commit is contained in:
Xubin Ren committed 2026-10-11 17:06:39 +08:00
1 parent 9261e731ce
commit e79a0099f6
4 files changed
+177 -5

No files matched your search

+9
View File
@@ -2083,6 +2083,15 @@ For API keys, tokens, and other secrets, see [Environment Variables for Secrets]
| `tools.ssrfWhitelist` | `[]` | CIDR ranges exempted from the shared SSRF guard used by web fetches and HTTP/SSE MCP connections. Prefer exact host CIDRs such as `192.168.1.50/32`; broad ranges increase SSRF exposure. |
| `channels.*.allowFrom` | omitted | Access control per channel. Omit to use pairing-only mode; set `["*"]` to allow everyone; or list specific user IDs. See [Pairing](#pairing) for details. |
To diagnose a path error, the agent can call `my(action="check", key="workspace_sandbox")`.
This read-only result shows the current tool directory and workspace restriction, including
the restriction from `tools.exec.sandbox`. The older `workspace` value is an agent-directory
display; it does not select the current project or grant access.
Check `exec_config` for the configured shell sandbox and extra binds. Those binds do not grant
file-tool access or permit an external shell `working_dir`. OS file permissions still apply.
The `workspace_sandbox.enforced` field reports external sandbox markers, not whether a
configured shell sandbox has started successfully.
**Docker security**: The official Docker image runs as a non-root user (`nanobot`, UID 1000) with bubblewrap pre-installed. The default `docker-compose.yml` drops all Linux capabilities except the `CHOWN`, `SETGID`, and `SETUID` capabilities required by the root entrypoint to initialize bind-mount ownership and become UID 1000. It enables `no-new-privileges` so the final non-root process cannot regain those bootstrap capabilities, and keeps Docker's default AppArmor/seccomp profiles enabled. If you enable `"tools.exec.sandbox": "bwrap"` inside Docker, start Compose with `docker-compose.bwrap.yml` as an additional override so bubblewrap can create nested namespaces. The host must also allow unprivileged user namespaces; the override cannot bypass a host-level namespace restriction.