OpsCanary
kubernetessecurityPractitioner

Harnessing OpenShell on Kubernetes: A Platform Engineer's Guide

5 min read CNCF BlogNov 11, 2026Reviewed for accuracy
Share
Practitioner — Hands-on experience recommended

OpenShell exists to address the growing need for secure and isolated environments for running agents on Kubernetes. As a CNCF Sandbox project initiated by NVIDIA, it allows platform engineers to deploy agents safely, ensuring that workloads do not compromise cluster security. By leveraging the Agent Sandbox resource, OpenShell transforms each sandbox into a Pod, which is crucial for maintaining a controlled execution environment.

The mechanism behind OpenShell involves a gateway that manages every sandbox. When a request is made, the gateway authenticates the caller, resolves necessary parameters like image and policy, and rejects any unsafe configurations. It creates two NetworkPolicies: one for workload Pods, restricting all outbound traffic and allowing inbound traffic only from supervisors on TCP 5500, and another for supervisor Pods. The Sandbox resource is created in a suspended state, and a PVC for /sandbox is established. The supervisor Pod connects to the gateway with a unique identity, ensuring that all outbound requests from the agent are validated before establishing upstream connections.

In production, you need to prepare your cluster by installing a CNI that enforces ingress and egress NetworkPolicies, such as Cilium. Note that currently, OpenShell sandboxes can only be created through the Gateway API, not the Kubernetes API. This could limit flexibility in larger environments, especially since each agent requires a dedicated Supervisor Pod for isolation, which may not scale well. Keep an eye on the roadmap for more flexible deployment options as they develop.

Key takeaways

  • →Understand that OpenShell is a runtime for safely running agents on Kubernetes.
  • →Utilize the Agent Sandbox resource to manage workloads securely.
  • →Implement strict NetworkPolicies to control traffic between Pods.
  • →Prepare your cluster with a suitable CNI like Cilium for effective policy enforcement.
  • →Be aware that sandboxes can only be created via the Gateway API, limiting integration options.

Why it matters

In production, the ability to run agents securely is paramount. OpenShell's strict isolation and network policies help prevent potential vulnerabilities that can arise from untrusted workloads.

Code examples

Bash
openshell sandbox create –workspace demo –name policy-demo –from nicolaka/netshoot@sha256:… –no-auto-providers

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
Linux FoundationSponsor

Industry-standard certifications built by the people behind Linux and Kubernetes. Earn the CKA — the gold standard Kubernetes administrator cert. OpsCanary readers get 30% off year-round with code OPSCANARY3.

Get CKA certified →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.