You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SECURITY] No command pattern denylist — agents can execute destructive operations unchecked #796
NemoClaw sandboxes rely on filesystem and network policies (via OpenShell Landlock/seccomp) to contain agent actions. However, there is no command-level filtering — agents can execute arbitrary commands within the sandbox, including destructive operations like:
rm -rf /sandbox/*
dd if=/dev/zero of=/dev/sda
chmod -R 777 /
curl with encoded/obfuscated payloads
Shell injection via backticks, $(), or pipe chains
Impact
An agent that is prompt-injected or behaves unexpectedly can destroy all writable data within the sandbox before any policy layer intervenes. Filesystem policies restrict WHERE the agent can write, but not WHAT commands it runs in writable areas.
Proposed Design
Implement a zero-latency deterministic pattern denylist that evaluates every command before execution:
DENY_PATTERNS= [
r"rm\s+(-[rf]+\s+)?/", # recursive delete from rootr"dd\s+if=", # raw disk operationsr"chmod\s+(-R\s+)?[0-7]{3}\s+/", # recursive permission changesr"mkfs\.", # filesystem formattingr">\s*/dev/", # writing to devicesr"\|\s*sh\b", # piping to shellr"curl.*\|\s*(bash|sh)", # download and execute
]
This runs BEFORE any LLM-based verification, at zero token cost, with zero variance. Same input, same decision, every time. Should be implemented as a pre-execution hook in the sandbox runtime.
Alternatives Considered
PR #794 implements credential redaction in CLI output, which addresses secret leakage in logs. This proposal is distinct — it targets command execution filtering before the command runs, not output sanitization after. They operate at different points in the execution pipeline and are complementary.
Category
enhancement: feature
Checklist
I searched existing issues and this is not a duplicate
This is a design proposal, not a "please build this" request
✨ Thanks for submitting this suggestion with a detailed analysis, it addresses a security concern that could improve the security of NemoClaw, which could prevent destructive operations.
The writable surface this issue is concerned about was significantly reduced in #1121 (Landlock read-only /sandbox, DAC-protected .nemoclaw parent). The remaining writable paths (/tmp, .openclaw-data, .nemoclaw/{state,staging}) are scoped to agent runtime state that's ephemeral by design.
A regex command denylist would be trivially bypassable (encoding, indirection, non-shell languages) and high-maintenance. The Landlock + DAC layering already constrains blast radius at the kernel level, which is the right layer for this.
The residual risk is the agent destroying its own workspace data within the writable paths. Given that sandboxes are designed to be ephemeral and recreatable, and that a regex denylist is straightforward to bypass via encoding, indirection, or non-shell languages (python3 -c, node -e), the maintenance cost outweighs the security benefit. A determined attacker who can prompt-inject the agent can trivially evade string matching.
I'd recommend closing this now that the kernel-level protections cover the threat model. If workspace durability becomes a concern in the future, periodic snapshots (which already exist in the plugin) are a more robust approach than command filtering.
Thanks for implementing #804. The Landlock + DAC approach is solid. For #796, my implementation handles the encoding/indirection bypasses you mentioned through command normalization before pattern matching. Happy to share the approach if useful
The sandbox security model is containment, not command filtering. We actively want agents to have full operational freedom inside the sandbox, that's the product value. The security boundary is the sandbox itself: Landlock restricts filesystem access, network policy restricts egress, process limits prevent resource abuse. If the agent destroys its own ephemeral workspace, that's bounded and recoverable.
Command normalization before pattern matching still leaves non-shell execution paths wide open (python3 -c, node -e, compiled binaries, /proc/self/exe tricks). Maintaining parity across every interpreter available in the image is an arms race with no finish line.
cc: @brandonpelfrey
Given we're focusing currently on hardening the sandbox boundary rather than trying to restrict what happens inside the sandbox, I'm closing this. Thank you for your discussion.
Activity
h-network commentedon Mar 24, 2026
The following issues compliment the initial list and should be considered to be combined :
wscurran commentedon Mar 25, 2026
✨ Thanks for submitting this suggestion with a detailed analysis, it addresses a security concern that could improve the security of NemoClaw, which could prevent destructive operations.
Possibly related open PRs:
#119 security: fix command injection in Telegram bridge,
#871 security: enforce process limit to prevent fork bombs in sandbox,
#870 feat(security): add prompt injection scanner module
prekshivyas commentedon Mar 31, 2026
The writable surface this issue is concerned about was significantly reduced in #1121 (Landlock read-only
/sandbox, DAC-protected.nemoclawparent). The remaining writable paths (/tmp,.openclaw-data,.nemoclaw/{state,staging}) are scoped to agent runtime state that's ephemeral by design.A regex command denylist would be trivially bypassable (encoding, indirection, non-shell languages) and high-maintenance. The Landlock + DAC layering already constrains blast radius at the kernel level, which is the right layer for this.
cc: @cv
prekshivyas commentedon Mar 31, 2026
The residual risk is the agent destroying its own workspace data within the writable paths. Given that sandboxes are designed to be ephemeral and recreatable, and that a regex denylist is straightforward to bypass via encoding, indirection, or non-shell languages (
python3 -c,node -e), the maintenance cost outweighs the security benefit. A determined attacker who can prompt-inject the agent can trivially evade string matching.I'd recommend closing this now that the kernel-level protections cover the threat model. If workspace durability becomes a concern in the future, periodic snapshots (which already exist in the plugin) are a more robust approach than command filtering.
cc: @cv
h-network commentedon Mar 31, 2026
Thanks for implementing #804. The Landlock + DAC approach is solid. For #796, my implementation handles the encoding/indirection bypasses you mentioned through command normalization before pattern matching. Happy to share the approach if useful
prekshivyas commentedon Mar 31, 2026
The sandbox security model is containment, not command filtering. We actively want agents to have full operational freedom inside the sandbox, that's the product value. The security boundary is the sandbox itself: Landlock restricts filesystem access, network policy restricts egress, process limits prevent resource abuse. If the agent destroys its own ephemeral workspace, that's bounded and recoverable.
Command normalization before pattern matching still leaves non-shell execution paths wide open (python3 -c, node -e, compiled binaries, /proc/self/exe tricks). Maintaining parity across every interpreter available in the image is an arms race with no finish line.
cc: @brandonpelfrey
brandonpelfrey commentedon Mar 31, 2026
Given we're focusing currently on hardening the sandbox boundary rather than trying to restrict what happens inside the sandbox, I'm closing this. Thank you for your discussion.
h-network commentedon Mar 31, 2026
For the record: this issue proposed a command denylist. It was closed without implementing one. The label should be ‘not planned,’ not ‘completed
prekshivyas commentedon Apr 1, 2026
@h-network status updated
h-network commentedon Apr 1, 2026
@prekshivyas @migurel
Thank you for updating the label.
Is this a confirmation that Nemoclaw will never have a command/pattern deny list?