Skip to content

Commit aa4268d

Browse files
authored
refactor(sandbox): sandboxes are managed as separate community images (#267)
1 parent a336266 commit aa4268d

File tree

27 files changed

+418
-1704
lines changed

27 files changed

+418
-1704
lines changed

.agents/skills/generate-sandbox-policy/SKILL.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ Key sections to reference:
167167
- **Private IP Access via `allowed_ips`** — CIDR allowlist for private IP space
168168
- **Validation Rules** — what combinations are valid/invalid
169169

170-
Also read the example policy for real-world patterns:
170+
Also read the example policy for real-world patterns. The default policy is baked into the community base image (`ghcr.io/nvidia/openshell-community/sandboxes/base:latest`). For reference, consult the policy schema documentation:
171171

172172
```
173-
Read deploy/docker/sandbox/dev-sandbox-policy.yaml
173+
Read architecture/security-policy.md
174174
```
175175

176176
## Step 4: Choose Policy Shape
@@ -355,8 +355,8 @@ The policy needs to go somewhere. Determine which mode applies:
355355

356356
| Signal | Mode |
357357
|--------|------|
358-
| User names an existing policy file (e.g., "add to deploy/docker/sandbox/dev-sandbox-policy.yaml") | **Update existing file** |
359-
| User says "update my policy", "add this to my policy file" | **Update existing file**look for `deploy/docker/sandbox/dev-sandbox-policy.yaml` or ask which file |
358+
| User names an existing policy file (e.g., "add to my-sandbox-policy.yaml") | **Update existing file** |
359+
| User says "update my policy", "add this to my policy file" | **Update existing file** — ask which file to update |
360360
| User asks to modify an existing policy rule by name | **Update existing file** — edit the named policy in place |
361361
| User says "create a new policy file" or names a file that doesn't exist | **Create new file** |
362362
| No file context given | **Present only** — show the YAML and ask if the user wants it written to a file |
@@ -414,7 +414,7 @@ network_policies:
414414

415415
The `filesystem_policy`, `landlock`, and `process` sections above are sensible defaults. Tell the user these are defaults and may need adjustment for their environment. Cluster inference is configured separately through `openshell cluster inference set/get`. The generated `network_policies` block is the primary output.
416416

417-
If the user provides a file path, write to it. Otherwise, suggest `deploy/docker/sandbox/dev-sandbox-policy.yaml` for local development or ask where to place it.
417+
If the user provides a file path, write to it. Otherwise, ask where to place it. A common convention is a project-local policy file (e.g., `sandbox-policy.yaml`) passed to `openshell sandbox create --policy <path>` or set via the `OPENSHELL_SANDBOX_POLICY` env var.
418418

419419
### Mode C: Present Only (no file write)
420420

@@ -423,7 +423,7 @@ Show the generated policy YAML with:
423423
1. **Summary** — what the policy allows and denies, in plain language
424424
2. **The YAML** — the complete `network_policies` block, ready to paste
425425
3. **Integration guidance**:
426-
- For local dev: add to `deploy/docker/sandbox/dev-sandbox-policy.yaml` under `network_policies`
426+
- Save to a local file and pass via `openshell sandbox create --policy <path>` or set `OPENSHELL_SANDBOX_POLICY=<path>`
427427
- For production: configure via the gateway
428428
4. **Caveats** — any assumptions made, anything the user should verify
429429

@@ -541,6 +541,6 @@ private_services:
541541
## Additional Resources
542542
543543
- Full policy schema: [architecture/security-policy.md](../../../architecture/security-policy.md)
544-
- Example policy file: [dev-sandbox-policy.yaml](../../../deploy/docker/sandbox/dev-sandbox-policy.yaml)
544+
- Default policy: baked into the community base image (`ghcr.io/nvidia/openshell-community/sandboxes/base:latest`)
545545
- Rego evaluation rules: [sandbox-policy.rego](../../../crates/navigator-sandbox/data/sandbox-policy.rego)
546546
- For translation examples from real API docs, see [examples.md](examples.md)

.agents/skills/generate-sandbox-policy/examples.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -729,11 +729,11 @@ An exact IP is treated as `/32` — only that specific address is permitted.
729729

730730
### Example F1: Add a New Policy to an Existing File
731731

732-
**User**: "Add read-only access to api.github.com for curl to my deploy/docker/sandbox/dev-sandbox-policy.yaml"
732+
**User**: "Add read-only access to api.github.com for curl to my sandbox-policy.yaml"
733733

734734
**Agent workflow**:
735735

736-
1. Read `deploy/docker/sandbox/dev-sandbox-policy.yaml`
736+
1. Read `sandbox-policy.yaml`
737737
2. Check that no existing policy already covers `api.github.com:443` — if one does, warn about overlap
738738
3. Check that the key `github_readonly` doesn't already exist
739739
4. Insert the new policy under `network_policies`:
@@ -760,11 +760,11 @@ The agent uses `StrReplace` to insert after the last existing policy in the `net
760760

761761
### Example F2: Modify an Existing Policy (Add an Endpoint)
762762

763-
**User**: "Add sentry.io to the claude_code policy in deploy/docker/sandbox/dev-sandbox-policy.yaml"
763+
**User**: "Add sentry.io to the claude_code policy in my sandbox-policy.yaml"
764764

765765
**Agent workflow**:
766766

767-
1. Read `deploy/docker/sandbox/dev-sandbox-policy.yaml`
767+
1. Read `sandbox-policy.yaml`
768768
2. Find the `claude_code` policy
769769
3. Check that `sentry.io:443` isn't already listed in its endpoints
770770
4. Add the new endpoint to the existing `endpoints` list:
@@ -874,11 +874,11 @@ The agent notes that `filesystem_policy`, `landlock`, and `process` are sensible
874874

875875
### Example F5: Handle a Key Conflict
876876

877-
**User**: "Add an nvidia policy to deploy/docker/sandbox/dev-sandbox-policy.yaml"
877+
**User**: "Add an nvidia policy to my sandbox-policy.yaml"
878878

879879
**Agent workflow**:
880880

881-
1. Read `deploy/docker/sandbox/dev-sandbox-policy.yaml`
881+
1. Read `sandbox-policy.yaml`
882882
2. Find that a policy key `nvidia` already exists
883883
3. **Ask the user**: "A policy named `nvidia` already exists. Do you want to replace it, add endpoints to it, or use a different name (e.g., `nvidia_inference_v2`)?"
884884
4. Proceed based on the user's answer

0 commit comments

Comments
 (0)