Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Resources to explore

Check out popular resources, tools, and information from Red Hat. We'll recommend more as you browse.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

OpenShell: Enforceable boundaries for AI agents

December 1, 2026
Cedric Clyburn
Related topics:
Artificial intelligenceSecurityContainers
Related products:
Red Hat AIRHEL UBI

    What happens when an AI agent has permission to read a GitHub repository, but the instructions it finds there tell it to do something else? It might try to use an API, write a file it shouldn't, or get distracted and take a longer route to complete the task (which, in today's tokenomics economy, isn't cheap). The tricky part is that, from the outside, an agent following a malicious instruction versus an agent making an ordinary mistake can look remarkably similar.

    We can tell an agent not to do these things in its system prompt. But with non-deterministic systems like language models, a prompt is more of a suggestion. That's where OpenShell comes in, an open source runtime that gives AI agents clear, enforceable boundaries. It traces their actions and enforces policy as they work, and in this article, we'll see it in action.

    Why does OpenShell exist?

    For decades, we've built software that does what we programmed it to do. Agents are different because, after you give an agent a goal, the path of tools and commands it uses to get there can be unpredictable. But rather than hoping an agent follows rules written in natural language, OpenShell enforces boundaries outside the model. Whereas your prompt might say "Only read from GitHub," OpenShell gives you a way to enforce that restriction at the network layer. It does this by combining several controls:

    • Network access: Connections are denied by default unless a policy grants them. Rules can be scoped to a particular executable, destination, and HTTP method.
    • File system and process restrictions: Sandboxes use operating system controls to limit what code can access or execute (which matters when an agent chooses a tool you didn't expect).
    • Provider credentials: Where an agent needs credentials or a secret, OpenShell can give the workload an opaque placeholder and substitute the real credentials only when the request reaches an authorized endpoint.
    • Visibility: Denied requests are logged, so you can inspect what the agent attempted rather than relying on its own account of what happened.

    We already have tools for isolating workloads, but they were built for code that does the same thing every run, so they draw their boundaries around the whole workload. A container isolates the application, but not what the agent decides to run inside it. A Kubernetes NetworkPolicy works per pod, not per program inside it. And a secret mounted into a container can be read by whatever runs there, including a compromised agent. OpenShell brings the protections agents need into one runtime. The goal isn't to make agents infallible, but to limit the damage when one makes a bad decision.

    NVIDIA launched OpenShell at GTC in March 2026, with Red Hat as a founding contributor. It then became a CNCF Sandbox project, also backed by Docker, GitHub, SAP, Google, and Dell. No matter the agent you use (Claude Code, Codex, OpenCode, or OpenClaw), you can run it inside sandboxes that let you decide what each agent can read, run, and reach on the network.

    Getting started with OpenShell

    At a high level, OpenShell has 3 main pieces: a gateway, an agent sandbox, and a supervisor.

    The gateway manages sandboxes and distributes their configuration. The agent runs in an isolated workload, with file system and process controls applied at the boundary. A separate supervisor, on the trusted side of that boundary, evaluates outbound requests against the sandbox's policies. Approved connections can proceed, but requests that violate policy are denied and can be logged for review (Figure 1). So for a coding agent, while the model can still ask to visit a site, the network request won't succeed.

    OpenShell gateway pushes policy to a supervisor inside a sandbox, which allows or denies and logs all traffic from an isolated AI agent.
    Figure 1: The AI agent runs inside an isolation boundary, while the supervisor checks every outbound request against policy before allowing or denying it.

    Installing OpenShell

    Before you get started, you'll need to install OpenShell. On Linux or macOS, NVIDIA provides an installation script that installs the CLI and starts a local gateway:

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

    You'll also need a supported container runtime, such as Docker or Podman, to run your sandboxes. Once installed, verify that OpenShell is up and running:

    $ openshell status
    Server Status
    Gateway: openshell
    Server: https://localhost:17670
    Status: Connected
    Authentication: Authenticated (mTLS transport)
    Version: 0.1.10

    And that's it! For other platforms or more advanced deployments, check out the OpenShell installation guide.

    Writing your first network policy

    Let's try the network policy tutorial, which doesn't require an agent setup—only the curl tool—so you can see OpenShell's default-deny behavior before selectively allowing a single destination. After following the installation instructions for your machine, let's create a sandbox using Red Hat Universal Base Image:

    $ openshell sandbox create \
      --name demo \
      --from registry.access.redhat.com/ubi10/ubi-minimal \
      --no-auto-providers

    You'll land in an interactive shell inside the sandbox, where you can try:

    $ curl -s https://api.github.com/zen

    The connection is denied. From a 2nd terminal on your host, let's inspect the log and add a read-only policy, as shown in Figure 2:

    $ openshell logs demo --since 5m --source sandbox
    [sandbox] [OCSF ] [ocsf] NET:OPEN [MED] DENIED /usr/bin/curl(58) -> api.github.com:443 [reason:transparent_tcp_policy_denied]
    $ openshell policy update demo \
      --rule-name github_api \
      --binary /usr/bin/curl \
      --add-endpoint api.github.com:443:read-only:rest:enforce \
      --wait
    Terminal window showing an OpenShell network policy denial log entry highlighted in red, followed by a terminal command that updates and loads policy version 2.
    Figure 2: OpenShell logs the blocked connection attempt in real time and immediately activates the updated read-only GitHub API policy without restarting the sandbox.

    See how OpenShell denies our container's request, logs it, and lets us apply a new policy that's updated in real time.

    Back inside the same sandbox, try a read (which will work) and a write (which we haven't given permission for):

    $ curl -s https://api.github.com/zen
    $ curl -s -X POST https://api.github.com/repos/octocat/hello-world/issues \
      -H "Content-Type: application/json" \
      -d '{"title":"oops"}'

    The GET succeeds, but the POST gets a policy denial. OpenShell isn't simply allowing or blocking GitHub; it can enforce which HTTP operations a process may perform there. The policy takes effect without a restart, and the denial appears in the sandbox logs. Run exit to leave the shell, and run openshell sandbox delete demo to delete this sandbox.

    Running a coding agent with OpenShell

    Now, let's put an actual AI agent inside our sandbox. For this example, we'll use Claude Code, a coding agent that can read files, execute commands, and write code on our behalf.

    First, we're going to need a container image with Claude Code installed. OpenShell's default image doesn't include any agents, so I've already built one locally that includes Claude Code using the following Red Hat Universal Base Image:

    # Claude Code on Red Hat Universal Base Image, for use as an OpenShell sandbox image.
    FROM registry.access.redhat.com/ubi10/ubi-minimal
    RUN microdnf install -y git tar gzip shadow-utils \
        && microdnf clean all
    # Install Claude Code, then copy the real binary to a path the
    # claude-code provider profile allows (/usr/local/bin/claude).
    RUN curl -fsSL https://claude.ai/install.sh | bash \
        && cp -L /root/.local/bin/claude /usr/local/bin/claude \
        && chmod 755 /usr/local/bin/claude \
        && rm -rf /root/.local /root/.claude*
    # Regular user with a writable home and workspace (UID 1000 is OpenShell's default).
    RUN useradd -m -u 1000 sandbox \
        && mkdir -p /sandbox && chown sandbox:sandbox /sandbox
    USER sandbox
    WORKDIR /sandbox
    ENV DISABLE_AUTOUPDATER=1

    With this Containerfile, we can run podman build -t localhost/claude-agent:local -f Containerfile . in the local directory to build that custom image.

    Next, we'll import a provider profile. A profile is a YAML file that tells OpenShell what a service needs: which credentials it uses, which endpoints those credentials can go to, and which programs can use them. The Claude Code profile only allows ANTHROPIC_API_KEY to be sent to api.anthropic.com, and only from the claude binary.

    $ openshell profile import \
      --url https://raw.githubusercontent.com/NVIDIA/OpenShell/main/providers/claude-code.yaml \
      --global

    Then, we'll create a provider (an instance of that profile) using our Anthropic API key:

    $ export ANTHROPIC_API_KEY=<your-anthropic-api-key>
    $ openshell provider create --name my-claude --type claude-code --from-existing

    Now let's start Claude Code in a sandbox with the provider attached:

    $ openshell sandbox create \
      --name claude-demo \
      --from localhost/claude-agent:local \
      --provider my-claude \
      -- claude

    That's it. Claude Code launches inside the sandbox. But what key does it actually have? From a 2nd terminal, let's check:

    $ openshell sandbox exec --name claude-demo -- printenv ANTHROPIC_API_KEY
    openshell:resolve:env:v1758916102505108697_ANTHROPIC_API_KEY

    It's an opaque placeholder, not our key. The supervisor only swaps in the real one for requests to Anthropic's API, so even if the agent were tricked into sending its key somewhere else, it would have nothing useful to give away (Figure 3).

    OpenShell gateway sends policy and a real API key to the supervisor container, which substitutes the agent container's placeholder key for requests to api.anthropic.com.
    Figure 3: The agent only ever sees a placeholder token, while the supervisor swaps in the real credential for approved GitHub requests.

    Wrapping up

    A sandbox adds a valuable layer of security, but it doesn't eliminate every risk. Depending on the runtime, ordinary containers can still share a host kernel. Added isolation, including virtual machine-backed Kata Containers, can add another boundary around untrusted workloads, especially as agents move from developers' laptops to shared infrastructure.

    So, you've learned how to set boundaries for AI agents, and more importantly, stop them when they step outside of those boundaries. Bringing agents to the enterprise requires these boundaries, along with capabilities for governance and observability that Red Hat is developing upstream with projects like NeMo Guardrails and MLflow as part of Red Hat AI.

    Related Posts

    • Securing third-party AI agents on Red Hat AI with OpenShell

    • How AI observability works with MLflow

    • Add NeMo Guardrails to a LangGraph agent on OpenShift AI

    • Securing multimodal AI with NeMo Guardrails and vision models

    • Developing LLM guardrail configs locally with NeMo Guardrails

    • Layered sandboxing for AI agents: OpenShift and OpenShell

    Recent Posts

    • OpenShell: Enforceable boundaries for AI agents

    • High Scale OpenShift Cluster Upgrades with Active VM Workloads

    • OpenShift Virtualization Live Migration Performance at High Scale (10K VMs)

    • tongs: Unified code review for GitHub & GitLab in your terminal

    • Red Hat OpenShift AI and OpenShift on AWS for sovereign AI agents

    What’s up next?

    Learning Path Red Hat AI

    How to run AI models in cloud development environments

    This learning path explores running AI models, specifically large language...
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI