Skip to main content
skill CX Codex

sandbox-guard — Claude Code skill: Docker sandbox for untrusted skills

Builds Docker sandbox configs so you can run untrusted OpenClaw skills without handing them the host. Useful the moment you install someone else's skill.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add UseAI-pro/openclaw-skills-security --skill sandbox-guard -a claude-code
Open on GitHub

What sandbox-guard does

The skill turns a permission list into an isolation profile. Tell it what a skill asks for — file reads, writes, network, shell — and it returns a Dockerfile with a non-root user, a docker run command carrying the security flags, and a docker-compose.yml for repeat runs.

Three profiles ship with it. Minimal covers read-only skills: the project mounts as ro, networking is off via --network none, and --tmpfs /tmp:size=64m provides scratch space. Standard allows writes into the workspace and caps the container at --memory 512m, --cpus 1, --pids-limit 100. Network keeps those caps but leaves networking open and sets --dns 1.1.1.1.

--cap-drop ALL and --security-opt no-new-privileges are always present, and --privileged never gets generated. Ask for a skill that needs shell and the skill warns you to watch the container output. Docker has to be installed. Generated files land only in a dedicated folder such as .openclaw/sandbox/, and you review the content before anything is written — existing project files stay untouched. That matters because a malicious skill with shell access outside a sandbox can take the whole machine with it.

What it helps with

  • build a Docker profile matching a third-party skill's permissions
  • run an untrusted skill with no access to the host filesystem
  • cap container memory, CPU and process count
  • get a reusable docker-compose.yml for repeat runs
  • review the generated config before it hits disk

Example prompts for the agent

  • generate a sandbox for a skill with fileRead and fileWrite permissions
  • this skill wants network and shell — which isolation profile should I use?
  • write a docker-compose file to run this skill in a sandbox

How to install sandbox-guard

1Skills CLI (Vercel)

npx skills add UseAI-pro/openclaw-skills-security --skill sandbox-guard -a claude-code

2Manually: put the files in place

~/.claude/skills/sandbox-guard/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/sandbox-guard/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about sandbox-guard

How do I install sandbox-guard in Claude?

Run npx skills add UseAI-pro/openclaw-skills-security --skill sandbox-guard -a claude-code. The skill file ends up at ~/.claude/skills/sandbox-guard/SKILL.md.

What does sandbox-guard do?

It generates Docker sandbox configuration for running untrusted OpenClaw skills in isolation: a Dockerfile, a docker run command with security flags, and a docker-compose.yml.

Which sandbox profiles does it offer?

Three: Minimal for read-only skills, Standard with workspace writes, and Network for skills that call APIs. It defaults to the most restrictive one.

Source text

SKILL.md · MIT
---
name: sandbox-guard
description: Generate Docker sandbox configurations for safely running untrusted OpenClaw skills. Isolates filesystem, network,
  and process access.
metadata:
  short-description: Generate safer Docker sandbox profiles for running untrusted OpenClaw skills.
  why: Make sandbox-first execution practical instead of relying on manual container hardening every time.
  what: Provides a sandbox configuration module for filesystem, network, privilege, and resource isolation.
  how: Uses pre-baked Docker patterns with explicit security flags and usage guidance.
  results: Produces recommended sandbox commands and profiles for read-only or read-write execution.
  version: 1.0.0
  updated: '2026-03-10T03:42:30Z'
  jtbd-1: When I need to run an untrusted skill but want a repeatable isolation profile first.
  audit:
    kind: module
    author: useclawpro
    category: Security
    trust-score: 95
    last-audited: '2026-02-01'
    permissions:
      file-read: true
      file-write: true
      network: false
      shell: false
---

# Sandbox Guard

You are a sandbox configuration generator for OpenClaw. When a user wants to run an untrusted skill, you generate a secure Docker-based sandbox that isolates the skill from the host system.

## Why Sandbox

OpenClaw skills run with the permissions they request. A malicious skill with `shell` access can compromise your entire system. Sandboxing limits the blast radius.

## Sandbox Profiles

### Profile: Minimal (for read-only skills)

```dockerfile
FROM node:20-alpine
RUN adduser -D -h /workspace openclaw
WORKDIR /workspace
USER openclaw

# No network, no elevated privileges
# Mount project as read-only
```

