Skip to content

Commit 188b355

Browse files
authored
docs(config): update gateway config reference (#1624)
1 parent 5007042 commit 188b355

8 files changed

Lines changed: 122 additions & 57 deletions

File tree

.agents/skills/build-from-issue/SKILL.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ In the prompt, instruct the reviewer to:
148148
- **Medium**: Multiple files/components, some design decisions, but well-scoped
149149
- **High**: Cross-cutting changes, architectural decisions needed, significant unknowns
150150
8. Call out risks, unknowns, and decisions that need stakeholder input.
151-
9. Assess **LSM compatibility** — if the change touches process identity, `/proc` filesystem access, binary execution, or inter-process visibility, flag whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. In particular, tests that fork+exec into system binaries will fail on SELinux-enforcing hosts due to cross-label `/proc/<pid>/exe` access restrictions.
151+
9. Assess **gateway config documentation impact** — if the change adds, removes, renames, or changes defaults for gateway TOML keys or driver-specific config options, the plan must include an update to `docs/reference/gateway-config.mdx`. If the change is surfaced through Helm or a compute-driver overview, also include `docs/reference/sandbox-compute-drivers.mdx` or the relevant deployment docs.
152+
10. Assess **LSM compatibility** — if the change touches process identity, `/proc` filesystem access, binary execution, or inter-process visibility, flag whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. In particular, tests that fork+exec into system binaries will fail on SELinux-enforcing hosts due to cross-label `/proc/<pid>/exe` access restrictions.
152153

153154
### A2: Post the Plan Comment
154155

@@ -436,6 +437,13 @@ Review the documentation requirements in `AGENTS.md` and update any affected
436437
docs as part of the implementation. Keep documentation changes scoped to the
437438
behavior or subsystem that changed.
438439

440+
If the implementation changes gateway TOML parsing, `[openshell.gateway]`
441+
fields, `[openshell.drivers.<name>]` fields, driver config defaults, or Helm
442+
rendering of `gateway.toml`, update `docs/reference/gateway-config.mdx` in the
443+
same branch. If the change affects user-facing compute-driver setup, also
444+
update `docs/reference/sandbox-compute-drivers.mdx` or the relevant deployment
445+
page.
446+
439447
### Step 12: Commit and Push
440448

441449
Commit all changes using conventional commit format. The `<type>` comes from the issue type in the plan:

.agents/skills/create-github-pr/SKILL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ Create pull requests on GitHub using the `gh` CLI.
1515

1616
## Before Creating a PR
1717

18+
### Check Config Documentation
19+
20+
If the branch changes gateway TOML parsing, `[openshell.gateway]` fields,
21+
`[openshell.drivers.<name>]` fields, driver config defaults, or Helm rendering
22+
of `gateway.toml`, verify that `docs/reference/gateway-config.mdx` is updated
23+
in the same branch. If the change affects user-facing compute-driver setup,
24+
also update `docs/reference/sandbox-compute-drivers.mdx` or the relevant
25+
deployment docs.
26+
1827
### Run Pre-commit Checks
1928

2029
Run the local pre-commit task before opening a PR:

.agents/skills/create-spike/SKILL.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ The prompt to the reviewer **must** instruct it to:
9191

9292
9. **Check architecture docs** in the `architecture/` directory for relevant documentation about the affected subsystems.
9393

94-
10. **Assess Linux Security Module (LSM) impact.** If the change involves process identity, `/proc` filesystem access, file labeling, binary execution, or inter-process visibility, call out whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. For example: reading `/proc/<pid>/exe` across an SELinux domain boundary returns ENOENT, not EACCES. Tests that fork+exec into system binaries (different SELinux label) will fail on enforcing hosts. Flag any LSM-sensitive code paths and recommend mitigations.
94+
10. **Assess gateway config documentation impact.** If the change would add, remove, rename, or change defaults for gateway TOML keys or driver-specific config options, call out that `docs/reference/gateway-config.mdx` must be updated. If the change is surfaced through Helm or compute-driver setup docs, call out the relevant deployment or compute-driver docs too.
9595

96-
11. **Determine the issue type:** `feat`, `fix`, `refactor`, `chore`, `perf`, or `docs`.
96+
11. **Assess Linux Security Module (LSM) impact.** If the change involves process identity, `/proc` filesystem access, file labeling, binary execution, or inter-process visibility, call out whether it will behave differently on hosts running SELinux (enforcing) or AppArmor. For example: reading `/proc/<pid>/exe` across an SELinux domain boundary returns ENOENT, not EACCES. Tests that fork+exec into system binaries (different SELinux label) will fail on enforcing hosts. Flag any LSM-sensitive code paths and recommend mitigations.
97+
98+
12. **Determine the issue type:** `feat`, `fix`, `refactor`, `chore`, `perf`, or `docs`.
9799

98100
### What makes a good investigation prompt
99101

.agents/skills/update-docs/SKILL.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ git log -50 --oneline --no-merges
3434
Filter to commits that are likely to affect docs. Look for these signals:
3535

3636
1. **Commit type**: `feat`, `fix`, `refactor`, `perf` commits often change behavior. `docs` commits are already doc changes. `chore`, `ci`, `test` commits rarely need doc updates.
37-
2. **Files changed**: Changes to `crates/openshell-cli/`, `python/`, `proto/`, `deploy/`, or policy-related code are high-signal.
37+
2. **Files changed**: Changes to `crates/openshell-cli/`, `python/`, `proto/`, `deploy/`, gateway config parsing, driver config structs, or policy-related code are high-signal.
3838
3. **Ignore**: Changes limited to `tests/`, `e2e/`, `.github/`, `tasks/`, or internal-only modules.
3939

4040
```bash
@@ -52,6 +52,10 @@ For each relevant commit, determine which doc page(s) it affects. Use this mappi
5252
| `crates/openshell-cli/` (sandbox commands) | `docs/sandboxes/manage-sandboxes.mdx` |
5353
| `crates/openshell-cli/` (provider commands) | `docs/sandboxes/manage-providers.mdx` |
5454
| `crates/openshell-cli/` (new top-level command) | May need a new page or `docs/reference/` entry |
55+
| `crates/openshell-server/src/config_file.rs` or gateway TOML parsing | `docs/reference/gateway-config.mdx` |
56+
| `crates/openshell-server/src/cli.rs` gateway config merge/default behavior | `docs/reference/gateway-config.mdx` |
57+
| `crates/openshell-driver-*/` config structs or driver defaults | `docs/reference/gateway-config.mdx`, `docs/reference/sandbox-compute-drivers.mdx` |
58+
| `deploy/helm/openshell/templates/gateway-config.yaml` | `docs/reference/gateway-config.mdx`, `docs/reference/sandbox-compute-drivers.mdx`, Helm docs if values change |
5559
| Proxy or policy code | `docs/sandboxes/policies.mdx`, `docs/reference/policy-schema.mdx` |
5660
| Inference code | `docs/inference/configure.mdx` |
5761
| `python/` (SDK changes) | `docs/reference/` or `docs/get-started/quickstart.mdx` |

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ ocsf_emit!(event);
190190

191191
- When making changes, update the relevant documentation in the `architecture/` directory.
192192
- When changes affect user-facing behavior, update the relevant published docs pages under `docs/` and navigation in `docs/index.yml`.
193+
- When changing gateway TOML fields, driver-specific config options, config defaults, or Helm rendering of `gateway.toml`, update `docs/reference/gateway-config.mdx` in the same branch.
193194
- `fern/` contains the Fern site config, components, preview workflow inputs, and publish settings.
194195
- Follow the docs style guide in [docs/CONTRIBUTING.mdx](docs/CONTRIBUTING.mdx): active voice, minimal formatting, no filler introductions, `shell` fences for copyable commands, and no duplicate body H1.
195196
- Fern PR previews run through `.github/workflows/branch-docs.yml`, and production publish runs through the `publish-fern-docs` job in `.github/workflows/release-tag.yml`.

docs/CONTRIBUTING.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Update documentation when your change:
2525

2626
- Adds, removes, or renames a CLI command or flag.
2727
- Changes default behavior or configuration.
28+
- Adds, removes, renames, or changes defaults for gateway TOML fields or driver-specific config options. Update `docs/reference/gateway-config.mdx` for these changes.
2829
- Adds a new feature that users interact with.
2930
- Fixes a bug that the docs describe incorrectly.
3031
- Changes an API, protocol, or policy schema.

docs/reference/gateway-config.mdx

Lines changed: 87 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ metrics_bind_address = "0.0.0.0:9090"
6868

6969
log_level = "info"
7070

71-
# When empty the gateway auto-detects (Kubernetes -> Podman -> Docker). VM is
72-
# never auto-detected and requires an explicit entry here.
71+
# When empty, the gateway auto-detects Kubernetes, then Podman, then Docker.
72+
# VM is never auto-detected and requires an explicit entry here.
7373
compute_drivers = ["kubernetes"]
7474

7575
sandbox_namespace = "openshell"
76+
ssh_session_ttl_secs = 3600
7677

7778
# Subject Alternative Names baked into the gateway server certificate.
7879
# Wildcard DNS SANs (e.g. "*.dev.openshell.localhost") also enable sandbox
@@ -81,17 +82,28 @@ server_sans = ["openshell", "*.dev.openshell.localhost"]
8182
# Allow plaintext HTTP routing for loopback sandbox service URLs.
8283
enable_loopback_service_http = true
8384

84-
# Shared driver defaults — inherited into [openshell.drivers.<name>] tables
85+
# Set true only for local plaintext gateways or trusted TLS termination.
86+
disable_tls = false
87+
88+
# Shared driver defaults. These inherit into [openshell.drivers.<name>] tables
8589
# when the driver-specific table does not override them.
86-
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
87-
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
88-
client_tls_secret_name = "openshell-client-tls"
90+
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
91+
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
92+
client_tls_secret_name = "openshell-client-tls"
93+
service_account_name = "openshell-sandbox"
94+
host_gateway_ip = "10.0.0.1"
95+
enable_user_namespaces = false
96+
sa_token_ttl_secs = 3600
97+
guest_tls_ca = "/etc/openshell/certs/ca.pem"
98+
guest_tls_cert = "/etc/openshell/certs/client.pem"
99+
guest_tls_key = "/etc/openshell/certs/client-key.pem"
89100

90101
# Gateway listener TLS (distinct from the per-driver guest_tls_*).
91102
[openshell.gateway.tls]
92103
cert_path = "/etc/openshell/certs/gateway.pem"
93104
key_path = "/etc/openshell/certs/gateway-key.pem"
94105
client_ca_path = "/etc/openshell/certs/client-ca.pem"
106+
require_client_auth = false
95107

96108
[openshell.gateway.gateway_jwt]
97109
signing_key_path = "/etc/openshell/jwt/signing.pem"
@@ -103,26 +115,32 @@ ttl_secs = 3600
103115
[openshell.gateway.auth]
104116
allow_unauthenticated_users = false
105117

118+
[openshell.gateway.mtls_auth]
119+
enabled = false
120+
106121
[openshell.gateway.oidc]
107122
issuer = "https://idp.example.com/realms/openshell"
108123
audience = "openshell-cli"
109124
jwks_ttl_secs = 3600
110125
roles_claim = "realm_access.roles"
111126
admin_role = "openshell-admin"
112127
user_role = "openshell-user"
128+
scopes_claim = ""
113129
```
114130

115131
Local Docker, Podman, and VM gateways can also set `[openshell.gateway.mtls_auth] enabled = true` to authenticate CLI callers from verified client certificates. Kubernetes deployments must leave this unset and use OIDC or a trusted access proxy; the Helm chart does not render this table.
116132

117133
`[openshell.gateway.auth] allow_unauthenticated_users = true` is an unsafe local-development and trusted-proxy escape hatch. It accepts user-facing CLI/API calls without OIDC or mTLS credentials while sandbox supervisors still authenticate with gateway-minted sandbox JWTs. Leave it false for shared and production gateways.
118134

119-
`image_pull_policy` is intentionally not a shared gateway key. Kubernetes uses `Always | IfNotPresent | Never` while Podman uses `always | missing | never | newer`. Set it inside the relevant driver table.
135+
`image_pull_policy` is intentionally not a shared gateway key. Kubernetes and Docker use `Always`, `IfNotPresent`, or `Never`. Podman uses `always`, `missing`, `never`, or `newer`. Set it inside the relevant driver table.
136+
137+
## Driver References
120138

121-
## Per-Driver Examples
139+
Each example is a complete TOML file for one compute driver. The examples repeat `[openshell]` and `[openshell.gateway]` so they stay copyable, and the driver tables list the accepted driver-specific keys. Driver-specific values override inherited gateway defaults. The gateway rejects unknown driver fields after inheritance is merged.
122140

123141
### Kubernetes
124142

125-
The gateway runs as a Pod and creates sandbox Pods in another namespace. mTLS material for sandboxes is delivered via a Kubernetes Secret rather than host-side file paths.
143+
The gateway runs as a Pod and creates sandbox Pods in another namespace. mTLS material for sandboxes is delivered through a Kubernetes Secret rather than host-side file paths.
126144

127145
```toml
128146
[openshell]
@@ -135,23 +153,29 @@ metrics_bind_address = "0.0.0.0:9090"
135153
log_level = "info"
136154
compute_drivers = ["kubernetes"]
137155

138-
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
139-
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
140-
client_tls_secret_name = "openshell-client-tls"
141-
142156
[openshell.gateway.tls]
143157
cert_path = "/etc/openshell-tls/server/tls.crt"
144158
key_path = "/etc/openshell-tls/server/tls.key"
145159
client_ca_path = "/etc/openshell-tls/client-ca/ca.crt"
146160

147161
[openshell.drivers.kubernetes]
148-
namespace = "agents"
149-
grpc_endpoint = "https://openshell-gateway.agents.svc:8080"
150-
service_account_name = "openshell-sandbox"
151-
image_pull_policy = "IfNotPresent"
152-
# Use the image volume on K8s >= 1.35 (GA in 1.36); switch to "init-container"
162+
namespace = "agents"
163+
service_account_name = "openshell-sandbox"
164+
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
165+
image_pull_policy = "IfNotPresent"
166+
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
167+
supervisor_image_pull_policy = "IfNotPresent"
168+
# Use the image volume on Kubernetes >= 1.35 (GA in 1.36); switch to "init-container"
153169
# on older clusters or where the ImageVolume feature gate is off.
154-
supervisor_sideload_method = "image-volume"
170+
supervisor_sideload_method = "image-volume"
171+
grpc_endpoint = "https://openshell-gateway.agents.svc:8080"
172+
ssh_socket_path = "/run/openshell/ssh.sock"
173+
client_tls_secret_name = "openshell-client-tls"
174+
host_gateway_ip = "10.0.0.1"
175+
enable_user_namespaces = false
176+
workspace_default_storage_size = "10Gi"
177+
# Kubelet clamps projected tokens below 600 seconds. The driver caps values at 86400.
178+
sa_token_ttl_secs = 3600
155179
```
156180

157181
### Docker
@@ -167,19 +191,24 @@ bind_address = "127.0.0.1:17670"
167191
log_level = "info"
168192
compute_drivers = ["docker"]
169193

170-
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
171-
guest_tls_ca = "/etc/openshell/certs/ca.pem"
172-
guest_tls_cert = "/etc/openshell/certs/client.pem"
173-
guest_tls_key = "/etc/openshell/certs/client-key.pem"
174-
175194
[openshell.drivers.docker]
176-
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
177-
image_pull_policy = "IfNotPresent"
178-
sandbox_namespace = "docker-dev"
179-
grpc_endpoint = "https://host.openshell.internal:17670"
180-
network_name = "openshell-docker"
195+
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
196+
# Docker vocabulary: Always | IfNotPresent | Never. Empty behaves like IfNotPresent.
197+
image_pull_policy = "IfNotPresent"
198+
sandbox_namespace = "docker-dev"
199+
# Empty auto-detects https://host.openshell.internal:<gateway-port> when guest TLS is set.
200+
grpc_endpoint = "https://host.openshell.internal:17670"
181201
# Skip the image-pull-and-extract step by pointing at a locally built binary.
182-
supervisor_bin = "/usr/local/libexec/openshell/openshell-sandbox"
202+
supervisor_bin = "/usr/local/libexec/openshell/openshell-sandbox"
203+
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
204+
guest_tls_ca = "/etc/openshell/certs/ca.pem"
205+
guest_tls_cert = "/etc/openshell/certs/client.pem"
206+
guest_tls_key = "/etc/openshell/certs/client-key.pem"
207+
network_name = "openshell-docker"
208+
host_gateway_ip = "172.17.0.1"
209+
ssh_socket_path = "/run/openshell/ssh.sock"
210+
# Set to 0 to leave Docker's runtime default unchanged.
211+
sandbox_pids_limit = 2048
183212
```
184213

185214
### Podman
@@ -195,18 +224,23 @@ bind_address = "127.0.0.1:17670"
195224
log_level = "info"
196225
compute_drivers = ["podman"]
197226

198-
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
199-
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
200-
guest_tls_ca = "/etc/openshell/certs/ca.pem"
201-
guest_tls_cert = "/etc/openshell/certs/client.pem"
202-
guest_tls_key = "/etc/openshell/certs/client-key.pem"
203-
204227
[openshell.drivers.podman]
205228
# Rootless socket path. For root Podman use /run/podman/podman.sock.
206-
socket_path = "/run/user/1000/podman/podman.sock"
207-
network_name = "openshell"
208-
stop_timeout_secs = 10
209-
image_pull_policy = "missing" # Podman vocabulary: always | missing | never | newer
229+
socket_path = "/run/user/1000/podman/podman.sock"
230+
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
231+
image_pull_policy = "missing" # always | missing | never | newer
232+
grpc_endpoint = "https://host.containers.internal:17670"
233+
# The gateway overwrites gateway_port from bind_address at runtime.
234+
gateway_port = 17670
235+
network_name = "openshell"
236+
sandbox_ssh_socket_path = "/run/openshell/ssh.sock"
237+
stop_timeout_secs = 10
238+
supervisor_image = "ghcr.io/nvidia/openshell/supervisor:latest"
239+
guest_tls_ca = "/etc/openshell/certs/ca.pem"
240+
guest_tls_cert = "/etc/openshell/certs/client.pem"
241+
guest_tls_key = "/etc/openshell/certs/client-key.pem"
242+
# Set to 0 to leave Podman's runtime default unchanged.
243+
sandbox_pids_limit = 2048
210244
```
211245

212246
### MicroVM
@@ -223,17 +257,19 @@ log_level = "info"
223257
# VM is never auto-detected; an explicit entry here is required.
224258
compute_drivers = ["vm"]
225259

226-
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
227-
guest_tls_ca = "/var/lib/openshell/guest-tls/ca.pem"
228-
guest_tls_cert = "/var/lib/openshell/guest-tls/client.pem"
229-
guest_tls_key = "/var/lib/openshell/guest-tls/client-key.pem"
230-
231260
[openshell.drivers.vm]
232-
grpc_endpoint = "https://host.containers.internal:17670"
233-
state_dir = "/var/lib/openshell/vm"
261+
state_dir = "/var/lib/openshell/vm"
234262
# Where the gateway looks for the openshell-driver-vm subprocess binary.
235-
driver_dir = "/usr/local/libexec/openshell"
236-
vcpus = 2
237-
mem_mib = 2048
238-
krun_log_level = 1
263+
driver_dir = "/usr/local/libexec/openshell"
264+
default_image = "ghcr.io/nvidia/openshell/sandbox:latest"
265+
grpc_endpoint = "https://host.containers.internal:17670"
266+
# Empty falls back to default_image.
267+
bootstrap_image = "ghcr.io/nvidia/openshell/sandbox:latest"
268+
krun_log_level = 1
269+
vcpus = 2
270+
mem_mib = 2048
271+
overlay_disk_mib = 4096
272+
guest_tls_ca = "/var/lib/openshell/guest-tls/ca.pem"
273+
guest_tls_cert = "/var/lib/openshell/guest-tls/client.pem"
274+
guest_tls_key = "/var/lib/openshell/guest-tls/client-key.pem"
239275
```

0 commit comments

Comments
 (0)