Trust model
NanoClaw operates with different trust levels for different entities: | Entity | Trust Level | Rationale | |--------|-------------|-----------|| | Main group | Trusted | Private self-chat, admin control | | Non-main groups | Untrusted | Other users may be malicious | | Container agents | Sandboxed | Isolated execution environment | | WhatsApp messages | User input | Potential prompt injection |Security boundaries
Container isolation (primary boundary)
Agents execute in containers (lightweight Linux VMs), providing:- Process isolation - Container processes cannot affect the host
- Filesystem isolation - Only explicitly mounted directories are visible
- Non-root execution - Runs as unprivileged
nodeuser (uid 1000) - Ephemeral containers - Fresh environment per invocation (
--rm)
The container runtime is abstracted through
src/container-runtime.ts, making it easy to swap runtimes. Docker is the default, but you can switch to Apple Container on macOS for a lighter-weight native runtime.Mount security
External allowlist Mount permissions are stored at~/.config/nanoclaw/mount-allowlist.json, which is:
- Outside the project root
- Never mounted into containers
- Cannot be modified by agents
- Symlink resolution before validation (prevents traversal attacks)
- Container path validation (rejects
..and absolute paths) nonMainReadOnlyoption forces read-only for non-main groups
src/mount-security.ts:1 for the validation implementation.
Read-only project root
The main group’s project root is mounted read-only. Writable paths the agent needs (group folder, IPC, .claude/) are mounted separately. This prevents the agent from modifying host application code (src/, dist/, package.json, etc.) which would bypass the sandbox entirely on next restart.
From src/container-runner.ts:66:
Session isolation
Each group has isolated Claude sessions atdata/sessions/{group}/.claude/:
- Groups cannot see other groups’ conversation history
- Session data includes full message history and file contents read
- Prevents cross-group information disclosure
src/container-runner.ts:103:
IPC authorization
Messages and task operations are verified against group identity. The IPC system uses per-group namespaces indata/ipc/{group}/ to prevent privilege escalation.
| Operation | Main Group | Non-Main Group |
|---|---|---|
| Send message to own chat | ✓ | ✓ |
| Send message to other chats | ✓ | ✗ |
| Schedule task for self | ✓ | ✓ |
| Schedule task for others | ✓ | ✗ |
| View all tasks | ✓ | Own only |
| Manage other groups | ✓ | ✗ |
src/ipc.ts:76:
Credential handling
Mounted credentials:- Claude auth tokens (filtered from
.env, read-only)
- WhatsApp session (
store/auth/) - host only - Mount allowlist - external, never mounted
- Any credentials matching blocked patterns
src/container-runner.ts:206):
Privilege comparison
| Capability | Main Group | Non-Main Group |
|---|---|---|
| Project root access | /workspace/project (ro) | None |
| Group folder | /workspace/group (rw) | /workspace/group (rw) |
| Global memory | Implicit via project | /workspace/global (ro) |
| Additional mounts | Configurable | Read-only unless allowed |
| Network access | Unrestricted | Unrestricted |
| MCP tools | All | All |
Security architecture diagram
Best practices
Review mount allowlist regularly
Review mount allowlist regularly
Check
~/.config/nanoclaw/mount-allowlist.json to ensure only necessary directories are mounted. Remove entries you no longer need.Use read-only mounts for sensitive data
Use read-only mounts for sensitive data
When mounting directories containing sensitive data, use the
readonly option in containerConfig.additionalMounts to prevent modifications.Keep secrets out of mounted directories
Keep secrets out of mounted directories
Never place API keys, passwords, or other secrets in directories that are mounted to non-main groups.
Monitor container logs
Monitor container logs
Check
groups/{name}/logs/container-*.log files to review what agents are doing. Enable verbose logging with LOG_LEVEL=debug for detailed output.Related pages
- IPC system - Inter-process communication and authorization
- Container runtime - Container execution details
- Troubleshooting - Common security-related issues