Skip to content
Closed
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
1 change: 1 addition & 0 deletions agents/hermes/policy-additions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ filesystem_policy:
- /dev/urandom
- /app
- /etc
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
read_write:
Expand Down
1 change: 1 addition & 0 deletions agents/hermes/policy-permissive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ filesystem_policy:
- /dev/urandom
- /app
- /etc
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
read_write:
Expand Down
1 change: 1 addition & 0 deletions agents/langchain-deepagents-code/policy-additions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ filesystem_policy:
- /dev/urandom
- /app
- /etc
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
read_write:
Expand Down
1 change: 1 addition & 0 deletions agents/openclaw/policy-permissive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ filesystem_policy:
- /dev/urandom
- /app
- /etc
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
read_write:
Expand Down
1 change: 1 addition & 0 deletions agents/pi/policy-additions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ filesystem_policy:
- /proc
- /dev/urandom
- /etc
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
read_write:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ filesystem_policy:
- /dev/urandom
- /app
- /etc
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
read_write:
Expand Down
1 change: 1 addition & 0 deletions nemoclaw-blueprint/policies/openclaw-sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ filesystem_policy:
- /dev/urandom
- /app
- /etc
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
read_write:
Expand Down
42 changes: 42 additions & 0 deletions test/managed-startup-ca-policy.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { readFileSync } from "node:fs";

import { describe, expect, it } from "vitest";
import YAML from "yaml";

const CA_BUNDLE = "/run/nemoclaw/managed-startup-ca-bundle.pem";
const POLICY_PATHS = [
"nemoclaw-blueprint/policies/openclaw-sandbox.yaml",
"nemoclaw-blueprint/policies/openclaw-sandbox-permissive.yaml",
"agents/openclaw/policy-permissive.yaml",
"agents/hermes/policy-additions.yaml",
"agents/hermes/policy-permissive.yaml",
"agents/langchain-deepagents-code/policy-additions.yaml",
"agents/pi/policy-additions.yaml",
] as const;

type Policy = {
filesystem_policy?: {
read_only?: string[];
read_write?: string[];
};
};

describe("managed startup CA policy", () => {
it.each(POLICY_PATHS)("grants only exact read access in %s", (policyPath) => {
const policy = YAML.parse(readFileSync(policyPath, "utf8")) as Policy;
const runtimePrefix = "/run/nemoclaw";
const readOnlyRuntimeGrants = (policy.filesystem_policy?.read_only ?? []).filter(
(entry) => entry === runtimePrefix || entry.startsWith(`${runtimePrefix}/`),
);
const readWriteRuntimeGrants = (policy.filesystem_policy?.read_write ?? []).filter(
(entry) => entry === runtimePrefix || entry.startsWith(`${runtimePrefix}/`),
);

expect(policy.filesystem_policy?.read_only).toContain(CA_BUNDLE);
expect(readOnlyRuntimeGrants).toEqual([CA_BUNDLE]);
expect(readWriteRuntimeGrants).toEqual([]);
});
});
Loading