Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .agents/skills/debug-openshell-cluster/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ Common findings:
- Gateway process stopped: inspect exit status and logs.
- Sandbox image missing or pull denied: verify image reference and registry credentials.
- Sandbox fails before readiness with an identity-resolution error: inspect the image's OCI `USER` and matching `/etc/passwd` and `/etc/group` entries, or explicitly set both process identity fields in policy. Root and missing identities are rejected.
- Sandbox fails before readiness with an OCI workspace validation error: inspect the image's `WorkingDir` using the immutable image ID reported by the gateway. Empty, `/`, and explicit `/sandbox` use the managed `/sandbox` compatibility workspace. Any other workdir must be an absolute normalized directory with no symlink components; the final policy UID, primary GID, and supplementary groups must pass the kernel's effective traverse/write checks, including POSIX ACL and LSM decisions. OpenShell does not create, chown, or chmod a non-default image workdir.
- Docker also rejects an image `VOLUME` that covers the workdir or one of its parents because the runtime would mask the immutable path before validation. Move the `VOLUME` below the workspace or remove the declaration.
- A workdir rejected as a special filesystem or OpenShell control-path collision cannot be made valid with permissions. Move the image workdir away from kernel-backed mounts and the concrete supervisor, TLS, token, runtime, and socket paths named in the error.
- Docker driver cannot initialize because it cannot find `openshell-sandbox`: verify `OPENSHELL_DOCKER_SUPERVISOR_BIN`, the sibling binary next to `openshell-gateway`, or the configured supervisor image contains `/openshell-sandbox`.
- Sandbox never registers: check gateway logs and supervisor callback endpoint.
- Supervisor image exits before printing `openshell-sandbox --version`: the image should be the scratch supervisor image from `deploy/docker/Dockerfile.supervisor` and must contain a static executable at `/openshell-sandbox`.
Expand Down
1 change: 0 additions & 1 deletion .agents/skills/generate-sandbox-policy/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,6 @@ filesystem_policy:
- /etc
- /var/log
read_write:
- /sandbox
- /tmp
- /dev/null

Expand Down
1 change: 0 additions & 1 deletion .agents/skills/generate-sandbox-policy/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,6 @@ filesystem_policy:
- /etc
- /var/log
read_write:
- /sandbox
- /tmp
- /dev/null

Expand Down
20 changes: 14 additions & 6 deletions .agents/skills/openshell-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ openshell sandbox create \
```

Key flags:
- `--provider`: Attach one or more providers (repeatable)
- `--provider`: Attach configured credential providers for API keys, tokens, and other secrets (repeatable)
- `--policy`: Custom policy YAML (otherwise uses built-in default or `OPENSHELL_SANDBOX_POLICY` env var)
- `--gpu [COUNT]`: Request the driver's default GPU selection or a specific GPU count
- `--cpu`, `--memory`: Set per-sandbox compute sizing. Docker/Podman apply limits; Kubernetes applies matching requests and limits.
- `--driver-config-json`: Pass experimental driver-specific sandbox configuration
- `--label KEY=VALUE`: Add labels for later selection (repeatable)
- `--env KEY=VALUE`: Inject sandbox environment variables (repeatable)
- `--env KEY=VALUE`: Set non-secret sandbox environment variables (repeatable); use `--provider` for credentials
- `--approval-mode manual|auto`: Control handling of agent-authored policy proposals; `manual` is the default
- `--upload <PATH>[:<DEST>]`: Upload local files into the container working directory or an explicit destination
- `--no-git-ignore`: Disable `.gitignore` filtering for uploads
Expand Down Expand Up @@ -223,17 +223,23 @@ openshell sandbox ssh-config my-sandbox >> ~/.ssh/config
### Upload and download files

```bash
# Upload local files to sandbox
openshell sandbox upload my-sandbox ./src /sandbox/src
# Upload local files to the sandbox working directory
openshell sandbox upload my-sandbox ./src

# Download files from sandbox
openshell sandbox download my-sandbox /sandbox/output ./local-output
# Download a path relative to the sandbox working directory
openshell sandbox download my-sandbox output ./local-output
```

Uploads honor `.gitignore` by default. Add `--no-git-ignore` only when ignored files are intentionally in scope.

Uploads preserve symlinks, including dangling symlinks, instead of dereferencing their targets. A symlink source bypasses Git-aware filtering so the link itself is archived.

When the upload destination is omitted, the CLI discovers the remote working
directory. Uploading a named directory merges it into an existing directory of
the same name, overwriting matching entries without deleting unrelated entries.
Downloads accept paths relative to that working directory or absolute paths
within it.

### Execute a non-interactive command

```bash
Expand All @@ -242,6 +248,8 @@ openshell sandbox exec --name my-sandbox --env MODE=test -- cargo test
```

`sandbox exec` streams output and exits with the remote command's exit code. Use `sandbox connect` for an interactive shell.
Use `--env` only for non-secret values. Attach credentials to the sandbox with a
provider instead of passing API keys, tokens, or other secrets to `sandbox exec`.

### Change attached providers

Expand Down
4 changes: 2 additions & 2 deletions .agents/skills/openshell-cli/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,11 @@ Open an interactive SSH shell. The name defaults to the last-used sandbox. `--ed

