MCPcopy Index your code
hub / github.com/NVIDIA/OpenShell

github.com/NVIDIA/OpenShell @v0.0.77

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.77 ↗ · + Follow
9,823 symbols 31,033 edges 394 files 1,411 documented · 14%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

NVIDIA OpenShell

License PyPI Security Policy Documentation Project Status

OpenShell is the safe, private runtime for autonomous AI agents. It provides sandboxed execution environments that protect your data, credentials, and infrastructure — governed by declarative YAML policies that prevent unauthorized file access, data exfiltration, and uncontrolled network activity.

OpenShell is built agent-first. The project ships with agent skills for everything from gateway troubleshooting to policy generation, and we expect contributors to use them.

Alpha software — single-player mode. OpenShell is proof-of-life: one developer, one environment, one gateway. We are building toward multi-tenant enterprise deployments, but the starting point is getting your own environment up and running. Expect rough edges. Bring your agent.

Quickstart

Prerequisites

  • A supported host — macOS, Windows with WSL 2, or Linux.
  • A local runtime — Docker, Podman, or host virtualization enabled for MicroVM-backed sandboxes.

Install

Binary (recommended):

curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh

From PyPI (requires uv):

uv tool install -U openshell

Both methods install the latest stable release by default. To install a specific version, set OPENSHELL_VERSION (binary) or pin the version with uv tool install openshell==<version>. A dev release is also available that tracks the latest commit on main.

Helm chart:

Experimental — the Kubernetes deployment path is under active development. Expect rough edges and breaking changes.

Deploy the OpenShell gateway into a Kubernetes cluster from the OCI chart published to GHCR:

helm install openshell oci://ghcr.io/nvidia/openshell/helm-chart

See deploy/helm/openshell/README.md for available versions, dev tag conventions, and configuration.

For deploying OpenShell on OpenShift, see deploy/helm/openshell/README.md#install-on-openshift.

Create a sandbox

openshell sandbox create -- claude  # or opencode, codex, copilot

The sandbox container includes the following tools by default:

Category Tools
Agent claude, opencode, codex, copilot
Language python (3.14), node (22)
Developer gh, git, vim, nano
Networking ping, dig, nslookup, nc, traceroute, netstat

For more details see https://github.com/NVIDIA/OpenShell-Community/tree/main/sandboxes/base.

See network policy in action

Every sandbox starts with minimal outbound access. You open additional access with a short YAML policy that the proxy enforces at the HTTP method and path level, without restarting anything.

# 1. Create a sandbox (starts with minimal outbound access)
openshell sandbox create

# 2. Inside the sandbox — blocked
sandbox$ curl -sS https://api.github.com/zen
curl: (56) Received HTTP code 403 from proxy after CONNECT

# 3. Back on the host — apply a read-only GitHub API policy
sandbox$ exit
openshell policy set demo --policy examples/sandbox-policy-quickstart/policy.yaml --wait

# 4. Reconnect — GET allowed, POST blocked by L7
openshell sandbox connect demo
sandbox$ curl -sS https://api.github.com/zen
Anything added dilutes everything else.

sandbox$ curl -sS -X POST https://api.github.com/repos/octocat/hello-world/issues -d '{"title":"oops"}'
{"error":"policy_denied","detail":"POST /repos/octocat/hello-world/issues not permitted by policy"}

See the full walkthrough or run the automated demo:

bash examples/sandbox-policy-quickstart/demo.sh

How It Works

OpenShell isolates each sandbox in its own container with policy-enforced egress routing. A lightweight gateway coordinates sandbox lifecycle, and every outbound connection is intercepted by the policy engine, which does one of three things:

  • Allows — the destination and binary match a policy block.
  • Routes for inference — strips caller credentials, injects backend credentials, and forwards to the managed model.
  • Denies — blocks the request and logs it.
Component Role
Gateway Control-plane API that coordinates sandbox lifecycle and acts as the auth boundary.
Sandbox Isolated runtime with container supervision and policy-enforced egress routing.
Policy Engine Enforces filesystem, network, and process constraints from application layer down to kernel.
Privacy Router Privacy-aware LLM routing that keeps sensitive context on sandbox compute.

