Understand Filesystem Controls
NemoClaw restricts which paths the agent can read and write, protecting system binaries, configuration files, and gateway credentials.
OpenShell covers additional filesystem enforcement details, including hard_requirement compatibility mode for Landlock and policy path validation rules.
Refer to the Filesystem Controls section of the OpenShell Security Best Practices.
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 system-wide shell hooks.
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 the sandbox user cannot change config or high-risk state entry points.
The immutability workflow derives its path plan from the selected agent manifest.
For OpenClaw, it locks agents, canvas, cron, devices, extensions, hooks, memory, plugins, profiles, skills, telegram, wechat, whatsapp, workspace, and workspace-* directories to root:sandbox and removes group and world write access.
The root-only helper traverses from opened directory descriptors with no-follow semantics instead of using recursive pathname chown or chmod.
Read-only preflight and unlock operations reject unsafe external symlinks, hardlinks, special files, cross-device entries, and entries that race the traversal without modifying them.
After the top-level config binding is frozen, lockdown makes containment monotonic. It removes unsafe symlinks, special entries, and protected-root names that are not directories through descriptor-relative operations without following their targets.
For protected regular files, lockdown publishes a fresh inode, severing hardlinks while preserving file content, read/execute mode, timestamps, and supported extended attributes; this also revokes write authority held through a descriptor opened before shields up.
The OpenClaw gateway (a member of the sandbox group) keeps read access to plugin and agent code; the sandbox user can no longer write them.
The same workflow locks the secret-bearing credentials and identity directories.
The guard sets each confidentiality root to root:sandbox 0710, including a non-empty credentials directory.
It sets every nested directory and file to root:root and removes all group and world permission bits.
The sandbox group cannot list, create, or remove entries in a confidentiality root, and neither the sandbox user nor gateway can read stored secrets.
They can inspect metadata for a direct child only when they already know its name.
Probing a missing direct child, such as the legacy credentials/oauth.json, returns ENOENT instead of EACCES.
Restoring the mutable-default posture returns those directories to sandbox:sandbox 2770.
For plan-aware current images and host-injected transitions, each agent manifest declares only its own protected paths, confidential paths, dynamic prefixes, and writable subpaths. The lock helper applies only that selected manifest plan and skips declared paths that are not present.
Historical OpenClaw and Hermes images that have a bundled helper but no generated plan use the helper’s reviewed legacy inventory until the sandbox is rebuilt. State directories without a Shields declaration remain mutable.
Inside a locked tree, the helper keeps each agents/<agent-id>/sessions/ root at sandbox:sandbox 2770 so the OpenClaw TUI can create and write session metadata under an otherwise root-owned parent.
After containment, when an agent directory has no sessions entry, lockdown creates that carve-out root.
An agent booting for the first time under an active lock can then write sessions. It validates the carve-out root but deliberately does not traverse or rewrite live session descendants.
Cross-device entries, detected traversal races, or failures to remove or replace an unsafe entry make lockdown fail closed with the exact path and reason.
- DAC permissions (default).
The sandbox user owns
/sandbox/.openclawwith mode2770(setgidsandbox:sandbox) andopenclaw.jsonwith mode660, so the agent and its group can read and write config directly. A reviewed host-side immutability workflow should compare the intended ownership and mode with the live sandbox filesystem before treating the config tree as locked. - 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. - Content integrity seal.
A clean immutable config lock can capture a SHA-256 seal of
openclaw.jsonand other locked files into host-side state. Verification recomputes hashes inside the sandbox and surfaces drift on mismatch, so a host-root tamper that flips permissions back to444 root:rootafter rewriting the file is still flagged. Sandboxes locked before the seal landed have no recorded hash; permission-only verification cannot prove their bytes match the image original, so the seal is not a retroactive proof of integrity for legacy state. The same limitation applies when the locked file set grew after the existing seal was captured. Rebuild the sandbox for a known-good baseline before trusting a new seal. - 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, /dev/null, and /dev/pts.
Landlock LSM Enforcement
Landlock is a Linux Security Module that enforces filesystem access rules at the kernel level.