Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions nemoclaw-blueprint/policies/openclaw-sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,18 @@ network_policies:
binaries:
- { path: /usr/local/bin/openclaw }

# npm registry — needed for `openclaw plugins install` and `npm install`
# npm registry — needed for `openclaw plugins install` and `npm install`.
# Read-only: agents only fetch packages, never publish.
npm_registry:
name: npm_registry
endpoints:
- host: registry.npmjs.org
port: 443
access: full
protocol: rest
enforcement: enforce
tls: terminate
rules:
- allow: { method: GET, path: "/**" }
Comment on lines 159 to +165

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if npm preset documents CONNECT tunneling requirement and verify 
# if there's any documentation about npm_registry vs npm preset differences.

echo "=== Checking npm preset for CONNECT/tunneling documentation ==="
fd -t f 'npm.yaml' --exec cat {}

echo ""
echo "=== Searching for CONNECT tunneling documentation in policies ==="
rg -n -i 'connect|tunnel' --type yaml

echo ""
echo "=== Checking if HEAD method is used elsewhere in policies ==="
rg -n 'method:\s*HEAD' --type yaml

Repository: NVIDIA/NemoClaw

Length of output: 1630


🏁 Script executed:

# Check the test file referenced in the review (test/policies.test.js lines 200-226)
cat -n test/policies.test.js | sed -n '195,230p'

Repository: NVIDIA/NemoClaw

Length of output: 1648


🏁 Script executed:

# Also search for any npm preset or npm_registry configuration in sandbox yaml
rg -n 'npm' nemoclaw-blueprint/policies/openclaw-sandbox.yaml -B 2 -A 5

Repository: NVIDIA/NemoClaw

Length of output: 835


npm CLI likely incompatible with tls: terminate configuration.

The test suite at test/policies.test.js:200-211 explicitly documents that "Package managers (pip, npm, yarn) use CONNECT tunneling which breaks under tls: terminate" and verifies the npm preset uses access: full specifically to support this behavior. The npm_registry endpoint in sandbox.yaml diverges from this pattern by using protocol: rest, enforcement: enforce, and tls: terminate with GET-only rules.

Since npm CLI requires CONNECT tunneling for HTTPS connections through proxies, this configuration will break npm install commands despite the comment claiming support for this use case. Either:

  • Change npm_registry to use access: full (like the npm preset), or
  • Document why npm_registry is expected to work differently than the npm preset.

Consider adding HEAD method to rules if npm checks package metadata before download.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nemoclaw-blueprint/policies/openclaw-sandbox.yaml` around lines 159 - 165,
The npm registry endpoint configuration (the host block for registry.npmjs.org
in openclaw-sandbox.yaml) is incompatible with npm CLI's CONNECT tunneling when
using tls: terminate and protocol: rest; change this endpoint to use access:
full (matching the npm preset) or switch protocol to one that supports
CONNECT/tunneling, set enforcement appropriately (e.g., access: full instead of
enforcement: enforce), and add HEAD to the allowed rules (alongside GET) so npm
metadata checks succeed; update the host block for registry.npmjs.org
accordingly.

binaries:
- { path: /usr/local/bin/openclaw }
- { path: /usr/local/bin/npm }
Expand Down