OpenShell runs a gateway control plane that manages sandbox lifecycle through a configured compute driver. Supported compute platforms include Docker, Podman, MicroVM, and Kubernetes.

Protection Layers

OpenShell applies defense in depth across four policy domains:

Layer What it protects When it applies
Filesystem Prevents reads/writes outside allowed paths. Locked at sandbox creation.
Network Blocks unauthorized outbound connections. Hot-reloadable at runtime.
Process Blocks privilege escalation and dangerous syscalls. Locked at sandbox creation.
Inference Reroutes model API calls to controlled backends. Hot-reloadable at runtime.

Policies are declarative YAML files. Static sections (filesystem, process) are locked at creation; dynamic sections (network, inference) can be hot-reloaded on a running sandbox with openshell policy set.

Providers

Agents need credentials — API keys, tokens, service accounts. OpenShell manages these as providers: named credential bundles that are injected into sandboxes at creation. The CLI auto-discovers credentials for recognized agents (Claude, Codex, OpenCode, Copilot) from your shell environment, or you can create providers explicitly with openshell provider create. Credentials never leak into the sandbox filesystem; they are injected as environment variables at runtime.

GPU Support (Experimental)

Experimental — GPU passthrough works on supported hosts but is under active development. Expect rough edges and breaking changes.

OpenShell can pass host GPUs into sandboxes for local inference, fine-tuning, or any GPU workload. Add --gpu when creating a sandbox:

openshell sandbox create --gpu --from [gpu-enabled-sandbox] -- claude

Docker-backed GPU sandboxes auto-select CDI when available and otherwise fall back to Docker's NVIDIA GPU request path (--gpus all).

Requirements: NVIDIA drivers and the NVIDIA Container Toolkit must be installed on the host. The sandbox image itself must include the appropriate GPU drivers and libraries for your workload — the default base image does not. See the BYOC example for building a custom sandbox image with GPU support.

Supported Agents

Agent Source Notes
Claude Code base Works out of the box. Provider uses ANTHROPIC_API_KEY.
OpenCode base Works out of the box. Provider uses OPENAI_API_KEY or OPENROUTER_API_KEY.
Codex base Works out of the box. Provider uses OPENAI_API_KEY.
GitHub Copilot CLI base Works out of the box. Provider uses GITHUB_TOKEN or COPILOT_GITHUB_TOKEN.
OpenClaw NemoClaw Run OpenClaw more securely inside NVIDIA OpenShell with managed inference using NemoClaw.
Hermes Agent NemoClaw Run Hermes Agent more securely inside NVIDIA OpenShell with managed inference using NemoClaw.
Ollama Community Launch with openshell sandbox create --from ollama.
Pi Community Launch with openshell sandbox create --from pi.

Key Commands

Command Description
openshell sandbox create -- <agent> Create a sandbox and launch an agent.
openshell sandbox connect [name] SSH into a running sandbox.
openshell sandbox list List all sandboxes.
openshell provider create --type [type]] --from-existing Create a credential provider from env vars.
openshell policy set <name> --policy file.yaml Apply or update a policy on a running sandbox.
openshell policy get <name> Show the active policy.
`openshell inference set --provider

--model | Configure theinference.localendpoint. | |openshell logs [name] --tail| Stream sandbox logs. | |openshell term` | Launch the real-time terminal UI for debugging. |

See the full documentation for command guides, tutorials, and reference material.

Terminal UI

OpenShell includes a real-time terminal dashboard for monitoring gateways, sandboxes, and providers — inspired by k9s.

openshell term

OpenShell Terminal UI

The TUI gives you a live, keyboard-driven view of your gateway and sandboxes. Navigate with Tab to switch panels, j/k to move through lists, Enter to select, and : for command mode. Gateway health and sandbox status auto-refresh every two seconds.

Community Sandboxes and BYOC