```bash
docker run --rm \
  --network none \
  --read-only \
  --tmpfs /tmp:size=64m \
  --cap-drop ALL \
  --security-opt no-new-privileges \
  -v "$(pwd):/workspace:ro" \
  openclaw-sandbox
```

### Profile: Standard (for read/write skills)

```dockerfile
FROM node:20-alpine
RUN adduser -D -h /workspace openclaw
WORKDIR /workspace
USER openclaw
```

```bash
docker run --rm \
  --network none \
  --cap-drop ALL \
  --security-opt no-new-privileges \
  --memory 512m \
  --cpus 1 \
  --pids-limit 100 \
  -v "$(pwd):/workspace" \
  openclaw-sandbox
```

### Profile: Network (for skills needing API access)

```dockerfile
FROM node:20-alpine
RUN adduser -D -h /workspace openclaw
WORKDIR /workspace
USER openclaw
```

```bash
docker run --rm \
  --cap-drop ALL \
  --security-opt no-new-privileges \
  --memory 512m \
  --cpus 1 \
  --pids-limit 100 \
  --dns 1.1.1.1 \
  -v "$(pwd):/workspace" \
  openclaw-sandbox
```

**Note:** Network-enabled sandboxes still prevent privilege escalation and limit resources. For additional security, use `--network` with a custom Docker network that restricts outbound traffic to specific domains.

## Configuration Generator

When the user provides a skill's permissions, generate the appropriate sandbox:

### Input

```
Skill: <name>
Permissions: fileRead, fileWrite, network, shell
```

### Output

1. **Dockerfile** — minimal base image, non-root user
2. **docker run command** — with all security flags
3. **docker-compose.yml** — for repeated use

### Security Flags (always include)

| Flag | Purpose |
|---|---|
| `--cap-drop ALL` | Remove all Linux capabilities |
| `--security-opt no-new-privileges` | Prevent privilege escalation |
| `--read-only` | Read-only filesystem (if no fileWrite) |
| `--network none` | Disable network (if no network permission) |
| `--memory 512m` | Limit memory usage |
| `--cpus 1` | Limit CPU usage |
| `--pids-limit 100` | Limit number of processes |
| `--tmpfs /tmp:size=64m` | Temporary writable space |
| `USER openclaw` | Run as non-root user |

## Rules

1. Always default to the most restrictive profile
2. Never generate a sandbox with `--privileged` flag
3. Never mount the Docker socket (`/var/run/docker.sock`)
4. Never mount sensitive host directories (`~/.ssh`, `~/.aws`, `/etc`)
5. Always use `--cap-drop ALL` — never grant individual capabilities unless explicitly justified
6. Include resource limits to prevent DoS (memory, CPU, pids)
7. If the skill needs `shell`, warn the user and suggest monitoring the sandbox output
8. **Write generated files only to a dedicated output folder** (e.g., `.openclaw/sandbox/`) — never overwrite existing project files
9. **Require user confirmation** before writing any file to disk — present the generated content for review first

© UseAI-pro · MIT · UseAI-pro/openclaw-skills-security

Similar skills

All skills for Security →

From the same set10

skill-vetter Reviews OpenClaw SKILL.md files before installation. Checks for typosquatting, credential file access, and dangerous permission combos like network plus shell. CX Codex +1 21,100installs skill-guard Watches active OpenClaw skills: which files they touch, where they connect, what they run in the shell. Useful when you install someone else's skill and want to see it stay inside its declared permissions. CX Codex +1 573installs prompt-guard This skill scans skill files, user messages and external data for attempts to hijack an agent's instructions. Useful before you install someone else's skill or feed the agent web content. CX Codex +1 546installs credential-scanner Scans your project for exposed keys and passwords before a file-reading skill can pick them up. CX Codex +1 538installs permission-auditor Walks through the permissions an OpenClaw skill asks for, explains each one in plain language, and suggests a smaller set. CX Codex +1 476installs output-sanitizer A skill that scans the agent's reply before it is shown or logged and strips leaked keys, PII and internal paths. Useful when output leaves your machine. CX Codex +1 475installs setup-auditor Checks an OpenClaw environment for leaked credentials, unsafe defaults and missing sandbox controls. Returns a report with a readiness verdict and a fix checklist. CX Codex +1 469installs config-hardener Checks AGENTS.md, gateway settings, sandbox config and skill permissions in OpenClaw, then hands you a hardening plan. Useful before you let more skills run on a host. CX Codex +1 468installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor