Conversation
factory-octavian
pushed a commit
to factory-octavian/OpenShell-Community
that referenced
this pull request
Apr 1, 2026
…a file (!18) Closes NVIDIA#26 ## Summary Consolidates sandbox policy data into `dev-sandbox-policy.yaml` and deletes `dev-sandbox-policy-data.rego`. The YAML file becomes the single source of truth for sandbox policy data across both paths: - **`nav create sandbox`** (CLI reads YAML → proto → gRPC → server stores → sandbox fetches) - **`mise run sandbox`** (sandbox reads YAML directly via regorus) ## Why YAML The policy data file is user-facing — it's the interface users interact with to configure sandbox security policy (allowed endpoints, binary identities, filesystem access, etc.). Keeping this as YAML rather than rego: - **Decouples data from enforcement engine** — if we change from OPA/rego to a different policy engine, the user's data file stays the same - **Still works with regorus** — regorus can natively load YAML data via its `yaml` feature, so there's no conversion step in the local dev path - **Enables future indirection** — we can add a transformation layer between the YAML file and what the policy engine receives, without changing the user-facing format ## Changes ### Policy data (`dev-sandbox-policy.yaml`) - Flat top-level structure: `filesystem_policy`, `landlock`, `process`, `inference`, `network_policies` - Renamed `filesystem` → `filesystem_policy` to match rego/proto convention - Deleted `dev-sandbox-policy-data.rego` (was the rego equivalent of this data) ### Rego rules (`dev-sandbox-policy.rego`) - All data references updated: `data.sandbox.*` → `data.*` (dropped `sandbox.` prefix) - `package navigator.sandbox` unchanged (that's the rego rule namespace, not the data path) ### Sandbox entrypoint (`navigator-sandbox`) - `--rego-policy`/`--rego-data` → `--policy-rules`/`--policy-data` - `NAVIGATOR_REGO_POLICY`/`NAVIGATOR_REGO_DATA` → `NAVIGATOR_POLICY_RULES`/`NAVIGATOR_POLICY_DATA` - `from_files()`: loads YAML natively via `regorus::Value::from_yaml_file()` - `from_strings()` and `reload()`: accept YAML data via `Value::from_yaml_str()` - `proto_to_opa_data_json()`: emits data at root level (no `"sandbox"` wrapper) - Enabled regorus `yaml` feature ### CLI (`navigator-cli`) - `DevSandboxPolicyFile.filesystem` → `filesystem_policy` ### Tests - All inline test data converted from rego/JSON to YAML - `test_engine()` uses `from_strings(rules, yaml)` with the dev YAML file ### Documentation - Updated `architecture/plans/sandbox-policy-refactor/plan.md`, `architecture/plans/opa/plan.md`, `architecture/sandbox.md`, `architecture/containers.md`
factory-octavian
pushed a commit
to factory-octavian/OpenShell-Community
that referenced
this pull request
Apr 1, 2026
…#140) Closes NVIDIA#26 All list RPCs (ListSandboxes, ListProviders, ListSandboxPolicies, ListInferenceRoutes) passed the client-provided limit directly to SQL queries with no upper bound. A client could send limit=u32::MAX and cause the server to load all records into memory, risking OOM. This introduces a MAX_PAGE_SIZE constant (1000) and a clamp_limit helper that caps the limit in every list handler before it reaches the persistence layer. Co-authored-by: John Myers <johntmyers@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #25