Security & Sandbox

PicoClaw runs in a sandboxed environment by default. The agent can only access files and run commands within the configured workspace.

Default configuration

{
  "agents": {
    "defaults": {
      "workspace": "~/.picoclaw/workspace",
      "restrict_to_workspace": true
    }
  }
}
OptionDefaultDescription
workspace~/.picoclaw/workspaceWorking directory for the agent
restrict_to_workspacetrueRestrict file/command access to workspace

Protected tools

When restrict_to_workspace: true, these tools are sandboxed:

ToolFunctionRestriction
read_fileRead filesOnly within workspace
write_fileWrite filesOnly within workspace
list_dirList directoriesOnly within workspace
edit_fileEdit filesOnly within workspace
append_fileAppend to filesOnly within workspace
execExecute commandsPaths must be within workspace

Additional exec protection

Even with restrict_to_workspace: false, the exec tool blocks:

  • rm -rf, del /f, rmdir /s — bulk deletion
  • format, mkfs, diskpart — disk formatting
  • dd if= — disk imaging
  • Writing to /dev/sd[a-z]
  • shutdown, reboot, poweroff
  • Fork bomb :(){ :|:& };:

Error examples

[ERROR] tool: Tool execution failed
{tool=exec, error=Command blocked by safety guard (path outside working dir)}
[ERROR] tool: Tool execution failed
{tool=exec, error=Command blocked by safety guard (dangerous pattern detected)}

Disabling restrictions (security risk)

Only in controlled environments. Config:

"agents": { "defaults": { "restrict_to_workspace": false } }

Or environment: PICOCLAW_AGENTS_DEFAULTS_RESTRICT_TO_WORKSPACE=false. Disabling allows the agent to access any path on your system.

Security boundary consistency

restrict_to_workspace applies to main agent, subagents (spawn), and heartbeat tasks. There is no way to bypass the boundary via subagents or scheduled tasks.