Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -21,6 +21,7 @@ filesystem_policy:
- /proc
- /dev/urandom
- /app
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /etc
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
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 @@ -22,6 +22,7 @@ filesystem_policy:
- /proc
- /dev/urandom
- /app
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /etc
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
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 @@ -18,6 +18,7 @@ filesystem_policy:
- /proc
- /dev/urandom
- /app
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /etc
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
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 @@ -18,6 +18,7 @@ filesystem_policy:
- /proc
- /dev/urandom
- /app
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /etc
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ filesystem_policy:
- /proc
- /dev/urandom
- /app
- /run/nemoclaw/managed-startup-ca-bundle.pem
- /etc
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
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 @@ -26,6 +26,7 @@ filesystem_policy:
- /proc
- /dev/urandom
- /app
- /run/nemoclaw/managed-startup-ca-bundle.pem
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- /etc
- /var/log
- /var/lib/dpkg # Allow package-version inspection without package mutation.
Expand Down
35 changes: 35 additions & 0 deletions src/lib/onboard/initial-policy-real-policy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import YAML from "yaml";

import { SHIPPED_MANAGED_IMAGE_AGENTS } from "./managed-image/contract";
import { MANAGED_STARTUP_MERGED_CA_FILE } from "./managed-startup/image-runtime";
import { prepareInitialSandboxCreatePolicy } from "./initial-policy";

type PolicyRule = {
Expand Down Expand Up @@ -70,6 +72,39 @@ describe("initial sandbox policy real preset merge", () => {
{ path: ["agents", "hermes", "policy-permissive.yaml"], agent: "hermes" },
] as const;

const managedStartupCaPolicyCases = [
...shippingPolicyCases,
{
path: ["agents", "langchain-deepagents-code", "policy-additions.yaml"],
agent: "langchain-deepagents-code",
},
] as const;

it("covers every shipped managed-image agent in the managed startup CA policy cases", () => {
expect(new Set(managedStartupCaPolicyCases.map(({ agent }) => agent))).toEqual(
new Set(SHIPPED_MANAGED_IMAGE_AGENTS),
);
});
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

it.each(managedStartupCaPolicyCases)(
"grants $agent policy $path exact read-only access to the managed startup CA bundle (#9360)",
(policyCase) => {
const prepared = prepareInitialSandboxCreatePolicy(repoPath(...policyCase.path), [], {
agentName: policyCase.agent,
});
const policy = readPreparedPolicy(prepared);
const readOnly = policy.filesystem_policy?.read_only ?? [];
const readWrite = policy.filesystem_policy?.read_write ?? [];

expect(readOnly, policyCase.path.join("/")).toContain(MANAGED_STARTUP_MERGED_CA_FILE);
expect(readWrite, policyCase.path.join("/")).not.toContain(MANAGED_STARTUP_MERGED_CA_FILE);
expect(readOnly, policyCase.path.join("/")).not.toContain("/run");
expect(readWrite, policyCase.path.join("/")).not.toContain("/run");
expect(readOnly, policyCase.path.join("/")).not.toContain("/run/nemoclaw");
expect(readWrite, policyCase.path.join("/")).not.toContain("/run/nemoclaw");
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
},
);

it.each([
{
path: ["nemoclaw-blueprint", "policies", "openclaw-sandbox.yaml"],
Expand Down
Loading