Context
#514 locks openclaw.json with filesystem permissions after startup. This issue tracks the remaining defense-in-depth measures to further harden the sandbox against agent self-modification attacks.
Hardening items
1. Tool policy deny list
Add .openclaw/openclaw.json and gateway restart commands (e.g. openclaw gateway run, kill) to SandboxToolPolicy.deny for the write, edit, and exec tools. This provides a software-level control independent of filesystem permissions.
2. Move config outside writable zone
Mount openclaw.json under a read_only path (e.g. /etc/openclaw/) instead of /sandbox/.openclaw/. This ensures the sandbox filesystem policy itself prevents writes, rather than relying on Unix permissions alone.
3. Enforce Landlock (drop best_effort)
Change landlock.compatibility from best_effort to enforce in nemoclaw-blueprint/policies/openclaw-sandbox.yaml. Audit for any functionality that breaks under strict enforcement.
4. Re-evaluate dangerous auth defaults
scripts/nemoclaw-start.sh sets allowInsecureAuth: True and dangerouslyDisableDeviceAuth: True in the gateway config. Evaluate whether these can be removed or scoped more narrowly (e.g. only in local development mode, not when CHAT_UI_URL points to a remote origin).
5. Lock parent directory
After #514's file-level lock, the agent can still delete openclaw.json from the parent directory if /sandbox/.openclaw/ is writable. Consider locking the directory to root:root 555 while keeping subdirectories (e.g. agents/) writable, or restructuring the directory layout.
Priority
Items 1-2 provide the strongest additional protection. Items 3-5 are incremental hardening.
Context
#514 locks
openclaw.jsonwith filesystem permissions after startup. This issue tracks the remaining defense-in-depth measures to further harden the sandbox against agent self-modification attacks.Hardening items
1. Tool policy deny list
Add
.openclaw/openclaw.jsonand gateway restart commands (e.g.openclaw gateway run,kill) toSandboxToolPolicy.denyfor thewrite,edit, andexectools. This provides a software-level control independent of filesystem permissions.2. Move config outside writable zone
Mount
openclaw.jsonunder aread_onlypath (e.g./etc/openclaw/) instead of/sandbox/.openclaw/. This ensures the sandbox filesystem policy itself prevents writes, rather than relying on Unix permissions alone.3. Enforce Landlock (drop best_effort)
Change
landlock.compatibilityfrombest_efforttoenforceinnemoclaw-blueprint/policies/openclaw-sandbox.yaml. Audit for any functionality that breaks under strict enforcement.4. Re-evaluate dangerous auth defaults
scripts/nemoclaw-start.shsetsallowInsecureAuth: TrueanddangerouslyDisableDeviceAuth: Truein the gateway config. Evaluate whether these can be removed or scoped more narrowly (e.g. only in local development mode, not whenCHAT_UI_URLpoints to a remote origin).5. Lock parent directory
After #514's file-level lock, the agent can still delete
openclaw.jsonfrom the parent directory if/sandbox/.openclaw/is writable. Consider locking the directory toroot:root 555while keeping subdirectories (e.g.agents/) writable, or restructuring the directory layout.Priority
Items 1-2 provide the strongest additional protection. Items 3-5 are incremental hardening.