| name | crafting-nemoclaw-policies |
| description | Generates and applies OpenShell YAML security policies for NemoClaw sandboxes — filesystem, network, process, and inference controls. Use when creating, editing, applying, or reviewing sandbox security policies, network egress rules, or filesystem permissions. |
Crafting NemoClaw Policies
OpenShell policies control what a NemoClaw sandbox can access. Policies are YAML files with five sections: filesystem, landlock, process, network, and inference. The NemoClaw blueprint applies initial policies at launch — these commands modify them at runtime without restarting.
All policy commands run from the host.
Quick Start: Policy Presets
NemoClaw includes built-in policy presets for common use cases:
nemoclaw <name> policy-add
nemoclaw <name> policy-list
For custom policies, follow the full workflow below.
Custom Policy Workflow
- Choose a template or write a custom policy
- Validate the policy:
python scripts/validate_policy.py <file>
- Apply to sandbox:
openshell policy set <name> --policy <file> --wait
- Verify:
openshell policy get <name>
Apply a Policy
openshell policy set <sandbox-name> --policy policy.yaml --wait
The --wait flag blocks until the policy engine confirms the update is active. Add --timeout 120 for a custom timeout.
Review Active Policy
openshell policy get <sandbox-name>
openshell policy get <sandbox-name> --rev 3
Policy Templates
Choose a template based on your use case:
Policy Structure Overview
version: 1
filesystem_policy:
include_workdir: true
read_only: [/usr, /lib, /proc, /etc]
read_write: [/sandbox, /tmp]
landlock:
compatibility: best_effort
process:
run_as_user: sandbox
run_as_group: sandbox
network_policies:
<policy-name>:
name: <human-readable-name>
endpoints:
- host: <hostname>
port: 443
protocol: rest
tls: terminate
enforcement: enforce
rules:
- allow:
method: GET
path: /**
binaries:
- { path: /usr/local/bin/openclaw }
Validation
Run the bundled validation script before applying:
python scripts/validate_policy.py policy.yaml
Checks for: valid YAML structure, required fields, endpoint format, TLS settings.
Detailed References
Full policy field reference: See policy-schema.md