You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b62c42f
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -355,8 +355,8 @@ The policy needs to go somewhere. Determine which mode applies:
355
355
356
356
| Signal | Mode |
357
357
|--------|------|
358
-
| User names an existing policy file (e.g., "add to dev-sandbox-policy.yaml") |**Update existing file**|
359
-
| User says "update my policy", "add this to my policy file" |**Update existing file** — look for `dev-sandbox-policy.yaml` or ask which file |
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 |
360
360
| User asks to modify an existing policy rule by name |**Update existing file** — edit the named policy in place |
361
361
| User says "create a new policy file" or names a file that doesn't exist |**Create new file**|
362
362
| No file context given |**Present only** — show the YAML and ask if the user wants it written to a file |
@@ -418,7 +418,7 @@ inference:
418
418
419
419
The `filesystem_policy`, `landlock`, `process`, and `inference` sections above are sensible defaults. Tell the user these are defaults and may need adjustment for their environment. The generated `network_policies` block is the primary output.
420
420
421
-
If the user provides a file path, write to it. Otherwise, suggest `dev-sandbox-policy.yaml` for local development or ask where to place it.
421
+
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.
422
422
423
423
### Mode C: Present Only (no file write)
424
424
@@ -427,7 +427,7 @@ Show the generated policy YAML with:
427
427
1. **Summary** — what the policy allows and denies, in plain language
428
428
2. **The YAML** — the complete `network_policies` block, ready to paste
429
429
3. **Integration guidance**:
430
-
- For local dev: add to `dev-sandbox-policy.yaml` under `network_policies`
430
+
- For local dev: add to `deploy/docker/sandbox/dev-sandbox-policy.yaml` under `network_policies`
431
431
- For production: configure via the gateway
432
432
4. **Caveats** — any assumptions made, anything the user should verify
433
433
@@ -545,6 +545,6 @@ private_services:
545
545
## Additional Resources
546
546
547
547
- Full policy schema: [architecture/security-policy.md](../../../architecture/security-policy.md)
548
-
- Example policy file: [dev-sandbox-policy.yaml](../../../dev-sandbox-policy.yaml)
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`)?"
Copy file name to clipboardExpand all lines: architecture/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,7 +198,7 @@ The inference routing system transparently intercepts AI inference API calls fro
198
198
199
199
| Component | Location | Role |
200
200
|---|---|---|
201
-
| OPA `network_action` rule |`dev-sandbox-policy.rego`| Returns `inspect_for_inference` when no explicit policy match and inference routes exist |
201
+
| OPA `network_action` rule |`crates/navigator-sandbox/data/sandbox-policy.rego`| Returns `inspect_for_inference` when no explicit policy match and inference routes exist |
@@ -567,8 +567,8 @@ The `create` and `update` commands perform protocol auto-detection when `--proto
567
567
568
568
Running `mise run cluster:sandbox` starts a standalone sandbox container with inference routing pre-configured. The task mounts three files into the container:
The container receives `NEMOCLAW_INFERENCE_ROUTES=/var/navigator/inference-routes.yaml` to enable standalone inference routing. `NVIDIA_API_KEY` is always forwarded from the host environment (empty string if unset).
The gateway returns a `SandboxPolicy` protobuf message (defined in `proto/sandbox.proto`). The sandbox supervisor converts this proto into JSON, validates L7 config, expands presets, and loads it into the OPA engine using baked-in Rego rules (`dev-sandbox-policy.rego` compiled via `include_str!`). See `crates/navigator-sandbox/src/opa.rs` -- `OpaEngine::from_proto()`.
48
+
The gateway returns a `SandboxPolicy` protobuf message (defined in `proto/sandbox.proto`). The sandbox supervisor converts this proto into JSON, validates L7 config, expands presets, and loads it into the OPA engine using baked-in Rego rules (`sandbox-policy.rego` compiled via `include_str!`). See `crates/navigator-sandbox/src/opa.rs` -- `OpaEngine::from_proto()`.
49
49
50
50
### Policy Loading Sequence
51
51
@@ -421,7 +421,7 @@ Each endpoint defines a network destination and, optionally, L7 inspection behav
Method and command fields use `*` as wildcard for "any". Path patterns use `**` for "match everything" and standard glob patterns with `/` as a delimiter otherwise. See `dev-sandbox-policy.rego` -- `method_matches()`, `path_matches()`, `command_matches()`.
453
+
Method and command fields use `*` as wildcard for "any". Path patterns use `**` for "match everything" and standard glob patterns with `/` as a delimiter otherwise. See `sandbox-policy.rego` -- `method_matches()`, `path_matches()`, `command_matches()`.
454
454
455
455
#### Access Presets
456
456
@@ -524,7 +524,7 @@ flowchart LR
524
524
525
525
This is the single most important behavioral trigger in the policy language. An endpoint with no `protocol` field passes traffic opaquely after the L4 (CONNECT) check. Adding `protocol: rest` activates per-request HTTP parsing and policy evaluation inside the proxy.
526
526
527
-
**Implementation path**: After L4 CONNECT is allowed, the proxy calls `query_l7_config()` which evaluates the Rego rule `data.navigator.sandbox.matched_endpoint_config`. This rule only matches endpoints that have a `protocol` field set (see `dev-sandbox-policy.rego` line `ep.protocol`). If a config is returned, the proxy enters `relay_with_inspection()` instead of `copy_bidirectional()`. See `crates/navigator-sandbox/src/proxy.rs` -- `handle_tcp_connection()`.
527
+
**Implementation path**: After L4 CONNECT is allowed, the proxy calls `query_l7_config()` which evaluates the Rego rule `data.navigator.sandbox.matched_endpoint_config`. This rule only matches endpoints that have a `protocol` field set (see `sandbox-policy.rego` line `ep.protocol`). If a config is returned, the proxy enters `relay_with_inspection()` instead of `copy_bidirectional()`. See `crates/navigator-sandbox/src/proxy.rs` -- `handle_tcp_connection()`.
528
528
529
529
**Validation requirement**: When `protocol` is set, either `rules` or `access` must also be present. An endpoint with `protocol` but no rules/access is rejected at validation time because it would deny all traffic (no allow rules means nothing matches). See `crates/navigator-sandbox/src/l7/mod.rs` -- `validate_l7_policies()`.
530
530
@@ -1055,7 +1055,7 @@ The OPA engine evaluates two categories of rules:
1055
1055
| `allow_request` | `input.network.*`, `input.exec.*`, `input.request.method`, `input.request.path` | `true` if the request matches any rule in the matched endpoint |
1056
1056
| `request_deny_reason` | Same input | Human-readable deny message |
1057
1057
1058
-
See `dev-sandbox-policy.rego` for the full Rego implementation.
1058
+
See `sandbox-policy.rego` for the full Rego implementation.
0 commit comments