How to Set Up Nvidia OpenShell to Sandbox AI Agents
Install Nvidia OpenShell on Ubuntu with Docker 28+, add a provider profile, launch an OpenCode sandbox and approve network rules without exposing API keys.
For Security, IT and Engineering

How do I run an AI agent in Nvidia OpenShell and approve only the network access it needs?
You install OpenShell on a machine with Docker Engine 28 or newer, confirm it is connected and authenticated, store your model provider's API key, import a provider profile, and create a sandbox from an agent image such as OpenCode. The sandbox blocks all network access by default. When the agent tries to reach something, such as GitHub, the call is denied and logged. You turn that denial into a proposed rule, approve it, and the agent can retry immediately without a restart.
TL;DR
- OpenShell is Nvidia's runtime for running AI agents in an isolated sandbox where network access is blocked until you allow it.
- You need Docker Engine 28 or newer. The demo used Ubuntu and a one-line install.
- Your real API key stays outside the sandbox. The agent only sees a placeholder string, and OpenShell swaps in the real key for approved requests.
- A provider profile defines which service the agent can reach and which program may use it.
- Denied requests show up in the logs and can be converted into proposed rules. You approve the ones you want and the rest stay blocked.
- Approved rules load into the running sandbox, so you do not restart anything.
What is Nvidia OpenShell and why use it?
AI agents are useful because they can read files, call APIs and use credentials. That is also the risk. An agent with your API key and open internet access can leak the key, be tricked by a malicious instruction hidden in a web page (called prompt injection), or send data somewhere you never intended.
OpenShell addresses this by running each agent in its own container or VM with almost no connectivity. The only channel out is to a supervisor process. When the agent wants to call an API or a model, it asks the supervisor. The supervisor checks the policy, adds real credentials only if the destination is approved, and passes the request along. The agent never touches your key.
For anyone who has to explain agent security to an IT or security team, this is the pitch: least privilege by default, with a visible record of what the agent tried to do.
What do I need before I start?
- A machine running Ubuntu (the setup shown here). OpenShell also runs in Kubernetes, but this guide covers the single-machine path.
- Docker Engine 28 or newer. Check your version first and upgrade if needed. This is the most common blocker.
- An API key from a model provider. Anthropic, OpenAI and others work. The demo used an OpenRouter key because it gives access to many models through one account.
- A terminal and permission to install software.
One note on commands: the source for this guide showed them on screen but they are best copied from the official OpenShell repository and documentation, since flags and names can change between releases. The steps below tell you what each command does and what a correct result looks like.
How do I install OpenShell and check it works?
Installation is a single one-line command from the OpenShell project. Run it, wait for it to finish, then check the status.
A healthy status shows two things:
- The CLI is connected to its gateway.
- It is authenticated.
If either is missing, stop and fix that before going further. Everything later depends on the gateway, which is where your policies, providers and sandboxes are stored.
How do I add an API key and provider profile without exposing the key?
This is the step that makes OpenShell different from putting a key in an environment variable and hoping for the best.
Step 1: Store your key. Add your API key (OpenRouter in the demo) through OpenShell. It is stored by OpenShell, outside any sandbox.
Step 2: Import a provider profile. A provider profile defines which service the agent can reach and which program may use it. The demo imported the OpenRouter profile from the OpenShell repo, so there was nothing to write by hand.
Step 3: Understand what the agent will see. Inside the sandbox, the agent only sees a placeholder in place of the key. OpenShell adds the real key only for requests going to OpenRouter (or whichever provider the profile covers).
You can verify this later. From inside the sandbox, ask the agent to print the environment variable that holds the key. What comes back is a random-looking reference string, not your key. If the agent leaks that string, gets prompt injected or prints its own environment, an attacker gets nothing usable.
How do I create the OpenCode sandbox?
Create a sandbox from an OpenCode image and attach the provider you just set up. Then run the command that connects you to a shell inside it. You are now in an isolated container.
From there, launch OpenCode and pick a model. The demo used Claude Haiku from Anthropic through the OpenRouter connection. OpenCode is one option. The demo also mentioned Pi as another agent, and the creator was unsure whether Hermes Agent would work, though he expected it should not be a big problem. Treat that as untested.
Two other behaviors are worth checking while you are inside:
| Test | Expected result |
|---|---|
| Write to a system folder | Fails. System folders are read only. |
| Write to the temp folder | Works. Temp is writable. |
| Make a plain network call with no AI involved | Blocked. Nothing is allowed by default. |
These quick checks confirm the sandbox is doing its job before you trust it with real work.
How do I watch a request get denied?
Give the agent a task that needs a destination nobody has allowed. The demo asked the agent to call GitHub. Here is an example prompt in the same spirit:
Use curl to fetch https://api.github.com and show me the response.
The agent tries curl, fails, and reports that the system appears to have no external network access. That is the expected behavior. It is the whole point of the tool.
Now check the logs. You will see entries showing which programs tried to connect and that most were denied, including TCP policy denials. Everything is denied unless a rule says otherwise. This log is your proof, and it is also useful as an audit trail.
How do I approve a network rule live?
This is the best part of the workflow, because you do not write policy from a blank page.
- Turn the denials into proposed rules. Run the command that converts logged denials into proposals. OpenShell generates the rules from what the agent actually tried to do.
- Review the list. In the demo there were three proposed rules, one of them for GitHub.
- Approve only what you want. The demo approved the GitHub rule only. The other two stayed blocked.
- Rerun the same prompt. Do not restart the sandbox or the agent. The GitHub call now returns a result.
- Check the logs again. The GitHub rule shows as allowed. Everything else is still denied.
Behind the scenes, this follows a simple loop. The agent hits the wall and proposes a rule. An approver checks every policy change for new risk and flags anything risky. By default you decide manually. Rules can also be approved automatically when no new risk is found. Once approved, the rule loads into the running sandbox, the supervisor retries, and the request goes through.
How does the architecture fit together?
Four pieces matter:
- The agent, running in a container or VM with no network access except one channel to the supervisor.
- The supervisor, which checks policy, injects real credentials for approved destinations and forwards requests.
- The gateway, which stores your policies, providers and sandboxes.
- The approver, which reviews each policy change for new risk.
If you understand those four, you can reason about any behavior you see. A blocked call means the supervisor found no matching rule. A leaked string is harmless because it is a placeholder. A new rule works immediately because the supervisor reloads policy in the running sandbox.
What does this mean for you?
If you are a developer or technical lead: you can try agents on real tasks without handing them your keys or an open internet connection. Start with the smallest approved list, run the agent, and let the denial logs tell you what it actually needs.
If you work in security, IT or compliance: the default-deny posture, the placeholder credentials and the log of denied attempts are the things to evaluate. Ask for the logs and the approved rules during a review. Keep the approval mode on manual until you trust the approver's risk checks.
If you are a manager or non-technical user: you probably will not run this yourself. But you can ask the right question when your team adopts agents: "What is this agent allowed to reach, and who approved it?" If nobody can answer, that is the gap OpenShell is designed to close.
A practical habit: approve rules one at a time, and read each destination before you say yes. A rule for a package registry is different from a rule for an unknown domain.
Can I build a tracker for agent access requests?
Once several people are running sandboxed agents, the approvals themselves need a home: who asked for access to what, who said yes, and when. A shared spreadsheet gets stale fast. With Remy, you can describe a small internal app in plain English, such as a request form for agent network access with an approval queue, a status field and a history of decisions, and Remy builds and deploys it with sign-in and a database included. It does not sandbox agents or replace OpenShell's own logs. It gives your team a simple place to record the decisions around them.
Frequently Asked Questions
Does OpenShell work with providers other than OpenRouter?
Yes. The demo used OpenRouter for convenience, but you can use a key from Anthropic, OpenAI or another provider. You import the matching provider profile so OpenShell knows which service the agent may reach.
Does the agent ever see my real API key?
No. Inside the sandbox the agent sees a placeholder string. OpenShell swaps in the real key at the last moment, only for requests to approved providers. The real key is stored outside the sandbox.
Do I have to restart the sandbox after approving a rule?
No. Approved rules load into the running sandbox. In the demo, the same GitHub prompt succeeded on rerun without restarting anything.
Can I approve rules automatically?
By default you approve manually. The approver checks every policy change for new risk, and rules can be approved automatically when no new risk is found. Start with manual approval until you are comfortable with how it behaves.
Can OpenShell run somewhere other than a single Ubuntu machine?
Yes. It can also run in Kubernetes, according to the demo. Check the official documentation for setup details on those environments.
How we source, write, and correct our articles. Editorial standards
Related articles

Is OpenBot Safe? What Full Access Means and How to Limit It

Are AI Cyber Models Behind the Bank and Airline Outages?

What Is Goal Engineering? LangChain's Idea Explained
