- - - -How OpenShell Works# -OpenShell runs inside a Docker container. Each sandbox is an isolated environment managed through the gateway. Four components work together to keep agents secure. - - - - - -Components# -The following table describes each component and its role in the system: - - -Component -Role - - - -Gateway -Control-plane API that coordinates sandbox lifecycle and state, acts as the auth boundary, and brokers requests across the platform. - -Sandbox -Isolated runtime that includes container supervision and policy-enforced egress routing. - -Policy Engine -Policy definition and enforcement layer for filesystem, network, and process constraints. Defense in depth enforces policies from the application layer down to infrastructure and kernel layers. - -Privacy Router -Privacy-aware LLM routing layer that keeps sensitive context on sandbox compute and routes based on cost and privacy policy. - - - - - - -How a Request Flows# -Every outbound connection from agent code passes through the same decision path: - -The agent process opens an outbound connection (API call, package install, git clone, and so on). -The proxy inside the sandbox intercepts the connection and identifies which binary opened it. -If the target is https://inference.local, the proxy handles it as managed inference before policy evaluation. OpenShell strips sandbox-supplied credentials, injects the configured backend credentials, and forwards the request to the managed model endpoint. -For every other destination, the proxy queries the policy engine with the destination, port, and calling binary. -The policy engine returns one of two decisions: - -Allow - the destination and binary match a policy block. Traffic flows directly to the external service. -Deny - no policy block matched. The connection is blocked and logged. - - - -For REST endpoints with TLS termination enabled, the proxy also decrypts TLS and checks each HTTP request against per-method, per-path rules before allowing it through. - - -Deployment Modes# -OpenShell can run locally, on a remote host, or behind a cloud proxy. The architecture is identical in all cases — only the Docker container location and authentication mode change. - - -Mode -Description -Command - - - -Local -The gateway runs inside Docker on your workstation. The CLI provisions it automatically on first use. -openshell gateway start - -Remote -The gateway runs on a remote host via SSH. Only Docker is required on the remote machine. -openshell gateway start --remote user@host - -Cloud -A gateway already running behind a reverse proxy (e.g. Cloudflare Access). Register and authenticate via browser. -openshell gateway add https://gateway.example.com - - - - -You can register multiple gateways and switch between them with openshell gateway select. For the full deployment and management workflow, refer to the Gateways section. - - -Next Steps# -Continue with one of the following: - -To deploy or register a gateway, refer to Gateways. -To create your first sandbox, refer to the Quickstart. -To learn how OpenShell enforces isolation across all protection layers, refer to Sandboxes. - - - - - -
- - - -Overview of NVIDIA OpenShell# -NVIDIA OpenShell is an open-source runtime for executing autonomous AI agents in sandboxed environments with kernel-level isolation. It combines sandbox runtime controls and a declarative YAML policy so teams can run agents without giving them unrestricted access to local files, credentials, and external networks. - -Why OpenShell Exists# -AI agents are most useful when they can read files, install packages, call APIs, and use credentials. That same access can create material risk. OpenShell is designed for this tradeoff: preserve agent capability while enforcing explicit controls over what the agent can access. - - -Common Risks and Controls# -The table below summarizes common failure modes and how OpenShell mitigates them. - - -Threat -Without controls -With OpenShell - - - -Data exfiltration -Agent uploads source code or internal files to unauthorized endpoints. -Network policies allow only approved destinations; other outbound traffic is denied. - -Credential theft -Agent reads local secrets such as SSH keys or cloud credentials. -Filesystem restrictions (Landlock) confine access to declared paths only. - -Unauthorized API usage -Agent sends prompts or data to unapproved model providers. -Privacy routing and network policies control where inference traffic can go. - -Privilege escalation -Agent attempts sudo, setuid paths, or dangerous syscall behavior. -Unprivileged process identity and seccomp restrictions block escalation paths. - - - - - - -Protection Layers at a Glance# -OpenShell applies defense in depth across the following 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. - - - - -For details, refer to Sandbox Policies and Customize Sandbox Policies. - - -Common Use Cases# -OpenShell supports a range of agent deployment patterns. - - -Use Case -Description - - - -Secure coding agents -Run Claude Code, OpenCode, or OpenClaw with constrained file and network access. - -Private enterprise development -Route inference to self-hosted or private backends while keeping sensitive context under your control. - -Compliance and audit -Treat policy YAML as version-controlled security controls that can be reviewed and audited. - -Reusable environments -Use community sandbox images or bring your own containerized runtime. - - - - - - - -Next Steps# -Explore these topics to go deeper: - -To understand the components that make up the OpenShell runtime, refer to the Architecture Overview. -To install the CLI and create your first sandbox, refer to the Quickstart. -To learn how OpenShell enforces isolation across all protection layers, refer to Sandboxes. - - - - - -
- - - -NVIDIA OpenShell Release Notes# -NVIDIA OpenShell follows a frequent release cadence. Use the following GitHub resources directly. - - -Resource -Description - - - -Releases -Versioned release notes and downloadable assets. - -Release comparison -Diff between any two tags or branches. - -Merged pull requests -Individual changes with review discussion. - -Commit history -Full commit log on main. - - - - - - - -
- - -Supported Agents# -The following table summarizes the agents that run in OpenShell sandboxes. All agent sandbox images are maintained in the OpenShell Community repository. Agents in the base image are auto-configured when passed as the trailing command to openshell sandbox create. - - -Agent -Source -Default Policy -Notes - - - -Claude Code -base -Full coverage -Works out of the box. Requires ANTHROPIC_API_KEY. - -OpenCode -base -Partial coverage -Pre-installed. Add opencode.ai endpoint and OpenCode binary paths to the policy for full functionality. - -Codex -base -No coverage -Pre-installed. Requires a custom policy with OpenAI endpoints and Codex binary paths. Requires OPENAI_API_KEY. - -OpenClaw -openclaw -Bundled -Agent orchestration layer. Launch with openshell sandbox create --from openclaw. - - - - -More community agent sandboxes are available in the Community Sandboxes catalog. -For a complete support matrix, refer to the Support Matrix page. - - - -
- - - -Quickstart# -This page gets you from zero to a running, policy-enforced sandbox in two commands. - -Prerequisites# -Before you begin, make sure you have: - -Docker Desktop running on your machine. - -For a complete list of requirements, refer to Support Matrix. - - -Install the OpenShell CLI# -Run the install script: -$ curl -LsSf https://raw.githubusercontent.com/NVIDIA/OpenShell/main/install.sh | sh - - -If you prefer uv: -$ uv tool install -U openshell - - -After installing the CLI, run openshell --help in your terminal to see the full CLI reference, including all commands and flags. - -Tip -You can also clone the NVIDIA OpenShell GitHub repository and use the /openshell-cli skill to load the CLI reference into your agent. - - - -Create Your First OpenShell Sandbox# -Create a sandbox and launch an agent inside it. -Choose the tab that matches your agent: - - - -Claude Code -Run the following command to create a sandbox with Claude Code: -$ openshell sandbox create -- claude - - -The CLI prompts you to create a provider from local credentials. -Type yes to continue. -If ANTHROPIC_API_KEY is set in your environment, the CLI picks it up automatically. -If not, you can configure it from inside the sandbox after it launches. - - - -OpenCode -Run the following command to create a sandbox with OpenCode: -$ openshell sandbox create -- opencode - - -The CLI prompts you to create a provider from local credentials. -Type yes to continue. -If OPENAI_API_KEY or OPENROUTER_API_KEY is set in your environment, the CLI picks it up automatically. -If not, you can configure it from inside the sandbox after it launches. - - - -Codex -Run the following command to create a sandbox with Codex: -$ openshell sandbox create -- codex - - -The CLI prompts you to create a provider from local credentials. -Type yes to continue. -If OPENAI_API_KEY is set in your environment, the CLI picks it up automatically. -If not, you can configure it from inside the sandbox after it launches. - - - -OpenClaw -Run the following command to create a sandbox with OpenClaw: -$ openshell sandbox create --from openclaw - - -The --from flag pulls a pre-built sandbox definition from the OpenShell Community catalog. -Each definition bundles a container image, a tailored policy, and optional skills into a single package. - - - -Community Sandbox -Use the --from flag to pull other OpenShell sandbox images from the NVIDIA Container Registry. -For example, to pull the base image, run the following command: -$ openshell sandbox create --from base - - - - - - -Deploy a Gateway (Optional)# -Running openshell sandbox create without a gateway auto-bootstraps a local one. -To start the gateway explicitly or deploy to a remote host, choose the tab that matches your setup. - - - -Brev - -Note -Deploy an OpenShell gateway on Brev by clicking Deploy on the OpenShell Launchable. - -After the instance starts running, find the gateway URL in the Brev console under Using Secure Links. -Copy the shareable URL for port 8080, which is the gateway endpoint. -$ openshell gateway add https://<your-port-8080-url>.brevlab.com -$ openshell status - - - - - -DGX Spark - -Note -Set up your Spark with NVIDIA Sync first, or make sure SSH access is configured (such as SSH keys added to the host). - -Deploy to a DGX Spark machine over SSH: -$ openshell gateway start --remote <username>@<spark-ssid>.local -$ openshell status - - -After openshell status shows the gateway as healthy, all subsequent commands route through the SSH tunnel. - - - - - - -
- - - -NVIDIA OpenShell# - - - -NVIDIA OpenShell is the safe, private runtime for autonomous AI agents. It provides sandboxed execution environments -that protect your data, credentials, and infrastructure. Agents run with exactly the permissions they need and -nothing more, governed by declarative policies that prevent unauthorized file access, data exfiltration, and -uncontrolled network activity. - -Get Started# -Install the CLI and create your first sandbox in two commands. - - - - - - - - - $ uv tool install -U openshell - $ openshell sandbox create -- claude--from openclaw-- opencode-- codex - -Refer to the Quickstart for more details. - - - -Explore# - - - - - - -About OpenShell -Learn about OpenShell and its capabilities. - - -Overview of NVIDIA OpenShell - - - - - -Quickstart -Install the CLI and create your first sandbox in two commands. - - -Quickstart - - - - - -Tutorials -Hands-on walkthroughs from first sandbox to custom policies. - - -Tutorials - - - - - -Gateways and Sandboxes -Deploy gateways, create sandboxes, configure policies, providers, and community images for your AI agents. - - -Deploy and Manage Gateways - - - - - -Inference Routing -Keep inference traffic private by routing API calls to local or self-hosted backends. - - -About Inference Routing - - - - - -Reference -Policy schema, environment variables, and system architecture. - - -Default Policy Reference - - - - - - - - - - - - - - - - - - - - - -
- - - -Configure Inference Routing# -This page covers the managed local inference endpoint (https://inference.local). External inference endpoints go through sandbox network_policies. Refer to Policies for details. -The configuration consists of two values: - - -Value -Description - - - -Provider record -The credential backend OpenShell uses to authenticate with the upstream model host. - -Model ID -The model to use for generation requests. - - - - - -Step 1: Create a Provider# -Create a provider that holds the backend credentials you want OpenShell to use. - - - -NVIDIA API Catalog -$ openshell provider create --name nvidia-prod --type nvidia --from-existing - - -This reads NVIDIA_API_KEY from your environment. - - - -Local / self-hosted endpoint -$ openshell provider create \ - --name my-local-model \ - --type openai \ - --credential OPENAI_API_KEY=empty-if-not-required \ - --config OPENAI_BASE_URL=http://host.openshell.internal:11434/v1 - - -Use --config OPENAI_BASE_URL to point to any OpenAI-compatible server running where the gateway runs. For host-backed local inference, use host.openshell.internal or the host’s LAN IP. Avoid 127.0.0.1 and localhost. Set OPENAI_API_KEY to a dummy value if the server does not require authentication. - - - -Anthropic -$ openshell provider create --name anthropic-prod --type anthropic --from-existing - - -This reads ANTHROPIC_API_KEY from your environment. - - - - -Step 2: Set Inference Routing# -Point inference.local at that provider and choose the model to use: -$ openshell inference set \ - --provider nvidia-prod \ - --model nvidia/nemotron-3-nano-30b-a3b - - - - -Step 3: Verify the Active Config# -Confirm that the provider and model are set correctly: -$ openshell inference get -Gateway inference: - - Provider: nvidia-prod - Model: nvidia/nemotron-3-nano-30b-a3b - Version: 1 - - - - -Step 4: Update Part of the Config# -Use update when you want to change only one field: -$ openshell inference update --model nvidia/nemotron-3-nano-30b-a3b - - -Or switch providers without repeating the current model: -$ openshell inference update --provider openai-prod - - - - -Use It from a Sandbox# -After inference is configured, code inside any sandbox can call https://inference.local directly: -from openai import OpenAI - -client = OpenAI(base_url="https://inference.local/v1", api_key="unused") - -response = client.chat.completions.create( - model="anything", - messages=[{"role": "user", "content": "Hello"}], -) - - -The client-supplied model and api_key values are not sent upstream. The privacy router injects the real credentials from the configured provider and rewrites the model before forwarding. -Some SDKs require a non-empty API key even though inference.local does not use the sandbox-provided value. In those cases, pass any placeholder such as test or unused. -Use this endpoint when inference should stay local to the host for privacy and security reasons. External providers that should be reached directly belong in network_policies instead. -When the upstream runs on the same machine as the gateway, bind it to 0.0.0.0 and point the provider at host.openshell.internal or the host’s LAN IP. 127.0.0.1 and localhost usually fail because the request originates from the gateway or sandbox runtime, not from your shell. -If the gateway runs on a remote host or behind a cloud deployment, host.openshell.internal points to that remote machine, not to your laptop. A laptop-local Ollama or vLLM process is not reachable from a remote gateway unless you add your own tunnel or shared network path. - -Verify the Endpoint from a Sandbox# -openshell inference set and openshell inference update verify the resolved upstream endpoint by default before saving the configuration. If the endpoint is not live yet, retry with --no-verify to persist the route without the probe. -openshell inference get confirms the current saved configuration. To confirm end-to-end connectivity from a sandbox, run: -curl https://inference.local/v1/responses \ - -H "Content-Type: application/json" \ - -d '{ - "instructions": "You are a helpful assistant.", - "input": "Hello!" - }' - - -A successful response confirms the privacy router can reach the configured backend and the model is serving requests. - -Gateway-scoped: Every sandbox using the active gateway sees the same inference.local backend. -HTTPS only: inference.local is intercepted only for HTTPS traffic. -Hot reload: Provider and inference changes are picked up within about 5 seconds by default. - - - - -Next Steps# -Explore related topics: - -To understand the inference routing flow and supported API patterns, refer to About Inference Routing. -To follow a complete Ollama-based local setup, refer to Run Local Inference with Ollama. -To follow a complete LM Studio-based local setup, refer to Route Local Inference Requests to LM Studio. -To control external endpoints, refer to Policies. -To manage provider records, refer to Manage Providers and Credentials. - - - - - -
- - - -About Inference Routing# -NVIDIA OpenShell handles inference traffic through two endpoints: inference.local and external endpoints. -The following table summarizes how OpenShell handles inference traffic. - - -Path -How It Works - - - -External endpoints -Traffic to hosts like api.openai.com or api.anthropic.com is treated like any other outbound request, allowed or denied by network_policies. Refer to Customize Sandbox Policies. - -inference.local -A special endpoint exposed inside every sandbox for routing inference traffic locally, preserving privacy and security. The privacy router strips the original credentials, injects the configured backend credentials, and forwards to the managed model endpoint. - - - - - -How inference.local Works# -When code inside a sandbox calls https://inference.local, the privacy router routes the request to the configured backend for that gateway. The configured model is applied to generation requests, and provider credentials are supplied by OpenShell rather than by code inside the sandbox. -If code calls an external inference host directly, that traffic is evaluated only by network_policies. - - -Property -Detail - - - -Credentials -No sandbox API keys needed. Credentials come from the configured provider record. - -Configuration -One provider and one model define sandbox inference for the active gateway. Every sandbox on that gateway sees the same inference.local backend. - -Provider support -OpenAI, Anthropic, and NVIDIA providers all work through the same endpoint. - -Hot-refresh -OpenShell picks up provider credential changes and inference updates without recreating sandboxes. Changes propagate within about 5 seconds by default. - - - - - - -Supported API Patterns# -Supported request patterns depend on the provider configured for inference.local. - - - -OpenAI-compatible - - -Pattern -Method -Path - - - -Chat Completions -POST -/v1/chat/completions - -Completions -POST -/v1/completions - -Responses -POST -/v1/responses - -Model Discovery -GET -/v1/models - -Model Discovery -GET -/v1/models/* - - - - - - - -Anthropic-compatible - - -Pattern -Method -Path - - - -Messages -POST -/v1/messages - - - - - - -Requests to inference.local that do not match the configured provider’s supported patterns are denied. - - -Next Steps# -Continue with one of the following: - -To set up the backend behind inference.local, refer to Configure Inference Routing. -To control external endpoints, refer to Policies. - - - - - -
- - -Default Policy Reference# -The default policy is the policy applied when you create an OpenShell sandbox without --policy. It is baked into the community base image (ghcr.io/nvidia/openshell-community/sandboxes/base) and defined in the community repo’s dev-sandbox-policy.yaml. - -Agent Compatibility# -The following table shows the coverage of the default policy for common agents. - - -Agent -Coverage -Action Required - - - -Claude Code -Full -None. Works out of the box. - -OpenCode -Partial -Add opencode.ai endpoint and OpenCode binary paths. - -Codex -None -Provide a complete custom policy with OpenAI endpoints and Codex binary paths. - - - - - -Important -If you run a non-Claude agent without a custom policy, the agent’s API calls are denied by the proxy. You must provide a policy that declares the agent’s endpoints and binaries. - - - -Default Policy Blocks# -The default policy blocks are defined in the community base image. See the openshell-community repository for the full dev-sandbox-policy.yaml source. - - - - -
- - - -Gateway Authentication# -This page describes how the CLI resolves a gateway, authenticates with it, and where credentials are stored. For how to deploy or register gateways, refer to Manage Sandboxes. - -Gateway Resolution# -When any CLI command needs to talk to the gateway, it resolves the target through a priority chain: - ---gateway-endpoint <URL> flag (direct URL). --g <NAME> flag. -OPENSHELL_GATEWAY environment variable. -Active gateway from ~/.config/openshell/active_gateway. - -The CLI loads gateway metadata from disk to determine the endpoint URL and authentication mode. - - -Authentication Modes# -The CLI uses one of three connection modes depending on the gateway’s authentication configuration. - -mTLS (local and remote gateways)# -The default mode for self-deployed gateways. When you run gateway start or gateway add --local / gateway add --remote, the CLI extracts mTLS certificates from the running container and stores them locally. Every subsequent request presents a client certificate to prove identity. -The CLI loads three PEM files from ~/.config/openshell/gateways/<name>/mtls/: - - -File -Purpose - - - -ca.crt -CA certificate. Verifies the gateway’s server certificate. - -tls.crt -Client certificate. Proves the CLI’s identity to the gateway. - -tls.key -Client private key. - - - - -The connection flow: - -The CLI loads the three certificate files. -Opens a TCP connection to the gateway endpoint. -Performs a TLS handshake, presenting the client certificate. -The gateway verifies the client certificate against its CA. -An HTTP/2 channel is established. All CLI commands use this channel. - - - -Edge JWT (cloud gateways)# -For gateways behind a reverse proxy that handles authentication (e.g. Cloudflare Access), the CLI uses a browser-based login flow and routes traffic through a WebSocket tunnel. -Registration flow (openshell gateway add https://gateway.example.com): - -The CLI stores gateway metadata with the edge authentication mode. -Opens your browser to the gateway’s authentication endpoint. -The reverse proxy handles login (SSO, identity provider, etc.). -After authentication, the browser relays the authorization token back to the CLI via a localhost callback. -The CLI stores the token and sets the gateway as active. - -Connection flow (subsequent commands): - -The CLI starts a local proxy that listens on an ephemeral port. -The proxy opens a WebSocket connection (wss://) to the gateway, attaching the stored bearer token in the upgrade headers. -The reverse proxy authenticates the WebSocket upgrade request. -The gateway bridges the WebSocket into the same service that handles direct mTLS connections. -CLI commands send requests through the local proxy as plaintext HTTP/2 over the tunnel. - -This is transparent to the user. All CLI commands work the same regardless of whether the gateway uses mTLS or edge authentication. -Re-authentication: If the token expires, run openshell gateway login to open the browser flow again and update the stored token. - - -Plaintext# -When a gateway is deployed with --plaintext, TLS is disabled entirely. The CLI connects over plain HTTP/2. This mode is intended for gateways behind a trusted reverse proxy or tunnel that handles TLS termination externally. - - - -File Layout# -All gateway credentials and metadata are stored under ~/.config/openshell/: -openshell/ - active_gateway # Plain text: active gateway name - gateways/ - <name>/ - metadata.json # Gateway metadata (endpoint, auth mode, type) - mtls/ # mTLS bundle (local and remote gateways) - ca.crt # CA certificate - tls.crt # Client certificate - tls.key # Client private key - edge_token # Edge auth JWT (cloud gateways) - last_sandbox # Last-used sandbox for this gateway - - - - - - -
- - - -Policy Schema Reference# -Complete field reference for the sandbox policy YAML. Each field is documented with its type, whether it is required, and whether it is static (locked at sandbox creation) or dynamic (hot-reloadable on a running sandbox). - -Top-Level Structure# -A policy YAML file contains the following top-level fields: -version: 1 -filesystem_policy: { ... } -landlock: { ... } -process: { ... } -network_policies: { ... } - - - - -Field -Type -Required -Category -Description - - - -version -integer -Yes -– -Policy schema version. Must be 1. - -filesystem_policy -object -No -Static -Controls which directories the agent can read and write. - -landlock -object -No -Static -Configures Landlock LSM enforcement behavior. - -process -object -No -Static -Sets the user and group the agent process runs as. - -network_policies -map -No -Dynamic -Declares which binaries can reach which network endpoints. - - - - -Static fields are set at sandbox creation time. Changing them requires destroying and recreating the sandbox. Dynamic fields can be updated on a running sandbox with openshell policy set and take effect without restarting. - - -Version# -The version field identifies which schema the policy uses: - - -Field -Type -Required -Description - - - -version -integer -Yes -Schema version number. Currently must be 1. - - - - - - -Filesystem Policy# -Category: Static -Controls filesystem access inside the sandbox. Paths not listed in either read_only or read_write are inaccessible. - - -Field -Type -Required -Description - - - -include_workdir -bool -No -When true, automatically adds the agent’s working directory to read_write. - -read_only -list of strings -No -Paths the agent can read but not modify. Typically system directories like /usr, /lib, /etc. - -read_write -list of strings -No -Paths the agent can read and write. Typically /sandbox (working directory) and /tmp. - - - - -Validation constraints: - -Every path must be absolute (start with /). -Paths must not contain .. traversal components. The server normalizes paths before storage, but rejects policies where traversal would escape the intended scope. -Read-write paths must not be overly broad (for example, / alone is rejected). -Each individual path must not exceed 4096 characters. -The combined total of read_only and read_write paths must not exceed 256. - -Policies that violate these constraints are rejected with INVALID_ARGUMENT at creation or update time. Disk-loaded YAML policies that fail validation fall back to a restrictive default. -Example: -filesystem_policy: - include_workdir: true - read_only: - - /usr - - /lib - - /proc - - /dev/urandom - - /etc - read_write: - - /sandbox - - /tmp - - /dev/null - - - - -Landlock# -Category: Static -Configures Landlock LSM enforcement at the kernel level. Landlock provides mandatory filesystem access control below what UNIX permissions allow. - - -Field -Type -Required -Values -Description - - - -compatibility -string -No -best_effort, hard_requirement -How OpenShell handles kernel ABI differences. best_effort uses the highest Landlock ABI the host kernel supports. hard_requirement fails if the required ABI is unavailable. - - - - -Example: -landlock: - compatibility: best_effort - - - - -Process# -Category: Static -Sets the OS-level identity for the agent process inside the sandbox. - - -Field -Type -Required -Description - - - -run_as_user -string -No -The user name or UID the agent process runs as. Default: sandbox. - -run_as_group -string -No -The group name or GID the agent process runs as. Default: sandbox. - - - - -Validation constraint: Neither run_as_user nor run_as_group may be set to root or 0. Policies that request root process identity are rejected at creation or update time. -Example: -process: - run_as_user: sandbox - run_as_group: sandbox - - - - -Network Policies# -Category: Dynamic -A map of named network policy entries. Each entry declares a set of endpoints and a set of binaries. Only the listed binaries are permitted to connect to the listed endpoints. The map key is a logical identifier. The name field inside the entry is the display name used in logs. - -Network Policy Entry# -Each entry in the network_policies map has the following fields: - - -Field -Type -Required -Description - - - -name -string -No -Display name for the policy entry. Used in log output. Defaults to the map key. - -endpoints -list of endpoint objects -Yes -Hosts and ports this entry permits. - -binaries -list of binary objects -Yes -Executables allowed to connect to these endpoints. - - - - - - -Endpoint Object# -Each endpoint defines a reachable destination and optional inspection rules. - - -Field -Type -Required -Description - - - -host -string -Yes -Hostname or IP address. Supports wildcards: *.example.com matches any subdomain. - -port -integer -Yes -TCP port number. - -protocol -string -No -Set to rest to enable HTTP request inspection. Omit for TCP passthrough. - -tls -string -No -TLS handling mode. terminate decrypts TLS at the proxy for inspection. passthrough forwards encrypted traffic without inspection. Only relevant when protocol is rest. - -enforcement -string -No -enforce actively blocks disallowed requests. audit logs violations but allows traffic through. - -access -string -No -HTTP access level. One of read-only, read-write, or full. Mutually exclusive with rules. - -rules -list of rule objects -No -Fine-grained per-method, per-path allow rules. Mutually exclusive with access. - - - - - -Access Levels# -The access field accepts one of the following values: - - -Value -Allowed HTTP Methods - - - -full -All methods and paths. - -read-only -GET, HEAD, OPTIONS. - -read-write -GET, HEAD, OPTIONS, POST, PUT, PATCH. - - - - - - -Rule Object# -Used when access is not set. Each rule explicitly allows a method and path combination. - - -Field -Type -Required -Description - - - -allow.method -string -Yes -HTTP method to allow (for example, GET, POST). - -allow.path -string -Yes -URL path pattern. Supports * and ** glob syntax. - - - - -Example with rules: -rules: - - allow: - method: GET - path: /**/info/refs* - - allow: - method: POST - path: /**/git-upload-pack - - - - - -Binary Object# -Identifies an executable that is permitted to use the associated endpoints. - - -Field -Type -Required -Description - - - -path -string -Yes -Filesystem path to the executable. Supports glob patterns with * and **. For example, /sandbox/.vscode-server/** matches any executable under that directory tree. - - - - - - -Full Example# -The following policy grants read-only GitHub API access and npm registry access: -network_policies: - github_rest_api: - name: github-rest-api - endpoints: - - host: api.github.com - port: 443 - protocol: rest - tls: terminate - enforcement: enforce - access: read-only - binaries: - - path: /usr/local/bin/claude - - path: /usr/bin/node - - path: /usr/bin/gh - npm_registry: - name: npm-registry - endpoints: - - host: registry.npmjs.org - port: 443 - binaries: - - path: /usr/bin/npm - - path: /usr/bin/node - - - - - - - -
- - - -Support Matrix# -This page lists the platform, software, runtime, and kernel requirements for running OpenShell. - -Supported Platforms# -OpenShell publishes multi-architecture container images for linux/amd64 and linux/arm64. The CLI is supported on the following host platforms: - - -Platform -Architecture -Status - - - -Linux (Debian/Ubuntu) -x86_64 (amd64) -Supported - -Linux (Debian/Ubuntu) -aarch64 (arm64) -Supported - -macOS (Docker Desktop) -Apple Silicon (arm64) -Supported - -Windows (WSL 2 + Docker Desktop) -x86_64 -Experimental - - - - - - -Software Prerequisites# -The following software must be installed on the host before using the OpenShell CLI: - - -Component -Minimum Version -Notes - - - -Docker Desktop or Docker Engine -28.04 -Must be running before any openshell command. - - - - - - -Sandbox Runtime Versions# -Sandbox container images are maintained in the openshell-community repository. Refer to that repository for the current list of installed components and their versions. - - -Container Images# -OpenShell publishes two container images. Both are published for linux/amd64 and linux/arm64. - - -Image -Reference -Pulled When - - - -Cluster -ghcr.io/nvidia/openshell/cluster:latest -openshell gateway start - -Gateway -ghcr.io/nvidia/openshell/gateway:latest -Cluster startup (via Helm chart) - - - - -The cluster image bundles the Helm charts, Kubernetes manifests, and the openshell-sandbox supervisor binary required to bootstrap the control plane. The supervisor binary is side-loaded into sandbox pods at runtime through a read-only host volume mount. The gateway image is pulled at cluster startup and runs the API server. -Sandbox images are maintained separately in the openshell-community repository. -To override the default image references, set the following environment variables: - - -Variable -Purpose - - - -OPENSHELL_CLUSTER_IMAGE -Override the cluster image reference. - -OPENSHELL_COMMUNITY_REGISTRY -Override the registry for community sandbox images. - - - - - - -Kernel Requirements# -OpenShell enforces sandbox isolation through two Linux kernel security modules: - - -Module -Requirement -Details - - - -Landlock LSM -Recommended -Enforces filesystem access restrictions at the kernel level. The best_effort compatibility mode uses the highest Landlock ABI the host kernel supports. The hard_requirement mode fails sandbox creation if the required ABI is unavailable. - -seccomp -Required -Filters dangerous system calls. Available on all modern Linux kernels (3.17+). - - - - -On macOS, these kernel modules run inside the Docker Desktop Linux VM, not on the host kernel. - - -Agent Compatibility# -For the full list of supported agents and their default policy coverage, refer to the Supported Agents page. - - - - -
- - - -License# -NVIDIA OpenShell is licensed under the Apache License, Version 2.0. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -Definitions. -“License” shall mean the terms and conditions for use, reproduction, -and distribution as defined by Sections 1 through 9 of this document. -“Licensor” shall mean the copyright owner or entity authorized by -the copyright owner that is granting the License. -“Legal Entity” shall mean the union of the acting entity and all -other entities that control, are controlled by, or are under common -control with that entity. For the purposes of this definition, -“control” means (i) the power, direct or indirect, to cause the -direction or management of such entity, whether by contract or -otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. -“You” (or “Your”) shall mean an individual or Legal Entity -exercising permissions granted by this License. -“Source” form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation -source, and configuration files. -“Object” form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but -not limited to compiled object code, generated documentation, -and conversions to other media types. -“Work” shall mean the work of authorship, whether in Source or -Object form, made available under the License, as indicated by a -copyright notice that is included in or attached to the work -(an example is provided in the Appendix below). -“Derivative Works” shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, -the Work and Derivative Works thereof. -“Contribution” shall mean any work of authorship, including -the original version of the Work and any modifications or additions -to that Work or Derivative Works thereof, that is intentionally -submitted to the Licensor for inclusion in the Work by the copyright owner -or by an individual or Legal Entity authorized to submit on behalf of -the copyright owner. For the purposes of this definition, “submitted” -means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, -and issue tracking systems that are managed by, or on behalf of, the -Licensor for the purpose of discussing and improving the Work, but -excluding communication that is conspicuously marked or otherwise -designated in writing by the copyright owner as “Not a Contribution.” -“Contributor” shall mean Licensor and any individual or Legal Entity -on behalf of whom a Contribution has been received by the Licensor and -subsequently incorporated within the Work. - -Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the -Work and such Derivative Works in Source or Object form. -Grant of Patent License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable -(except as stated in this section) patent license to make, have made, -use, offer to sell, sell, import, and otherwise transfer the Work, -where such license applies only to those patent claims licensable -by such Contributor that are necessarily infringed by their -Contribution(s) alone or by combination of their Contribution(s) -with the Work to which such Contribution(s) was submitted. If You -institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work -or a Contribution incorporated within the Work constitutes direct -or contributory patent infringement, then any patent licenses -granted to You under this License for that Work shall terminate -as of the date such litigation is filed. -Redistribution. You may reproduce and distribute copies of the -Work or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You -meet the following conditions: -(a) You must give any other recipients of the Work or -Derivative Works a copy of this License; and -(b) You must cause any modified files to carry prominent notices -stating that You changed the files; and -(c) You must retain, in the Source form of any Derivative Works -that You distribute, all copyright, patent, trademark, and -attribution notices from the Source form of the Work, -excluding those notices that do not pertain to any part of -the Derivative Works; and -(d) If the Work includes a “NOTICE” text file as part of its -distribution, then any Derivative Works that You distribute must -include a readable copy of the attribution notices contained -within such NOTICE file, excluding any notices that do not -pertain to any part of the Derivative Works, in at least one -of the following places: within a NOTICE text file distributed -as part of the Derivative Works; within the Source form or -documentation, if provided along with the Derivative Works; or, -within a display generated by the Derivative Works, if and -wherever such third-party notices normally appear. The contents -of the NOTICE file are for informational purposes only and -do not modify the License. You may add Your own attribution -notices within Derivative Works that You distribute, alongside -or as an addendum to the NOTICE text from the Work, provided -that such additional attribution notices cannot be construed -as modifying the License. -You may add Your own copyright statement to Your modifications and -may provide additional or different license terms and conditions -for use, reproduction, or distribution of Your modifications, or -for any such Derivative Works as a whole, provided Your use, -reproduction, and distribution of the Work otherwise complies with -the conditions stated in this License. - -Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work -by You to the Licensor shall be under the terms and conditions of -this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify -the terms of any separate license agreement you may have executed -with Licensor regarding such Contributions. -Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the -origin of the Work and reproducing the content of the NOTICE file. -Disclaimer of Warranty. Unless required by applicable law or -agreed to in writing, Licensor provides the Work (and each -Contributor provides its Contributions) on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied, including, without limitation, any warranties or conditions -of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A -PARTICULAR PURPOSE. You are solely responsible for determining the -appropriateness of using or redistributing the Work and assume any -risks associated with Your exercise of permissions under this License. -Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, -unless required by applicable law (such as deliberate and grossly -negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, -incidental, or consequential damages of any character arising as a -result of this License or out of the use or inability to use the -Work (including but not limited to damages for loss of goodwill, -work stoppage, computer failure or malfunction, or any and all -other commercial damages or losses), even if such Contributor -has been advised of the possibility of such damages. -Accepting Warranty or Additional Liability. While redistributing -the Work or Derivative Works thereof, You may choose to offer, -and charge a fee for, acceptance of support, warranty, indemnity, -or other liability obligations and/or rights consistent with this -License. However, in accepting such obligations, You may act only -on Your own behalf and on Your sole responsibility, not on behalf -of any other Contributor, and only if You agree to indemnify, -defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason -of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS -Copyright 2025-2026 NVIDIA CORPORATION & AFFILIATES -Licensed under the Apache License, Version 2.0 (the “License”); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - - -
- - - -Community Sandboxes# -Use pre-built sandboxes from the OpenShell Community catalog, or contribute your -own. - -What Are Community Sandboxes# -Community sandboxes are ready-to-use environments published in the -OpenShell Community repository. -Each sandbox bundles a Dockerfile, policy, optional skills, and startup scripts -into a single package that you can launch with one command. - - -Current Catalog# -The following community sandboxes are available in the catalog. - - -Sandbox -Description - - - -base -Foundational image with system tools and dev environment - -openclaw -Open agent manipulation and control - -sdg -Synthetic data generation workflows - - - - - - -Use a Community Sandbox# -Launch a community sandbox by name with the --from flag: -$ openshell sandbox create --from openclaw - - -When you pass --from with a community sandbox name, the CLI: - -Resolves the name against the -OpenShell Community repository. -Pulls the Dockerfile, policy, skills, and any startup scripts. -Builds the container image locally. -Creates the sandbox with the bundled configuration applied. - -You end up with a running sandbox whose image, policy, and tooling are all -preconfigured by the community package. - -Other Sources# -The --from flag also accepts: - -Local directory paths: Point to a directory on disk that contains a -Dockerfile and optional policy/skills: -$ openshell sandbox create --from ./my-sandbox-dir - - - -Container image references: Use an existing container image directly: -$ openshell sandbox create --from my-registry.example.com/my-image:latest - - - - - - - -Contribute a Community Sandbox# -Each community sandbox is a directory under sandboxes/ in the -OpenShell Community repository. -At minimum, a sandbox directory must contain the following files: - -Dockerfile that defines the container image. -README.md that describes the sandbox and how to use it. - -You can also include the following optional files: - -policy.yaml that defines the default policy applied when the sandbox launches. -skills/ that contains agent skill definitions bundled with the sandbox. -Startup scripts that are any scripts the Dockerfile or entrypoint invokes. - -To contribute, fork the repository, add your sandbox directory, and open a pull -request. Refer to the repository’s -CONTRIBUTING.md -for submission guidelines. - -Note -The community catalog is designed to grow. If you have built a sandbox that -supports a particular workflow (data processing, simulation, code review, -or anything else), consider contributing it back so others can use it. - - - -Next Steps# -Explore related topics: - -Need to supply API keys or tokens? Set up Manage Providers and Credentials for credential management. -Want to customize the sandbox policy? Write custom rules in Customize Sandbox Policies. - - - - - -
- - - -About Gateways and Sandboxes# -Every OpenShell deployment starts with a gateway and one or more sandboxes. The gateway is the control plane that manages sandbox lifecycle, providers, and policies. A sandbox is the data plane, a safe, private execution environment where an AI agent runs. Each sandbox runs with multiple layers of protection that prevent unauthorized data access, credential exposure, and network exfiltration. Protection layers include filesystem restrictions (Landlock), system call filtering (seccomp), network namespace isolation, and a privacy-enforcing HTTP CONNECT proxy. - -Gateway Types# -A gateway provisions sandboxes, brokers CLI requests, enforces policies, and manages provider credentials. OpenShell supports three deployment models, so the gateway can run wherever your workload requires. - - -Type -Where It Runs -Best For - - - -Local -Docker on your workstation -Solo development and quick iteration. The CLI auto-bootstraps a local gateway if none exists. - -Remote -Docker on a remote host via SSH -Running sandboxes on a more powerful machine (for example, a DGX Spark) while keeping the CLI on your laptop. - -Cloud -Behind a reverse proxy (for example, Cloudflare Access) -Individual users accessing OpenShell behind a cloud VM. Cloud gateways are not yet intended for shared team access. - - - - -All three types expose the same API surface. Sandboxes, policies, and providers work identically regardless of where the gateway runs. The only difference is how the CLI reaches the gateway, whether through a direct Docker socket, SSH tunnel, or HTTPS through a proxy. - -Tip -You do not need to deploy a gateway manually. Running openshell sandbox create without a gateway auto-bootstraps a local one for you. - - - -Sandbox Lifecycle# -Every sandbox moves through a defined set of phases: - - -Phase -Description - - - -Provisioning -The runtime is setting up the sandbox environment, injecting credentials, and applying your policy. - -Ready -The sandbox is running. The agent process is active and all isolation layers are enforced. You can connect, sync files, and view logs. - -Error -Something went wrong during provisioning or execution. Check logs with openshell logs for details. - -Deleting -The sandbox is being torn down. The system releases resources and purges credentials. - - - - - - -Sandbox Policies# -OpenShell ships a built-in policy that covers common agent workflows out of the box. -When you create a sandbox without --policy, the default policy is applied. It controls three areas. - - -Layer -What It Controls -How It Works - - - -Filesystem -What the agent can access on disk -Paths are split into read-only and read-write sets. Landlock LSM enforces these restrictions at the kernel level. - -Network -What the agent can reach on the network -Each policy block pairs allowed destinations (host and port) with allowed binaries (executable paths). The proxy matches every outbound connection to the binary that opened it. Both must match or the connection is denied. - -Process -What privileges the agent has -The agent runs as an unprivileged user with seccomp filters that block dangerous system calls. No sudo, no setuid, no path to elevated privileges. - - - - -For the full breakdown of each default policy block and agent compatibility details, refer to Default Policy Reference. -For the full policy structure with annotated YAML examples, refer to Customize Sandbox Policies. - - -Next Steps# -Continue with one of the following: - -To create your first sandbox, refer to Manage Sandboxes. -To supply API keys or tokens, refer to Manage Providers and Credentials. -To control what the agent can access, refer to Customize Sandbox Policies. -To use a pre-built environment, refer to the Community Sandboxes catalog. - - - - - -
- - - -Deploy and Manage Gateways# -The gateway is the control plane for OpenShell. All control-plane traffic between the CLI and running sandboxes flows through the gateway. -The gateway is responsible for: - -Provisioning and managing sandboxes, including creation, deletion, and status monitoring. -Storing provider credentials (API keys, tokens) and delivering them to sandboxes at startup. -Delivering network and filesystem policies to sandboxes. Policy enforcement itself happens inside each sandbox through the proxy, OPA, Landlock, and seccomp. -Managing inference configuration and serving inference bundles so sandboxes can route requests to the correct backend. -Providing the SSH tunnel endpoint so you can connect to sandboxes without exposing them directly. - -The gateway runs inside a Docker container and exposes a single port (gRPC and HTTP multiplexed), secured by mTLS by default. No separate Kubernetes installation is required. It can be deployed locally, on a remote host via SSH, or behind a cloud reverse proxy. - -Deploy a Local Gateway# -Deploy a gateway on your workstation. The only prerequisite is a running Docker daemon. -$ openshell gateway start - - -The gateway becomes reachable at https://127.0.0.1:8080. Verify it is healthy: -$ openshell status - - - -Tip -You do not need to deploy a gateway manually. If you run openshell sandbox create without a gateway, the CLI auto-bootstraps a local gateway for you. - -To use a different port or name: -$ openshell gateway start --port 9090 -$ openshell gateway start --name dev-local - - - - -Deploy a Remote Gateway# -Deploy a gateway on a remote machine accessible via SSH. The only dependency on the remote host is Docker. -$ openshell gateway start --remote user@hostname - - -The gateway is reachable at https://<hostname>:8080. -To specify an SSH key: -$ openshell gateway start --remote user@hostname --ssh-key ~/.ssh/my_key - - - -Note -For DGX Spark, use your Spark’s mDNS hostname: -$ openshell gateway start --remote <username>@<spark-ssid>.local - - - - - -Register an Existing Gateway# -Use openshell gateway add to register a gateway that is already running. - -Cloud Gateway# -Register a gateway behind a reverse proxy such as Cloudflare Access: -$ openshell gateway add https://gateway.example.com - - -This opens your browser for the proxy’s login flow. After authentication, the CLI stores a bearer token and sets the gateway as active. -To give the gateway a specific name instead of deriving it from the hostname, use --name: -$ openshell gateway add https://gateway.example.com --name production - - -If the token expires later, re-authenticate with: -$ openshell gateway login - - - - -Remote Gateway# -Register a gateway on a remote host you have SSH access to: -$ openshell gateway add https://remote-host:8080 --remote user@remote-host - - -Or use the ssh:// scheme to combine the SSH destination and gateway port: -$ openshell gateway add ssh://user@remote-host:8080 - - - - -Local Gateway# -Register a gateway running locally that was started outside the CLI: -$ openshell gateway add https://127.0.0.1:8080 --local - - - - - -Manage Multiple Gateways# -One gateway is always the active gateway. All CLI commands target it by default. Both gateway start and gateway add automatically set the new gateway as active. -List all registered gateways: -$ openshell gateway select - - -Switch the active gateway: -$ openshell gateway select my-remote-cluster - - -Override the active gateway for a single command with -g: -$ openshell status -g my-other-cluster - - -Show deployment details for a gateway, including endpoint, auth mode, and port: -$ openshell gateway info -$ openshell gateway info --name my-remote-cluster - - - - -Advanced Start Options# - - -Flag -Purpose - - - ---gpu -Enable NVIDIA GPU passthrough. Requires NVIDIA drivers and the Container Toolkit on the host. - ---plaintext -Listen on HTTP instead of mTLS. Use behind a TLS-terminating reverse proxy. - ---disable-gateway-auth -Skip mTLS client certificate checks. Use when a reverse proxy cannot forward client certs. - ---registry-username -Username for registry authentication. Defaults to __token__ when --registry-token is set. Only needed for private registries. Also configurable with OPENSHELL_REGISTRY_USERNAME. - ---registry-token -Authentication token for pulling container images. For GHCR, a GitHub PAT with read:packages scope. Only needed for private registries. Also configurable with OPENSHELL_REGISTRY_TOKEN. - - - - - - -Stop and Destroy# -Stop a gateway while preserving its state for later restart: -$ openshell gateway stop - - -Permanently destroy a gateway and all its state: -$ openshell gateway destroy - - -For cloud gateways, gateway destroy removes only the local registration. It does not affect the remote deployment. -Target a specific gateway with --name: -$ openshell gateway stop --name my-gateway -$ openshell gateway destroy --name my-gateway - - - - -Troubleshoot# -Check gateway health: -$ openshell status - - -View gateway logs: -$ openshell doctor logs -$ openshell doctor logs --tail # stream live -$ openshell doctor logs --lines 50 # last 50 lines - - -Run a command inside the gateway container for deeper inspection: -$ openshell doctor exec -- kubectl get pods -A -$ openshell doctor exec -- sh - - -If the gateway is in a bad state, recreate it: -$ openshell gateway start --recreate - - - - -Next Steps# - -To create a sandbox using the gateway, refer to Manage Sandboxes. -To install the CLI and get started quickly, refer to the Quickstart. - - - - - -
- - - -Manage Providers and Credentials# -AI agents typically need credentials to access external services: an API key for the AI model provider, a token for GitHub or GitLab, and so on. OpenShell manages these credentials as first-class entities called providers. -Create and manage providers that supply credentials to sandboxes. - -Create a Provider# -Providers can be created from local environment variables or with explicit credential values. - -From Local Credentials# -The fastest way to create a provider is to let the CLI discover credentials from -your shell environment: -$ openshell provider create --name my-claude --type claude --from-existing - - -This reads ANTHROPIC_API_KEY or CLAUDE_API_KEY from your current environment -and stores them in the provider. - - -With Explicit Credentials# -Supply a credential value directly: -$ openshell provider create --name my-api --type generic --credential API_KEY=sk-abc123 - - - - -Bare Key Form# -Pass a key name without a value to read the value from the environment variable -of that name: -$ openshell provider create --name my-api --type generic --credential API_KEY - - -This looks up the current value of $API_KEY in your shell and stores it. - - - -Manage Providers# -List, inspect, update, and delete providers from the active cluster. -List all providers: -$ openshell provider list - - -Inspect a provider: -$ openshell provider get my-claude - - -Update a provider’s credentials: -$ openshell provider update my-claude --type claude --from-existing - - -Delete a provider: -$ openshell provider delete my-claude - - - - -Attach Providers to Sandboxes# -Pass one or more --provider flags when creating a sandbox: -$ openshell sandbox create --provider my-claude --provider my-github -- claude - - -Each --provider flag attaches one provider. The sandbox receives all -credentials from every attached provider at runtime. - -Warning -Providers cannot be added to a running sandbox. If you need to attach an -additional provider, delete the sandbox and recreate it with all required -providers specified. - - -Auto-Discovery Shortcut# -When the trailing command in openshell sandbox create is a recognized tool name (claude, codex, or opencode), the CLI auto-creates the required -provider from your local credentials if one does not already exist. You do not -need to create the provider separately: -$ openshell sandbox create -- claude - - -This detects claude as a known tool, finds your ANTHROPIC_API_KEY, creates -a provider, attaches it to the sandbox, and launches Claude Code. - - - -Supported Provider Types# -The following provider types are supported. - - -Type -Environment Variables Injected -Typical Use - - - -claude -ANTHROPIC_API_KEY, CLAUDE_API_KEY -Claude Code, Anthropic API - -codex -OPENAI_API_KEY -OpenAI Codex - -opencode -OPENCODE_API_KEY, OPENROUTER_API_KEY, OPENAI_API_KEY -opencode tool - -github -GITHUB_TOKEN, GH_TOKEN -GitHub API, gh CLI — refer to Grant GitHub Push Access to a Sandboxed Agent - -gitlab -GITLAB_TOKEN, GLAB_TOKEN, CI_JOB_TOKEN -GitLab API, glab CLI - -nvidia -NVIDIA_API_KEY -NVIDIA API Catalog - -generic -User-defined -Any service with custom credentials - - - - - -Tip -Use the generic type for any service not listed above. You define the -environment variable names and values yourself with --credential. - - - -Next Steps# -Explore related topics: - -To control what the agent can access, refer to Customize Sandbox Policies. -To use a pre-built environment, refer to the Community Sandboxes catalog. -To view the complete field reference for the policy YAML, refer to the Policy Schema Reference. - - - - - -
- - - -Manage Sandboxes# -This page covers creating sandboxes and managing them. For background on what sandboxes are and how isolation works, refer to About Sandboxes. - -Important -Docker must be running before you create a gateway or sandbox. If it is not, the CLI -returns a connection-refused error (os error 61) without explaining -the cause. Start Docker and try again. - - -Create a Sandbox# -Create a sandbox with a single command. For example, to create a sandbox with Claude, run: -$ openshell sandbox create -- claude - - -Every sandbox requires a gateway. If you run openshell sandbox create without a gateway, the CLI auto-bootstraps a local gateway. - -Remote Gateways# -If you plan to run sandboxes on a remote host or a cloud-hosted gateway, set up the gateway first. Refer to Deploy and Manage Gateways for deployment options and multi-gateway management. - - -GPU Resources# -To request GPU resources, add --gpu: -$ openshell sandbox create --gpu -- claude - - - - -Custom Containers# -Use --from to create a sandbox from a pre-built community package, a local directory, or a container image: -$ openshell sandbox create --from openclaw -$ openshell sandbox create --from ./my-sandbox-dir -$ openshell sandbox create --from my-registry.example.com/my-image:latest - - -The CLI resolves community names against the OpenShell Community catalog, pulls the bundled Dockerfile and policy, builds the image locally, and creates the sandbox. For the full catalog and how to contribute your own, refer to Community Sandboxes. - - - -Connect to a Sandbox# -Open an SSH session into a running sandbox: -$ openshell sandbox connect my-sandbox - - -Launch VS Code or Cursor directly into the sandbox workspace: -$ openshell sandbox create --editor vscode --name my-sandbox -$ openshell sandbox connect my-sandbox --editor cursor - - -When --editor is used, OpenShell keeps the sandbox alive and installs an -OpenShell-managed SSH include file instead of cluttering your main -~/.ssh/config with generated host blocks. - - -Monitor and Debug# -List all sandboxes: -$ openshell sandbox list - - -Get detailed information about a specific sandbox: -$ openshell sandbox get my-sandbox - - -Stream sandbox logs to monitor agent activity and diagnose policy decisions: -$ openshell logs my-sandbox - - - - -Flag -Purpose -Example - - - ---tail -Stream logs in real time -openshell logs my-sandbox --tail - ---source -Filter by log source ---source sandbox - ---level -Filter by severity ---level warn - ---since -Show logs from a time window ---since 5m - - - - -OpenShell Terminal combines sandbox status and live logs in a single real-time dashboard: -$ openshell term - - -Use the terminal to spot blocked connections marked action=deny and inference-related proxy activity. If a connection is blocked unexpectedly, add the host to your network policy. Refer to Customize Sandbox Policies for the workflow. - - -Port Forwarding# -Forward a local port to a running sandbox to access services inside it, such as a web server or database: -$ openshell forward start 8000 my-sandbox -$ openshell forward start 8000 my-sandbox -d # run in background - - -List and stop active forwards: -$ openshell forward list -$ openshell forward stop 8000 my-sandbox - - - -Tip -You can also forward a port at creation time with --forward: -$ openshell sandbox create --forward 8000 -- claude - - - - - -SSH Config# -Generate an SSH config entry for a sandbox so tools like VS Code Remote-SSH can connect directly: -$ openshell sandbox ssh-config my-sandbox - - -Append the output to ~/.ssh/config or use --editor on sandbox create/sandbox connect for automatic setup. - - -Transfer Files# -Upload files from your host into the sandbox: -$ openshell sandbox upload my-sandbox ./src /sandbox/src - - -Download files from the sandbox to your host: -$ openshell sandbox download my-sandbox /sandbox/output ./local - - - -Note -You can also upload files at creation time with the --upload flag on -openshell sandbox create. - - - -Delete Sandboxes# -Deleting a sandbox stops all processes, releases resources, and purges injected credentials. -$ openshell sandbox delete my-sandbox - - - - -Next Steps# - -To follow a complete end-to-end example, refer to the Grant GitHub Push Access to a Sandboxed Agent tutorial. -To supply API keys or tokens, refer to Manage Providers and Credentials. -To control what the agent can access, refer to Customize Sandbox Policies. -To use a pre-built environment, refer to the Community Sandboxes catalog. - - - - - -
- - - -Customize Sandbox Policies# -Use this page to apply and iterate policy changes on running sandboxes. For a full field-by-field YAML definition, use the Policy Schema Reference. - -Policy Structure# -A policy has static sections filesystem_policy, landlock, and process that are locked at sandbox creation, and a dynamic section network_policies that is hot-reloadable on a running sandbox. -version: 1 - -# Static: locked at sandbox creation. Paths the agent can read vs read/write. -filesystem_policy: - read_only: [/usr, /lib, /etc] - read_write: [/sandbox, /tmp] - -# Static: Landlock LSM kernel enforcement. best_effort uses highest ABI the host supports. -landlock: - compatibility: best_effort - -# Static: Unprivileged user/group the agent process runs as. -process: - run_as_user: sandbox - run_as_group: sandbox - -# Dynamic: hot-reloadable. Named blocks of endpoints + binaries allowed to reach them. -network_policies: - my_api: - name: my-api - endpoints: - - host: api.example.com - port: 443 - protocol: rest - tls: terminate - enforcement: enforce - access: full - binaries: - - path: /usr/bin/curl - - -Static sections are locked at sandbox creation. Changing them requires destroying and recreating the sandbox. -Dynamic sections can be updated on a running sandbox with openshell policy set and take effect without restarting. - - -Section -Type -Description - - - -filesystem_policy -Static -Controls which directories the agent can access on disk. Paths are split into read_only and read_write lists. Any path not listed in either list is inaccessible. Set include_workdir: true to automatically add the agent’s working directory to read_write. Landlock LSM enforces these restrictions at the kernel level. - -landlock -Static -Configures Landlock LSM enforcement behavior. Set compatibility to best_effort (use the highest ABI the host kernel supports) or hard_requirement (fail if the required ABI is unavailable). - -process -Static -Sets the OS-level identity for the agent process. run_as_user and run_as_group default to sandbox. Root (root or 0) is rejected. The agent also runs with seccomp filters that block dangerous system calls. - -network_policies -Dynamic -Controls network access for ordinary outbound traffic from the sandbox. Each block has a name, a list of endpoints (host, port, protocol, and optional rules), and a list of binaries allowed to use those endpoints. Every outbound connection except https://inference.local goes through the proxy, which queries the policy engine with the destination and calling binary. A connection is allowed only when both match an entry in the same policy block. For endpoints with protocol: rest and tls: terminate, each HTTP request is also checked against that endpoint’s rules (method and path). Endpoints without protocol or tls allow the TCP stream through without inspecting payloads. If no endpoint matches, the connection is denied. Configure managed inference separately through Configure Inference Routing. - - - - - - -Apply a Custom Policy# -Pass a policy YAML file when creating the sandbox: -$ openshell sandbox create --policy ./my-policy.yaml -- claude - - -openshell sandbox create keeps the sandbox running after the initial command exits, which is useful when you plan to iterate on the policy. Add --no-keep if you want the sandbox deleted automatically instead. -To avoid passing --policy every time, set a default policy with an environment variable: -$ export OPENSHELL_SANDBOX_POLICY=./my-policy.yaml -$ openshell sandbox create -- claude - - -The CLI uses the policy from OPENSHELL_SANDBOX_POLICY whenever --policy is not explicitly provided. - - -Iterate on a Running Sandbox# -To change what the sandbox can access, pull the current policy, edit the YAML, and push the update. The workflow is iterative: create the sandbox, monitor logs for denied actions, pull the policy, modify it, push, and verify. - - flowchart TD - A["1. Create sandbox with initial policy"] --> B["2. Monitor logs for denied actions"] - B --> C["3. Pull current policy"] - C --> D["4. Modify the policy YAML"] - D --> E["5. Push updated policy"] - E --> F["6. Verify the new revision loaded"] - F --> B - - style A fill:#76b900,stroke:#000000,color:#000000 - style B fill:#76b900,stroke:#000000,color:#000000 - style C fill:#76b900,stroke:#000000,color:#000000 - style D fill:#ffffff,stroke:#000000,color:#000000 - style E fill:#76b900,stroke:#000000,color:#000000 - style F fill:#76b900,stroke:#000000,color:#000000 - - linkStyle default stroke:#76b900,stroke-width:2px - The following steps outline the hot-reload policy update workflow. - -Create the sandbox with your initial policy by following Apply a Custom Policy above (or set OPENSHELL_SANDBOX_POLICY). -Monitor denials. Each log entry shows host, port, binary, and reason. Alternatively, use openshell term for a live dashboard. -$ openshell logs <name> --tail --source sandbox - - - -Pull the current policy. Strip the metadata header (Version, Hash, Status) before reusing the file. -$ openshell policy get <name> --full > current-policy.yaml - - - -Edit the YAML: add or adjust network_policies entries, binaries, access, or rules. -Push the updated policy. Exit codes: 0 = loaded, 1 = validation failed, 124 = timeout. -$ openshell policy set <name> --policy current-policy.yaml --wait - - - -Verify the new revision. If status is loaded, repeat from step 2 as needed; if failed, fix the policy and repeat from step 4. -$ openshell policy list <name> - - - - - - -Debug Denied Requests# -Check openshell logs <name> --tail --source sandbox for the denied host, path, and binary. -When triaging denied requests, check: - -Destination host and port to confirm which endpoint is missing. -Calling binary path to confirm which binaries entry needs to be added or adjusted. -HTTP method and path (for REST endpoints) to confirm which rules entry needs to be added or adjusted. - -Then push the updated policy as described above. - - -Examples# -Add these blocks to the network_policies section of your sandbox policy. Apply with openshell policy set <name> --policy <file> --wait. -Use Simple endpoint for host-level allowlists and Granular rules for method/path control. - - - -Simple endpoint -Allow pip install and uv pip install to reach PyPI: - pypi: - name: pypi - endpoints: - - host: pypi.org - port: 443 - - host: files.pythonhosted.org - port: 443 - binaries: - - { path: /usr/bin/pip } - - { path: /usr/local/bin/uv } - - -Endpoints without protocol or tls use TCP passthrough — the proxy allows the stream without inspecting payloads. - - - -Granular rules -Allow Claude and the GitHub CLI to reach api.github.com with per-path rules: read-only (GET, HEAD, OPTIONS) and GraphQL (POST) for all paths; full write access for alpha-repo; and create/edit issues only for bravo-repo. Replace <org_name> with your GitHub org or username. - -Tip -For an end-to-end walkthrough that combines this policy with a GitHub credential provider and sandbox creation, refer to Grant GitHub Push Access to a Sandboxed Agent. - - github_repos: - name: github_repos - endpoints: - - host: api.github.com - port: 443 - protocol: rest - tls: terminate - enforcement: enforce - rules: - - allow: - method: GET - path: "/**" - - allow: - method: HEAD - path: "/**" - - allow: - method: OPTIONS - path: "/**" - - allow: - method: POST - path: "/graphql" - - allow: - method: "*" - path: "/repos/<org_name>/alpha-repo/**" - - allow: - method: POST - path: "/repos/<org_name>/bravo-repo/issues" - - allow: - method: PATCH - path: "/repos/<org_name>/bravo-repo/issues/*" - binaries: - - { path: /usr/local/bin/claude } - - { path: /usr/bin/gh } - - -Endpoints with protocol: rest and tls: terminate enable HTTP request inspection — the proxy decrypts TLS and checks each HTTP request against the rules list. - - - - -Next Steps# -Explore related topics: - -To learn about network access rules and sandbox isolation layers, refer to About Gateways and Sandboxes. -To view the full field-by-field YAML definition, refer to the Policy Schema Reference. -To review the default policy breakdown, refer to Default Policy Reference. - - - - - -
- - - -Write Your First Sandbox Network Policy# -This tutorial shows how OpenShell’s network policy system works in under five minutes. You create a sandbox, watch a request get blocked by the default-deny policy, apply a fine-grained L7 rule, and verify that reads are allowed while writes are blocked, all without restarting anything. -After completing this tutorial, you understand: - -How default-deny networking blocks all outbound traffic from a sandbox. -How to apply a network policy that grants read-only access to a specific API. -How L7 enforcement distinguishes between HTTP methods such as GET and POST on the same endpoint. -How to inspect deny logs for a complete audit trail. - - -Prerequisites# - -A working OpenShell installation. Complete the Quickstart before proceeding. -Docker Desktop running on your machine. - - -Tip -To run every step of this tutorial, you can also use the automated demo script at the examples/sandbox-policy-quickstart directory in the NVIDIA OpenShell repository. It runs the full walkthrough in under a minute but without any user interaction. -$ bash examples/sandbox-policy-quickstart/demo.sh - - - - - -Create a Sandbox# -Start by creating a sandbox with no network policies. This gives you a clean environment to observe default-deny behavior. -$ openshell sandbox create --name demo --keep --no-auto-providers - - ---keep keeps the sandbox running after you exit so you can reconnect later. --no-auto-providers skips the provider setup prompt since this tutorial uses curl instead of an AI agent. -You land in an interactive shell inside the sandbox: -sandbox@demo:~$ - - - - -Try to Reach the GitHub API# -With no network policy in place, every outbound connection is blocked. Test this by making a simple API call from inside the sandbox: -$ curl -s https://api.github.com/zen - - -https://api.github.com/zen is a lightweight, unauthenticated GitHub REST endpoint that returns a random aphorism on each call. It requires no tokens or parameters, which makes it a convenient smoke-test target for verifying outbound HTTPS connectivity. -The request fails. By default, all outbound network traffic is denied. The sandbox proxy intercepted the HTTPS CONNECT request to api.github.com:443 and rejected it because no network policy authorizes curl to reach that host. -curl: (56) Received HTTP code 403 from proxy after CONNECT - - -Exit the sandbox. The --keep flag keeps it running: -$ exit - - - - -Check the Deny Log# -Every denied connection produces a structured log entry. Query the sandbox logs from your host to confirm the denial and inspect the reason. -$ openshell logs demo --since 5m - - -You see a line like: -action=deny dst_host=api.github.com dst_port=443 binary=/usr/bin/curl deny_reason="no matching network policy" - - -Every denied connection is logged with the destination, the binary that attempted it, and the reason. Nothing gets out silently. - - -Apply a Read-Only GitHub API Policy# -To allow the sandbox to reach the GitHub API, define a network policy that grants read-only access. The policy specifies which host, port, binary, and HTTP methods are permitted. Create a file called github-readonly.yaml with the following content: -version: 1 - -filesystem_policy: - include_workdir: true - read_only: [/usr, /lib, /proc, /dev/urandom, /app, /etc, /var/log] - read_write: [/sandbox, /tmp, /dev/null] -landlock: - compatibility: best_effort -process: - run_as_user: sandbox - run_as_group: sandbox - -network_policies: - github_api: - name: github-api-readonly - endpoints: - - host: api.github.com - port: 443 - protocol: rest - tls: terminate - enforcement: enforce - access: read-only - binaries: - - { path: /usr/bin/curl } - - -The filesystem_policy, landlock, and process sections preserve the default sandbox settings. This is required because policy set replaces the entire policy. The network_policies section is the key part: curl may make GET, HEAD, and OPTIONS requests to api.github.com over HTTPS. Everything else is denied. The proxy terminates TLS using tls: terminate to inspect each HTTP request and enforce the read-only access preset at the method level. -Apply it: -$ openshell policy set demo --policy github-readonly.yaml --wait - - ---wait blocks until the sandbox confirms the new policy is loaded. No restart required. Policies are hot-reloaded. - -Tip -This tutorial uses curl and read-only access to keep things simple. When building policies for real workloads: - -To scope the policy to an agent, replace the binaries section with your agent’s binary, such as /usr/local/bin/claude, instead of curl. -To grant write access, change access: read-only to read-write or add explicit rules for specific paths. Refer to the Policy Schema Reference. -To allow additional endpoints, stack multiple policies in the same file for PyPI, npm, or your internal APIs. Refer to Customize Sandbox Policies for examples. - - - - -Verify If GET Requests Are Allowed# -The policy is now active. Reconnect to the sandbox and retry the same request to confirm that read access works. -$ openshell sandbox connect demo - - -Retry the same request: -$ curl -s https://api.github.com/zen - - -Anything added dilutes everything else. - - -It works. The read-only preset allows GET requests through. - - -Try a Write# -The read-only preset allows GET but blocks mutating methods like POST, PUT, and DELETE. Test this by sending a POST request to the GitHub API while still inside the sandbox: -$ curl -s -X POST https://api.github.com/repos/octocat/hello-world/issues \ - -H "Content-Type: application/json" \ - -d '{"title":"oops"}' - - -{"error":"policy_denied","policy":"github-api-readonly","detail":"POST /repos/octocat/hello-world/issues not permitted by policy"} - - -The CONNECT request succeeded because api.github.com is allowed, but the L7 proxy inspected the HTTP method and returned 403. POST is not in the read-only preset. An agent with this policy can read code from GitHub but cannot create issues, push commits, or modify anything. -Exit the sandbox: -$ exit - - - - -Check the L7 Deny Log# -L7 denials are logged separately from connection-level denials. The log entry includes the exact HTTP method and path that the proxy rejected. -$ openshell logs demo --level warn --since 5m - - -l7_decision=deny dst_host=api.github.com l7_action=POST l7_target=/repos/octocat/hello-world/issues l7_deny_reason="POST /repos/octocat/hello-world/issues not permitted by policy" - - -The log captures the exact HTTP method, path, and deny reason. In production, pipe these logs to your SIEM for a complete audit trail of every request your agent makes. - -Tip -To log violations without blocking requests, set enforcement: audit instead of enforcement: enforce in the policy. This is useful for building a policy iteratively: deploy in audit mode, review the logs, and switch to enforce when the rules are correct. - - - -Clean Up# -Delete the sandbox to free resources. This stops all processes and purges any injected credentials. -$ openshell sandbox delete demo - - - -Tip -To run this entire walkthrough non-interactively, use the automated demo script: -$ bash examples/sandbox-policy-quickstart/demo.sh - - - - - -Next Steps# - -To walk through a full policy iteration with Claude Code, including diagnosing denials and applying fixes from outside the sandbox, refer to Grant GitHub Push Access to a Sandboxed Agent. - - - - - -
- - - -Grant GitHub Push Access to a Sandboxed Agent# -This tutorial walks through an iterative sandbox policy workflow. You launch a sandbox, ask Claude Code to push code to GitHub, and observe the default network policy denying the request. -You then diagnose the denial from your machine and from inside the sandbox, apply a policy update, and verify that the policy update to the sandbox takes effect. -After completing this tutorial, you will have: - -A running sandbox with Claude Code that can push to a GitHub repository. -A custom network policy that grants GitHub access for a specific repository. -Experience with the policy iteration workflow: fail, diagnose, update, verify. - - -Note -This tutorial shows example prompts and responses from Claude Code. The exact wording you see might vary between sessions. Use the examples as a guide for the type of interaction, not as expected output. - - -Prerequisites# -This tutorial requires the following: - -A working OpenShell installation. Complete the Quickstart before proceeding. -A GitHub personal access token (PAT) with repo scope. Generate one from the GitHub personal access token settings page by selecting Generate new token (classic) and enabling the repo scope. -An Anthropic account with access to Claude Code. OpenShell provides the sandbox runtime, not the agent. You must authenticate with your own account. -A GitHub repository you own to use as the push target. A scratch repository is sufficient. You can create one with a README if needed. - -This tutorial uses two terminals to demonstrate the iterative policy workflow: - -Terminal 1: The sandbox terminal. You create the sandbox in this terminal by running openshell sandbox create and interact with Claude Code inside it. -Terminal 2: A terminal outside the sandbox on your machine. You use this terminal for viewing the sandbox logs with openshell term and applying an updated policy with openshell policy set. - -Each section below indicates which terminal to use. - - -Set Up a Sandbox with Your GitHub Token# -Depending on whether you start a new sandbox or use an existing sandbox, choose the appropriate tab and follow the instructions. - - - -Starting a new sandbox -In terminal 2, create a new sandbox with Claude Code. The default policy is applied automatically, which allows read-only access to GitHub. -Create a credential provider that injects your GitHub token into the sandbox automatically. The provider reads GITHUB_TOKEN from your host environment and sets it as an environment variable inside the sandbox: -$ GITHUB_TOKEN=<your-token> -$ openshell provider create --name my-github --type github --from-existing -$ openshell sandbox create --provider my-github -- claude - - -openshell sandbox create keeps the sandbox running after Claude Code exits, so you can apply policy updates later without recreating the environment. Add --no-keep if you want the sandbox deleted automatically instead. -Claude Code starts inside the sandbox. It prints an authentication link. Open it in your browser, sign in to your Anthropic account, and return to the terminal. When prompted, trust the /sandbox workspace to allow Claude Code to read and write files. - - - -Using an existing sandbox -In terminal 1, connect to a sandbox that is already running and set your GitHub token as an environment variable: -$ openshell sandbox connect <sandbox-name> -$ export GITHUB_TOKEN=<your-token> - - -To find the name of running sandboxes, run openshell sandbox list in terminal 2. - - - - -Push Code to GitHub# -In terminal 1, ask Claude Code to write a simple script and push it to your repository. Replace <org> with your GitHub organization or username and <repo> with your repository name. - - -Prompt -Write a hello_world.py script and push it to https://github.com/<org>/<repo>. - -Claude recognizes that it needs GitHub credentials. It asks how you want to authenticate. Provide your GitHub personal access token by pasting it into the conversation. Claude configures authentication and attempts the push. -The push fails. Claude reports an error, but the failure is not an authentication problem. The default sandbox policy permits read-only access to GitHub and blocks write operations, so the proxy denies the push before the request reaches the GitHub server. - - -Diagnose the Denial# -In this section, you diagnose the denial from your machine and from inside the sandbox. - -View the Logs from Your Machine# -In terminal 2, launch the OpenShell terminal: -$ openshell term - - -The dashboard shows sandbox status and a live stream of policy decisions. Look for entries with l7_decision=deny. Select a deny entry to see the full detail: -l7_action: PUT -l7_target: /repos/<org>/<repo>/contents/hello_world.py -l7_decision: deny -dst_host: api.github.com -dst_port: 443 -l7_protocol: rest -policy: github_rest_api -l7_deny_reason: PUT /repos/<org>/<repo>/contents/hello_world.py not permitted by policy - - -The log shows that the sandbox proxy intercepted an outbound PUT request to api.github.com and denied it. The github_rest_api policy allows read operations (GET) but blocks write operations (PUT, POST, DELETE) to the GitHub API. A similar denial appears for github.com if Claude attempted a git push over HTTPS. - - -Ask Claude Code to Check the Sandbox Logs# -In terminal 1, ask Claude Code to check the sandbox logs for denied requests: - - -Prompt -Check the sandbox logs for any denied network requests. What is blocking the push? - -Claude reads the deny entries and identifies the root cause. It explains that the failure is a sandbox network policy restriction, not a token permissions issue. For example, the following is a possible response: - - -Response -The sandbox runs a proxy that enforces policies on outbound traffic. -The github_rest_api policy allows GET requests (used to read the file) -but blocks PUT/write requests to GitHub. This is a sandbox-level restriction, -not a token issue. No matter what token you provide, pushes through the API -will be blocked until the policy is updated. - -Both perspectives confirm the same thing: the proxy is doing its job. The default policy is designed to be restrictive. To allow GitHub pushes, you need to update the network policy. -Copy the deny reason from Claude’s response. You paste it into an agent running on your machine in the next step. - - - -Update the Policy from Your Machine# -In terminal 2, paste the deny reason from the previous step into your coding agent on your machine, such as Claude Code or Cursor, and ask it to recommend a policy update. The deny reason gives the agent the context it needs to generate the correct policy rules. After pasting the following prompt sample, properly provide the GitHub organization and repository names of the repository you are pushing to. - - -Prompt -Based on the following deny reasons, recommend a sandbox policy update that allows GitHub pushes to https://github.com/<org>/<repo>, and save to /tmp/sandbox-policy-update.yaml: -The filesystem_policy, landlock, and process sections are static. They are read once at sandbox creation and cannot be changed by a hot-reload. They are included here for completeness so the file is self-contained, but only the network_policies section takes effect when you apply this to a running sandbox. - -The following steps outline the expected process done by the agent: - -Inspects the deny reasons. -Writes an updated policy that adds github_git and github_api blocks that grant write access to your repository. -Saves the policy to /tmp/sandbox-policy-update.yaml. - - - -Review the Generated Policy# -Refer to the following policy example to compare with the generated policy before applying it. Confirm that the policy grants only the access you expect. In this case, git push operations and GitHub REST API access scoped to a single repository. - - -Full reference policy -The following YAML shows a complete policy that extends the default policy with GitHub access for a single repository. Replace <org> with your GitHub organization or username and <repo> with your repository name. -The filesystem_policy, landlock, and process sections are static. They are read once at sandbox creation and cannot be changed by a hot-reload. They are included here for completeness so the file is self-contained, but only the network_policies section takes effect when you apply this to a running sandbox. -version: 1 - -# ── Static (locked at sandbox creation) ────────────────────────── - -filesystem_policy: - include_workdir: true - read_only: - - /usr - - /lib - - /proc - - /dev/urandom - - /app - - /etc - - /var/log - read_write: - - /sandbox - - /tmp - - /dev/null - -landlock: - compatibility: best_effort - -process: - run_as_user: sandbox - run_as_group: sandbox - -# ── Dynamic (hot-reloadable) ───────────────────────────────────── - -network_policies: - - # Claude Code ↔ Anthropic API - claude_code: - name: claude-code - endpoints: - - { host: api.anthropic.com, port: 443, protocol: rest, enforcement: enforce, access: full, tls: terminate } - - { host: statsig.anthropic.com, port: 443 } - - { host: sentry.io, port: 443 } - - { host: raw.githubusercontent.com, port: 443 } - - { host: platform.claude.com, port: 443 } - binaries: - - { path: /usr/local/bin/claude } - - { path: /usr/bin/node } - - # NVIDIA inference endpoint - nvidia_inference: - name: nvidia-inference - endpoints: - - { host: integrate.api.nvidia.com, port: 443 } - binaries: - - { path: /usr/bin/curl } - - { path: /bin/bash } - - { path: /usr/local/bin/opencode } - - # ── GitHub: git operations (clone, fetch, push) ────────────── - - github_git: - name: github-git - endpoints: - - host: github.com - port: 443 - protocol: rest - tls: terminate - enforcement: enforce - rules: - - allow: - method: GET - path: "/<org>/<repo>.git/info/refs*" - - allow: - method: POST - path: "/<org>/<repo>.git/git-upload-pack" - - allow: - method: POST - path: "/<org>/<repo>.git/git-receive-pack" - binaries: - - { path: /usr/bin/git } - - # ── GitHub: REST API ───────────────────────────────────────── - - github_api: - name: github-api - endpoints: - - host: api.github.com - port: 443 - protocol: rest - tls: terminate - enforcement: enforce - rules: - # GraphQL API (used by gh CLI) - - allow: - method: POST - path: "/graphql" - # Full read-write access to the repository - - allow: - method: "*" - path: "/repos/<org>/<repo>/**" - binaries: - - { path: /usr/local/bin/claude } - - { path: /usr/local/bin/opencode } - - { path: /usr/bin/gh } - - { path: /usr/bin/curl } - - # ── Package managers ───────────────────────────────────────── - - pypi: - name: pypi - endpoints: - - { host: pypi.org, port: 443 } - - { host: files.pythonhosted.org, port: 443 } - - { host: github.com, port: 443 } - - { host: objects.githubusercontent.com, port: 443 } - - { host: api.github.com, port: 443 } - - { host: downloads.python.org, port: 443 } - binaries: - - { path: /sandbox/.venv/bin/python } - - { path: /sandbox/.venv/bin/python3 } - - { path: /sandbox/.venv/bin/pip } - - { path: "/sandbox/.uv/python/**/python*" } - - { path: /usr/local/bin/uv } - - { path: "/sandbox/.uv/python/**" } - - # ── VS Code Remote ────────────────────────────────────────── - - vscode: - name: vscode - endpoints: - - { host: update.code.visualstudio.com, port: 443 } - - { host: "*.vo.msecnd.net", port: 443 } - - { host: vscode.download.prss.microsoft.com, port: 443 } - - { host: marketplace.visualstudio.com, port: 443 } - - { host: "*.gallerycdn.vsassets.io", port: 443 } - binaries: - - { path: /usr/bin/curl } - - { path: /usr/bin/wget } - - { path: "/sandbox/.vscode-server/**" } - - { path: "/sandbox/.vscode-remote-containers/**" } - - -The following table summarizes the two GitHub-specific blocks: - - -Block -Endpoint -Behavior - - - -github_git -github.com:443 -Git Smart HTTP protocol with TLS termination. Permits info/refs (clone/fetch), git-upload-pack (fetch data), and git-receive-pack (push) for the specified repository. Denies all operations on unlisted repositories. - -github_api -api.github.com:443 -REST API with TLS termination. Permits all HTTP methods for the specified repository and GraphQL queries. Denies API access to unlisted repositories. - - - - -The remaining blocks (claude_code, nvidia_inference, pypi, vscode) are identical to the default policy. The default policy’s github_ssh_over_https and github_rest_api blocks are replaced by the github_git and github_api blocks above, which grant write access to the specified repository. Sandbox behavior outside of GitHub operations is unchanged. -For details on policy block structure, refer to Policies. - - - -Apply the Policy# -After you have reviewed the generated policy, apply it to the running sandbox: -$ openshell policy set <sandbox-name> --policy /tmp/sandbox-policy-update.yaml --wait - - -Network policies are hot-reloadable. The --wait flag blocks until the policy engine confirms the new revision loaded, and the update takes effect immediately without restarting the sandbox or reconnecting Claude Code. - - -Retry the Push# -In terminal 1, ask Claude Code to retry the push: -The sandbox policy has been updated. Try pushing to the repository again. - - -The push completes successfully. The openshell term dashboard now shows l7_decision=allow entries for api.github.com and github.com where it previously showed denials. - - -Clean Up# -When you are finished, delete the sandbox to free cluster resources: -$ openshell sandbox delete <sandbox-name> - - - - -Next Steps# -The following resources cover related topics in greater depth: - -To add per-repository access levels (read-write vs read-only) or restrict to specific API methods, refer to the Policy Schema Reference. -To learn the full policy iteration workflow (pull, edit, push, verify), refer to Customize Sandbox Policies. -To inject credentials automatically instead of pasting tokens, refer to Manage Providers and Credentials. - - - - - -
- - - -Tutorials# -Hands-on walkthroughs that teach OpenShell concepts by building real configurations. Each tutorial builds on the previous one, starting with core sandbox mechanics and progressing to production workflows. - - - - - - -First Network Policy -Create a sandbox, observe default-deny networking, apply a read-only L7 policy, and inspect audit logs. No AI agent required. - - -Write Your First Sandbox Network Policy - - - - - -GitHub Push Access -Launch Claude Code in a sandbox, diagnose a policy denial, and iterate on a custom GitHub policy from outside the sandbox. - - -Grant GitHub Push Access to a Sandboxed Agent - - - - - -Local Inference with Ollama -Route inference to a local Ollama server, verify it from a sandbox, and reuse the same pattern for other OpenAI-compatible engines. - - -Run Local Inference with Ollama - - - - - -Local Inference with LM Studio -Route inference to a local LM Studio server via the OpenAI or Anthropic compatible APIs. - - -Route Local Inference Requests to LM Studio - - - - - - - - -
- - - -Route Local Inference Requests to LM Studio# -This tutorial describes how to configure OpenShell to route inference requests to a local LM Studio server. - -Note -The LM Studio server provides easy setup with both OpenAI and Anthropic compatible endpoints. - -This tutorial will cover: - -Expose a local inference server to OpenShell sandboxes. -Verify end-to-end inference from inside a sandbox. - - -Prerequisites# -First, complete OpenShell installation and follow the Quickstart. -Install the LM Studio app. Make sure that your LM Studio is running in the same environment as your gateway. -If you prefer to work without having to keep the LM Studio app open, download llmster (headless LM Studio) with the following command: - -Linux/Mac# -$ curl -fsSL https://lmstudio.ai/install.sh | bash - - - - -Windows# -$ irm https://lmstudio.ai/install.ps1 | iex - - -And start llmster: -$ lms daemon up - - - - - -Step 1: Start LM Studio Local Server# -Start the LM Studio local server from the Developer tab, and verify the OpenAI-compatible endpoint is enabled. -LM Studio will listen to 127.0.0.1:1234 by default. For use with OpenShell, you’ll need to configure LM Studio to listen on all interfaces (0.0.0.0). -If you’re using the GUI, go to the Developer Tab, select Server Settings, then enable Serve on Local Network. -If you’re using llmster in headless mode, run lms server start --bind 0.0.0.0. - - -Step 2: Test with a small model# -In the LM Studio app, head to the Model Search tab to download a small model like Qwen3.5 2B. -In the terminal, use the following command to download and load the model: -$ lms get qwen/qwen3.5-2b -$ lms load qwen/qwen3.5-2b - - - - -Step 3: Add LM Studio as a provider# -Choose the provider type that matches the client protocol you want to route through inference.local. - - - -OpenAI-compatible -Add LM Studio as an OpenAI-compatible provider through host.openshell.internal: -$ openshell provider create \ - --name lmstudio \ - --type openai \ - --credential OPENAI_API_KEY=lmstudio \ - --config OPENAI_BASE_URL=http://host.openshell.internal:1234/v1 - - -Use this provider for clients that send OpenAI-compatible requests such as POST /v1/chat/completions or POST /v1/responses. - - - -Anthropic-compatible -Add a provider that points to LM Studio’s Anthropic-compatible POST /v1/messages endpoint: -$ openshell provider create \ - --name lmstudio-anthropic \ - --type anthropic \ - --credential ANTHROPIC_API_KEY=lmstudio \ - --config ANTHROPIC_BASE_URL=http://host.openshell.internal:1234 - - -Use this provider for Anthropic-compatible POST /v1/messages requests. - - - - -Step 4: Configure LM Studio as the local inference provider# -Set the managed inference route for the active gateway: - - - -OpenAI-compatible -$ openshell inference set --provider lmstudio --model qwen/qwen3.5-2b - - -If the command succeeds, OpenShell has verified that the upstream is reachable and accepts the expected OpenAI-compatible request shape. - - - -Anthropic-compatible -$ openshell inference set --provider lmstudio-anthropic --model qwen/qwen3.5-2b - - -If the command succeeds, OpenShell has verified that the upstream is reachable and accepts the expected Anthropic-compatible request shape. - - -The active inference.local route is gateway-scoped, so only one provider and model pair is active at a time. Re-run openshell inference set whenever you want to switch between OpenAI-compatible and Anthropic-compatible clients. -Confirm the saved config: -$ openshell inference get - - -You should see either Provider: lmstudio or Provider: lmstudio-anthropic, along with Model: qwen/qwen3.5-2b. - - -Step 5: Verify from Inside a Sandbox# -Run a simple request through https://inference.local: - - - -OpenAI-compatible -openshell sandbox create -- \ - curl https://inference.local/v1/chat/completions \ - --json '{"messages":[{"role":"user","content":"hello"}],"max_tokens":10}' - -openshell sandbox create -- \ - curl https://inference.local/v1/responses \ - --json '{ - "instructions": "You are a helpful assistant.", - "input": "hello", - "max_output_tokens": 10 - }' - - - - - -Anthropic-compatible -openshell sandbox create -- \ - curl https://inference.local/v1/messages \ - --json '{"messages":[{"role":"user","content":"hello"}],"max_tokens":10}' - - - - - - -Troubleshooting# -If setup fails, check these first: - -LM Studio local server is running and reachable from the gateway host -OPENAI_BASE_URL uses http://host.openshell.internal:1234/v1 when you use an openai provider -ANTHROPIC_BASE_URL uses http://host.openshell.internal:1234 when you use an anthropic provider -The gateway and LM Studio run on the same machine or a reachable network path -The configured model name matches the model exposed by LM Studio - -Useful commands: -$ openshell status -$ openshell inference get -$ openshell provider get lmstudio -$ openshell provider get lmstudio-anthropic - - - - -Next Steps# - -To learn more about using the LM Studio CLI, refer to LM Studio docs -To learn more about managed inference, refer to About Inference Routing. -To configure a different self-hosted backend, refer to Configure Inference Routing. - - - - - -
- - - -Run Local Inference with Ollama# -This tutorial shows how to route sandbox inference to a model running locally. - -Note -This tutorial uses Ollama because it is easy to install and run locally, but you can substitute other inference engines such as vLLM, SGLang, TRT-LLM, and NVIDIA NIM by changing the startup command, base URL, and model name. - -After completing this tutorial, you will know how to: - -Expose a local inference server to OpenShell sandboxes. -Verify end-to-end inference from inside a sandbox. - - -Prerequisites# - -A working OpenShell installation. Complete the Quickstart before proceeding. - -If your gateway runs on a remote host or in a cloud deployment, Ollama must also run there. Another common scenario is running a model and the gateway on different nodes in the same local network. -Install Ollama with: -$ curl -fsSL https://ollama.com/install.sh | sh - - - - -Step 1: Start Ollama on All Interfaces# -By default, Ollama listens only on the loopback address (127.0.0.1), which is not reachable from the OpenShell gateway or sandboxes. Start Ollama so it listens on all interfaces: -$ OLLAMA_HOST=0.0.0.0:11434 ollama serve - - - -Tip -If you see Error: listen tcp 0.0.0.0:11434: bind: address already in use, Ollama is already running as a system service. Stop it first, then start it manually with the correct bind address: -$ systemctl stop ollama -$ OLLAMA_HOST=0.0.0.0:11434 ollama serve - - - - - -Step 2: Pull a Model# -In a second terminal, pull a lightweight model: -$ ollama run qwen3.5:0.8b - - -This downloads the model and starts an interactive session. Type /bye to exit the session. The model stays available for inference after you exit. - -Note -qwen3.5:0.8b is a good smoke-test target for verifying your local inference setup, but it is best suited for simple tasks. For more complex coding, reasoning, or agent workflows, use a stronger open model such as Nemotron or another larger open-source model that fits your hardware. - -Confirm the model is available: -$ ollama ps - - -You should see qwen3.5:0.8b in the output. - - -Step 3: Create a Provider for Ollama# -Create an OpenAI-compatible provider that points at Ollama through host.openshell.internal: -$ openshell provider create \ - --name ollama \ - --type openai \ - --credential OPENAI_API_KEY=empty \ - --config OPENAI_BASE_URL=http://host.openshell.internal:11434/v1 - - -This works because OpenShell injects host.openshell.internal so sandboxes and the gateway can refer back to the gateway host machine. If that hostname is not the best fit for your environment, you can also use the host’s LAN IP. - - -Step 4: Configure Local Inference with Ollama# -Set the managed inference route for the active gateway: -$ openshell inference set --provider ollama --model qwen3.5:0.8b - - -If the command succeeds, OpenShell has verified that the upstream is reachable and accepts the expected OpenAI-compatible request shape. -Confirm the saved config: -$ openshell inference get - - -You should see Provider: ollama and Model: qwen3.5:0.8b. - - -Step 5: Verify from Inside a Sandbox# -Run a simple request through https://inference.local: -$ openshell sandbox create -- \ - curl https://inference.local/v1/chat/completions \ - --json '{"messages":[{"role":"user","content":"hello"}],"max_tokens":10}' - - -The response should be JSON from the upstream model. The model reported in the response may show the real model resolved by OpenShell. - - -Troubleshooting# -If setup fails, check these first: - -Ollama is bound to 0.0.0.0, not only 127.0.0.1 -OPENAI_BASE_URL uses http://host.openshell.internal:11434/v1 -The gateway and Ollama run on the same machine -The configured model exists in Ollama -The app calls https://inference.local, not http://inference.local - -Useful commands: -$ openshell status -$ openshell inference get -$ openshell provider get ollama - - - - -Next Steps# - -To learn more about managed inference, refer to About Inference Routing. -To configure a different self-hosted backend, refer to Configure Inference Routing. - - - - - -