Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The following endpoint groups are allowed by default:

* - `npm_registry`
- `registry.npmjs.org:443`
- `/usr/local/bin/openclaw`, `/usr/local/bin/npm`, `/usr/local/bin/node`
- `/usr/local/bin/openclaw` only (openclaw plugins install)
- GET only
Comment thread
coderabbitai[bot] marked this conversation as resolved.

:::
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/network-policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The following endpoint groups are allowed by default:

* - `npm_registry`
- `registry.npmjs.org:443`
- `/usr/local/bin/openclaw`, `/usr/local/bin/npm`, `/usr/local/bin/node`
- `/usr/local/bin/openclaw` only (openclaw plugins install)
- GET only

:::
Expand Down
52 changes: 49 additions & 3 deletions nemoclaw-blueprint/policies/openclaw-sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,10 @@ network_policies:
binaries:
- { path: /usr/local/bin/openclaw }

# npm registry — needed for `openclaw plugins install` and `npm install`.
# Read-only: agents only fetch packages, never publish.
# npm registry — needed for `openclaw plugins install` only.
# Restricted to the openclaw binary so agents cannot use npm directly.
# Users who need npm/node access should add the npm policy preset during onboard.
# Ref: https://github.com/NVIDIA/NemoClaw/issues/1458
npm_registry:
name: npm_registry
Comment on lines +199 to 204

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

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

The documentation tables still describe the baseline npm_registry policy as allowing /usr/local/bin/npm and /usr/local/bin/node (and even “All methods”), but the baseline policy is now restricted to /usr/local/bin/openclaw with GET-only. Please update docs/reference/network-policies.md and .agents/skills/nemoclaw-user-reference/references/network-policies.md to match this policy change so users aren’t misled.

Copilot uses AI. Check for mistakes.
endpoints:
Expand All @@ -210,5 +212,49 @@ network_policies:
- allow: { method: GET, path: "/**" }
binaries:
- { path: /usr/local/bin/openclaw }
Comment on lines 203 to 214

Copilot AI Apr 9, 2026

Copy link

Choose a reason for hiding this comment

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

Given this is a security regression fix (#1458), consider adding a small regression test that asserts the baseline npm_registry binaries list does not include npm/node (e.g., in test/validate-blueprint.test.ts). That will prevent accidental reintroduction of agent npm egress in future edits.

Copilot uses AI. Check for mistakes.
- { path: /usr/local/bin/npm }

# ── Messaging — pre-allowed for OpenClaw agent notifications ────
# Restricted to node processes to prevent arbitrary data exfiltration
# via curl, wget, python, etc. (See: #272)
telegram:
name: telegram
endpoints:
- host: api.telegram.org
port: 443
protocol: rest
enforcement: enforce
tls: terminate
rules:
- allow: { method: GET, path: "/bot*/**" }
- allow: { method: POST, path: "/bot*/**" }
- allow: { method: GET, path: "/file/bot*/**" }
binaries:
- { path: /usr/local/bin/node }

discord:
name: discord
endpoints:
- host: discord.com
port: 443
protocol: rest
enforcement: enforce
tls: terminate
rules:
- allow: { method: GET, path: "/**" }
- allow: { method: POST, path: "/**" }
# WebSocket gateway — must use access: full (CONNECT tunnel) instead
# of protocol: rest. The proxy's HTTP idle timeout (~2 min) kills
# long-lived WebSocket connections; a CONNECT tunnel avoids
# HTTP-level timeouts entirely. Matches presets/discord.yaml. See #409.
- host: gateway.discord.gg
port: 443
access: full
- host: cdn.discordapp.com
port: 443
protocol: rest
enforcement: enforce
tls: terminate
rules:
- allow: { method: GET, path: "/**" }
binaries:
- { path: /usr/local/bin/node }
13 changes: 13 additions & 0 deletions test/validate-blueprint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,19 @@ describe("base sandbox policy", () => {
);
expect(githubHosts).toEqual([]);
});

it("regression #1458: baseline npm_registry must not include npm or node binaries", () => {
const np = policy.network_policies as Record<string, Record<string, unknown>>;
const npmRegistry = np.npm_registry;
expect(npmRegistry).toBeDefined();
const binaries = npmRegistry.binaries as Array<{ path: string }> | undefined;
expect(Array.isArray(binaries)).toBe(true);
const paths = (binaries ?? []).map((b) => b.path).sort();
// Only openclaw CLI should reach the npm registry by default.
// npm/node being in this list lets the agent bypass 'none' policy preset.
// Exact allowlist — adding any binary here requires a deliberate review.
expect(paths).toEqual(["/usr/local/bin/openclaw"]);
});
});

describe("github preset", () => {
Expand Down
Loading