Use --from to create sandboxes from the OpenShell Community catalog, a local directory, or a container image:

openshell sandbox create --from gemini             # community catalog
openshell sandbox create --from ./my-sandbox-dir   # local Dockerfile
openshell sandbox create --from registry.io/img:v1 # container image

See the community sandboxes catalog and the BYOC example for details.

Explore with Your Agent

Clone the repo and point your coding agent at it. The project includes agent skills that can answer questions, walk you through workflows, and diagnose problems — no issue filing required.

git clone https://github.com/NVIDIA/OpenShell.git   # or git@github.com:NVIDIA/OpenShell.git
cd OpenShell
# Point your agent here — it will discover the skills in .agents/skills/ automatically

Your agent can load skills for CLI usage (openshell-cli), gateway troubleshooting (debug-openshell-cluster), inference troubleshooting (debug-inference), policy generation (generate-sandbox-policy), and more. See CONTRIBUTING.md for the full

Extension points exported contracts — how you extend this code

ObjectType (Interface)
Trait for inferring an object type string from a message type. [8 implementers]
crates/openshell-server/src/persistence/mod.rs
ObjectId (Interface)
Provides access to the object's unique identifier. [8 implementers]
crates/openshell-core/src/metadata.rs
ProviderPlugin (Interface)
(no doc) [6 implementers]
crates/openshell-providers/src/lib.rs
SupervisorReadiness (Interface)
Queried by the Docker driver to decide when a sandbox's supervisor relay is live. Implementations return `true` once a s [2 …
crates/openshell-driver-docker/src/lib.rs
L7Provider (Interface)
Protocol-specific request parsing, relay, and deny logic. Generic over the stream type to support both plaintext and TL [1 …
crates/openshell-supervisor-network/src/l7/provider.rs
LifecycleExtension (Interface)
(no doc) [3 implementers]
crates/openshell-driver-vm/src/lifecycle.rs
MetadataHandler (Interface)
Handler for cloud metadata HTTP requests. Implementors receive the parsed HTTP method, path, raw request bytes, and a b [1 …
crates/openshell-sandbox/src/metadata_server.rs
OcsfEnum (Interface)
Trait for OCSF enum types that have an integer ID and a string label. All OCSF "sibling pair" enums implement this trai
crates/openshell-ocsf/src/enums/mod.rs

Core symbols most depended-on inside this repo

push
called by 815
crates/openshell-driver-vm/src/lifecycle.rs
path
called by 650
crates/openshell-vfio/src/sysfs.rs
len
called by 545
crates/openshell-driver-vm/src/lifecycle.rs
is_empty
called by 515
crates/openshell-server/src/grpc/provider.rs
is_empty
called by 422
crates/openshell-core/src/gpu.rs
get
called by 386
crates/openshell-providers/src/lib.rs
as_str
called by 208
crates/openshell-core/src/config.rs
put_message
called by 193
crates/openshell-server/src/persistence/mod.rs

Shape

Function 7,223
Method 1,794
Class 618
Enum 167
Interface 21

Languages

Rust95%
Python5%
TypeScript1%
C1%

Modules by API surface

crates/openshell-cli/src/run.rs313 symbols
crates/openshell-supervisor-network/src/proxy.rs276 symbols
crates/openshell-driver-vm/src/driver.rs275 symbols
crates/openshell-supervisor-network/src/opa.rs232 symbols
crates/openshell-server/src/grpc/policy.rs228 symbols
crates/openshell-supervisor-network/src/l7/rest.rs202 symbols
crates/openshell-server/src/grpc/provider.rs171 symbols
crates/openshell-driver-docker/src/lib.rs154 symbols
crates/openshell-policy/src/lib.rs137 symbols
crates/openshell-driver-kubernetes/src/driver.rs136 symbols
crates/openshell-providers/src/profiles.rs135 symbols
crates/openshell-supervisor-network/src/l7/mod.rs132 symbols

Datastores touched

dbnameDatabase · 1 repos
openshellDatabase · 1 repos

For agents

$ claude mcp add OpenShell \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact