NemoClaw Security Best Practices: Controls, Risks, and Posture Profiles
NemoClaw Security Best Practices: Controls, Risks, and Posture Profiles
NemoClaw ships with deny-by-default security controls across four layers: network, filesystem, process, and inference. You can tune every control, but each change shifts the risk profile. This page documents every configurable knob, its default, what it protects, the concrete risk of relaxing it, and a recommendation for common use cases.
For background on how the layers fit together, refer to How It Works.
Protection Layers at a Glance
NemoClaw enforces security at four layers. NemoClaw locks some when it creates the sandbox and requires a restart to change them. You can hot-reload others while the sandbox runs.
The following diagram shows the default posture immediately after nemoclaw onboard, before you approve any endpoints or apply any presets.
Network Controls
NemoClaw controls which hosts, ports, and HTTP methods the sandbox can reach, and lets operators approve or deny requests in real time.
Deny-by-Default Egress
The sandbox blocks all outbound connections unless you explicitly list the endpoint in the policy file nemoclaw-blueprint/policies/openclaw-sandbox.yaml.
Binary-Scoped Endpoint Rules
Each network policy entry restricts which executables can reach the endpoint using the binaries field.
OpenShell identifies the calling binary by reading /proc/<pid>/exe (the kernel-trusted executable path, not argv[0]), walking the process tree for ancestor binaries, and computing a SHA256 hash of each binary on first use.
If someone replaces a binary while the sandbox runs, the hash mismatch triggers an immediate deny.
Path-Scoped HTTP Rules
Endpoint rules restrict allowed HTTP methods and URL paths.
L4-Only vs L7 Inspection (protocol Field)
All sandbox egress goes through OpenShellโs CONNECT proxy.
The protocol field on an endpoint controls whether the proxy also inspects individual HTTP requests inside the tunnel.
Operator Approval Flow
When the agent reaches an unlisted endpoint, OpenShell blocks the request and prompts the operator in the TUI.
Policy Presets
NemoClaw ships preset policy files in nemoclaw-blueprint/policies/presets/ for common integrations.
Recommendation: Apply presets only when the agentโs task requires the integration. Review the presetโs YAML file before applying to understand the endpoints, methods, and binary restrictions it adds.
Filesystem Controls
NemoClaw restricts which paths the agent can read and write, protecting system binaries, configuration files, and gateway credentials.
Read-Only System Paths
The container mounts system directories read-only to prevent the agent from modifying binaries, libraries, or configuration files.
Agent Config Directory
The /sandbox/.openclaw directory contains the OpenClaw gateway configuration (model routing, CORS settings, channel config).
The current entrypoint reads the gateway auth token from OpenClaw config when present, exports it as OPENCLAW_GATEWAY_TOKEN, and writes it to /tmp/nemoclaw-proxy-env.sh so interactive sandbox sessions can reach the gateway through the static /sandbox/.bashrc and /sandbox/.profile source shims.
In root mode, the gateway process still runs as the separate gateway user, but the token is intentionally available to sandbox shells for local gateway access.
Writable agent state such as plugins, skills, hooks, and workspace metadata lives directly under /sandbox/.openclaw.
By default, this directory starts writable so the agent can manage its own config, install skills, and write to standard home-directory paths natively. For sensitive workloads, use a reviewed host-side immutability workflow after initial setup so config and writable state entry points cannot be changed by the sandbox user.
- DAC permissions (default). The sandbox user owns
/sandbox/.openclawwith mode700andopenclaw.jsonwith mode600, so the agent can read and write config directly. - Config integrity hash. The image includes a SHA256 hash of
openclaw.json. In the default mutable state,.config-hashis sandbox-owned and is not a tamper-proof trust anchor, so startup does not fail closed on that hash. When the hash is root-owned and read-only, startup enforces it and refuses to start if the hash does not match. - Gateway token environment. The gateway exports
OPENCLAW_GATEWAY_TOKENand writes it to/tmp/nemoclaw-proxy-env.shfor interactive sandbox sessions. Keep this in mind when deciding whether a workload should run with mutable config or an immutable config posture.
Writable Paths
The agent has read-write access to /sandbox, /tmp, and /dev/null.
Landlock LSM Enforcement
Landlock is a Linux Security Module that enforces filesystem access rules at the kernel level.
Process Controls
NemoClaw limits the capabilities, user privileges, and resource quotas available to processes inside the sandbox.
Capability Drops
The entrypoint drops dangerous Linux capabilities from the bounding set at startup using capsh.
This limits what capabilities any child process (gateway, sandbox, agent) can ever acquire.
When the entrypoint switches from root to the sandbox and gateway users, it uses setpriv when available to remove the remaining privilege-separation capabilities from the child process at the same time as the user change.
The initial entrypoint drop removes cap_sys_admin, cap_sys_ptrace, cap_net_raw, cap_dac_override, cap_sys_chroot, cap_fsetid, cap_setfcap, cap_mknod, cap_audit_write, and cap_net_bind_service.
During setpriv step-down, the child process also loses cap_setuid, cap_setgid, cap_fowner, cap_chown, and cap_kill.
This is best-effort: if capsh is not available or CAP_SETPCAP is not in the bounding set, the entrypoint logs a warning and continues with the default capability set.
If setpriv is unavailable, the entrypoint falls back to gosu and logs a warning that the remaining bounding-set capabilities were retained for the child process.
For additional protection, pass --cap-drop=ALL with docker run or Compose (see Sandbox Hardening).
Gateway Process Isolation
The OpenClaw gateway runs as a separate gateway user, not as the sandbox user that runs the agent.
No New Privileges
The no-new-privileges flag prevents processes from gaining additional privileges through setuid binaries or capability inheritance.
Process Limit
A process limit caps the number of processes the sandbox user can spawn.
The entrypoint sets both soft and hard limits using ulimit -u 512.
This is best-effort: if the container runtime restricts ulimit modification, the entrypoint logs a security warning and continues without the limit.
Non-Root User
The sandbox runs agent processes as a dedicated sandbox user and group.
The entrypoint starts as root for privilege separation, then drops to the sandbox user for all agent commands.
PATH Hardening
The entrypoint locks the PATH environment variable to system directories, preventing the agent from injecting malicious binaries into command resolution.
Build Toolchain Removal
The Dockerfile removes compilers and network probes from the runtime image.
Image Digest Pinning
The blueprint references the sandbox image by an immutable @sha256: digest instead of a mutable tag such as :latest.
A registry compromise or accidental force-push cannot silently swap the sandbox image.
Auth Profile Permissions
The entrypoint and migration flows enforce chmod 600 on all auth-profiles.json files under ~/.openclaw.
This prevents other users on the host from reading stored credentials.
Gateway Authentication Controls
The OpenClaw gateway authenticates devices that connect to the Control UI dashboard. NemoClaw hardens these defaults at image build time.
Device Authentication
Device authentication requires each connecting device to go through a pairing flow before it can interact with the gateway.
Gateway Bind Address
NemoClaw binds the OpenShell gateway to loopback by default.
Insecure Auth Derivation
The allowInsecureAuth setting controls whether the gateway permits non-HTTPS authentication.
Auto-Pair Client Allowlist
The auto-pair watcher automatically approves device pairing requests from recognized clients, so you do not need to manually approve the Control UI.
CLI Secret Redaction
The CLI automatically redacts secret patterns (API keys, bearer tokens, provider credentials) from command output and error messages before logging them.
Memory Secret Scanner
The NemoClaw plugin blocks the agent from writing likely secrets (API keys, tokens, private keys) into persistent memory files. The scanner intercepts Write, Edit, and similar tool calls targeting memory and workspace paths before they reach disk.
Inference Controls
OpenShell routes all inference traffic through the gateway to isolate provider credentials from the sandbox.
Routed Inference through inference.local
The OpenShell gateway intercepts all inference requests from the agent and routes them to the configured provider. The agent never receives the provider API key.
Provider Trust Tiers
Different inference providers have different trust and cost profiles.
Recommendation: For sensitive workloads, use local Ollama to keep data on-premise. For general use, NVIDIA Endpoints provide a good balance of capability and trust. Review the data policies of any cloud provider you use.
Experimental Providers
The NEMOCLAW_EXPERIMENTAL=1 environment variable gates local NVIDIA NIM and the managed vLLM install/start path. An already-running vLLM server on localhost:8000 is offered in the menu without a flag, because selecting it is an explicit user action.
Posture Profiles
The following profiles describe how to configure NemoClaw for different use cases. These are not separate policy files. They provide guidance on which controls to keep tight or relax.
Locked-Down (Default)
Use for always-on assistants with minimal external access.
- Keep all defaults. Do not add presets.
- Use operator approval for any endpoint the agent requests.
- Use NVIDIA Endpoints or local Ollama for inference.
- Monitor the TUI for unexpected network requests.
Development
Use when the agent needs package registries, Docker Hub, or broader GitHub access during development tasks.
- Apply the
pypiandnpmpresets for package installation. - Keep binary restrictions on all presets.
- Review the agentโs network activity periodically with
openshell term. - Use operator approval for any endpoint not covered by a preset.
Integration Testing
Use when the agent talks to internal APIs or third-party services during testing.
- Add custom endpoint entries with tight path and method restrictions.
- Use
protocol: restfor all HTTP APIs to maintain inspection. - Use operator approval for unknown endpoints during test runs.
- Review and clean up the baseline policy after testing. Remove endpoints that are no longer needed.
Common Mistakes
The following patterns weaken security without providing meaningful benefit.
Known Limitations
Related Topics
- Network Policies for the full baseline policy reference.
- Customize the Network Policy for static and dynamic policy changes.
- Approve or Deny Network Requests for the operator approval flow.
- Sandbox Hardening for container-level security measures.
- Inference Options for provider configuration details.
- How It Works for the protection layer architecture.