### `openshell sandbox upload <name> <path> [dest]`

Upload files using tar-over-SSH. The destination defaults to the container working directory. `.gitignore` filtering is enabled unless `--no-git-ignore` is passed.
Upload files using tar-over-SSH. The CLI discovers the canonical remote working directory when the destination is omitted. A named directory merges into an existing directory of the same name, overwriting matching entries without deleting unrelated entries. `.gitignore` filtering is enabled unless `--no-git-ignore` is passed.

### `openshell sandbox download <name> <path> [dest]`

Download files using tar-over-SSH. The local destination defaults to `.`.
Download files using tar-over-SSH. The sandbox source may be relative to the canonical remote working directory or an absolute path within it. The local destination defaults to `.`.

### `openshell sandbox ssh-config [name]`

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/branch-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ jobs:
- name: Verify telemetry can be compiled out
run: mise run rust:verify:telemetry-off

- name: Verify system CA roots build mode compiles and excludes bundled Mozilla roots
run: mise run rust:verify:system-ca-roots

- name: sccache stats
if: always()
run: |
Expand Down
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,19 @@ ocsf_emit!(event);

- If you change sandbox infrastructure, ensure the relevant sandbox e2e path succeeds.

## Network Sockets

- On latency-sensitive TCP streams, disable Nagle's algorithm so small
request/response frames don't stall on delayed ACKs. Use
`openshell_core::net::set_tcp_nodelay_best_effort` on an accepted or
already-connected stream, or `openshell_core::net::connect_tcp_nodelay_best_effort`
when dialing.
- This applies to loopback/localhost TCP too — the delayed-ACK stall is a timer
behavior, not wire latency.
- You should skip it for unix domain sockets (no Nagle). It's not critical for
test-only connections, though using it on any non-UDS TCP stream — tests
included — is fine and preferred.

## Commits

- Always use [Conventional Commits](https://www.conventionalcommits.org/) format for commit messages
Expand Down
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,24 @@ Project requirements:
- Docker (running)
- Z3 solver library (for the policy prover crate)

### Optional: Bazel (experimental)

Install [Bazelisk](https://github.com/bazelbuild/bazelisk), which auto-downloads the Bazel version pinned in `.bazelversion`:

```bash
# macOS
brew install bazelisk

# npm (any platform)
npm install -g @bazel/bazelisk
```

Bazel builds Z3 from source, so no system Z3 installation is needed when using Bazel. If you have previously built with Cargo, add Cargo's output directory to `.bazelignore` to prevent conflicts:

```bash
echo "target" >> .bazelignore
```

### macOS build tools

Install Apple Command Line Tools before building locally:
Expand Down Expand Up @@ -390,6 +408,26 @@ These are the primary `mise` tasks for day-to-day development:
| `mise run helm:docs` | Regenerate the Helm chart README |
| `mise run clean` | Clean build artifacts |

### Bazel targets (experimental)

> [!IMPORTANT]
> Bazel support is experimental and under evaluation via [RFC 0012](https://github.com/NVIDIA/OpenShell/pull/2543).
> It may be removed at any time depending on the RFC outcome.
> Feedback is welcome: [open an issue](https://github.com/NVIDIA/OpenShell/issues/new) or find us on CNCF Slack in [#openshell-dev](https://cloud-native.slack.com/archives/openshell-dev).

The following Bazel commands are available alongside the mise tasks above. Cargo and mise remain the primary build system.

| Task | Bazel command | Notes |
| ---- | ------------- | ----- |
| Build everything | `bazel build //...` | All crates and protos |
| Run all tests | `bazel test //...` | Unit tests only, no E2E |
| Build the CLI | `bazel build //crates/openshell-cli:openshell` | |
| Build the gateway | `bazel build //crates/openshell-server:openshell-gateway` | |
| Build the supervisor | `bazel build //crates/openshell-sandbox:openshell-sandbox-bin` | |
| Clean | `bazel clean` | |

Bazel does not yet cover `mise run gateway`, `mise run sandbox`, `mise run e2e`, `mise run docs`, or `mise run helm:docs`. Those are runtime and infrastructure tasks that remain with mise. Additional Bazel targets will be added over time as the experiment progresses.

## Project Structure

| Path | Purpose |
Expand Down
Loading
Loading