On Linux, the harness runs inside a bubblewrap (bwrap) container by default, isolating the agent's filesystem access. On other platforms, sandboxing is off (bwrap is Linux-only).
Use --no-sandbox to disable, or --sandbox to force on.
When sandboxing is active and HARNESS_SANDBOXED is not set, the harness:
- Checks that
bwrapis installed (exits with install instructions if not) - Resolves the agent and loads
sandbox.jsonfrom the agent's directory (auto-creates a default if missing) - Re-executes itself under
bwrapwithHARNESS_SANDBOXED=1set - Inside the sandbox: system dirs are read-only, agent memory/session state are read-write, the workspace directory is read-write
Each agent gets a workspace directory at ~/.mastersof-ai/agents/<name>/workspace/, auto-created on first run. This is the agent's persistent working directory — files created here survive across sessions.
The workspace is always mounted read-write in sandbox mode and is the default working directory. Agents can access additional directories via mounts in sandbox.json.
Each agent can have a sandbox.json in its directory:
{
"workspace": "~/.mastersof-ai/agents/ember/workspace",
"env": ["HOME", "PATH", "TERM"],
"network": "host",
"mounts": [
{ "path": "~/Projects/my-project", "mode": "rw" },
{ "path": "~/data", "mode": "ro" }
]
}| Field | Default | Description |
|---|---|---|
workspace |
Agent's workspace dir | Working directory, mounted read-write |
env |
["HOME", "PATH", "TERM"] |
Environment variables to pass through |
network |
"host" |
"host" or "none" (disables networking) |
mounts |
[] |
Additional bind mounts with "ro" or "rw" mode |
enabled |
true |
Set to false to skip sandboxing |
The legacy project field is still accepted and mapped to workspace.
The sandbox starts with a clean environment (--clearenv). Variables reach the sandbox through two paths:
envwhitelist insandbox.json— named vars from your shell are passed through (e.g."env": ["HOME", "PATH", "TERM", "ANTHROPIC_API_KEY"])- Agent
.envfile — if the agent has a.env(encrypted or plaintext), it's decrypted before the sandbox starts and injected directly. No whitelist entry needed. See Secrets for details.
DOTENV_PRIVATE_KEY is explicitly excluded from the sandbox — only decrypted values enter.
The sandbox unshares PID and IPC namespaces. Network is shared by default but can be disabled per-agent. The child process dies with the parent (--die-with-parent).