<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://info.stat.cmu.edu/index.php?action=history&amp;feed=atom&amp;title=Docker_Sandboxes_for_AI_Agents</id>
	<title>Docker Sandboxes for AI Agents - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://info.stat.cmu.edu/index.php?action=history&amp;feed=atom&amp;title=Docker_Sandboxes_for_AI_Agents"/>
	<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Docker_Sandboxes_for_AI_Agents&amp;action=history"/>
	<updated>2026-11-06T04:22:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://info.stat.cmu.edu/index.php?title=Docker_Sandboxes_for_AI_Agents&amp;diff=1011&amp;oldid=prev</id>
		<title>Ajshen: Created page with &quot;&lt;!-- TODO: set the category (and sort key) to match where this article lives in the wiki --&gt; Category:AI Tools Category:Containers and Virtual Environments  &#039;&#039;&#039;[https://docs.docker.com/ai/sandboxes/ Docker Sandboxes]&#039;&#039;&#039; (the &lt;code&gt;sbx&lt;/code&gt; command-line tool) runs AI coding agents such as Claude Code, Codex, Copilot, and Gemini inside disposable, isolated micro virtual machines (&#039;&#039;&#039;microVMs&#039;&#039;&#039;). Inside the sandbox the agent has a full Linux machine to do whateve...&quot;</title>
		<link rel="alternate" type="text/html" href="https://info.stat.cmu.edu/index.php?title=Docker_Sandboxes_for_AI_Agents&amp;diff=1011&amp;oldid=prev"/>
		<updated>2026-10-26T20:53:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;!-- TODO: set the category (and sort key) to match where this article lives in the wiki --&amp;gt; &lt;a href=&quot;/index.php?title=Category:AI_Tools&quot; title=&quot;Category:AI Tools&quot;&gt;Category:AI Tools&lt;/a&gt; &lt;a href=&quot;/index.php?title=Category:Containers_and_Virtual_Environments&quot; title=&quot;Category:Containers and Virtual Environments&quot;&gt;Category:Containers and Virtual Environments&lt;/a&gt;  &amp;#039;&amp;#039;&amp;#039;[https://docs.docker.com/ai/sandboxes/ Docker Sandboxes]&amp;#039;&amp;#039;&amp;#039; (the &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; command-line tool) runs AI coding agents such as Claude Code, Codex, Copilot, and Gemini inside disposable, isolated micro virtual machines (&amp;#039;&amp;#039;&amp;#039;microVMs&amp;#039;&amp;#039;&amp;#039;). Inside the sandbox the agent has a full Linux machine to do whateve...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- TODO: set the category (and sort key) to match where this article lives in the wiki --&amp;gt;&lt;br /&gt;
[[Category:AI Tools]]&lt;br /&gt;
[[Category:Containers and Virtual Environments]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[https://docs.docker.com/ai/sandboxes/ Docker Sandboxes]&amp;#039;&amp;#039;&amp;#039; (the &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; command-line tool) runs AI coding agents such as Claude Code, Codex, Copilot, and Gemini inside disposable, isolated micro virtual machines (&amp;#039;&amp;#039;&amp;#039;microVMs&amp;#039;&amp;#039;&amp;#039;). Inside the sandbox the agent has a full Linux machine to do whatever it wants with. Your own computer only exposes the project folder you hand it and the network destinations you allow.&lt;br /&gt;
&lt;br /&gt;
The point is to give an agent real autonomy without handing it your whole computer. It can install packages, run builds, and run tests without asking permission at every step, and it still can&amp;#039;t reach your home directory, SSH keys, or cloud credentials.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #e8f4f8; border-left: 5px solid #17a2b8; padding: 15px; margin-bottom: 20px; margin-top: 15px; overflow: hidden;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Before you start&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
This article covers what Docker Sandboxes are and how to install them. For day-to-day use, see Docker&amp;#039;s [https://docs.docker.com/ai/sandboxes/get-started/ getting started guide] and [https://docs.docker.com/ai/sandboxes/usage/ usage guide]. &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; is new and changes quickly between releases, so if a command here doesn&amp;#039;t match what you see, trust the [https://docs.docker.com/ai/sandboxes/install/ official install page] and the [https://docs.docker.com/ai/sandboxes/release-notes/ release notes].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Overview: Docker Sandboxes for AI Agents ==&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
When you run &amp;lt;code&amp;gt;sbx run claude&amp;lt;/code&amp;gt; from a project folder, &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; does the following:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Boots a microVM&amp;#039;&amp;#039;&amp;#039; with its own Linux kernel. It uses the operating system&amp;#039;s built-in hypervisor: Hypervisor.framework on macOS, Windows Hypervisor Platform on Windows, and KVM on Linux.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Mounts your current folder&amp;#039;&amp;#039;&amp;#039; into the VM as the workspace. This folder is the only part of your machine the agent can see.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Starts a private Docker daemon&amp;#039;&amp;#039;&amp;#039; inside the VM, so the agent can build images and run containers without touching yours.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Filters outbound network traffic&amp;#039;&amp;#039;&amp;#039; through a policy you choose. The presets are &amp;#039;&amp;#039;Open&amp;#039;&amp;#039;, &amp;#039;&amp;#039;Balanced&amp;#039;&amp;#039; (deny by default, with common development sites allowed), and &amp;#039;&amp;#039;Locked Down&amp;#039;&amp;#039;.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Handles credentials from the host&amp;#039;&amp;#039;&amp;#039;. For example, Claude Code&amp;#039;s login token stays on your machine rather than being stored in the sandbox. See [https://docs.docker.com/ai/sandboxes/configuration/credentials/ Credentials].&lt;br /&gt;
&lt;br /&gt;
Sandboxes persist after the agent exits. You can stop and resume them, and you delete them when you&amp;#039;re done. Everything the agent installed inside the sandbox is discarded at that point, and your project files are left alone. For the details, see [https://docs.docker.com/ai/sandboxes/architecture/ Architecture] and [https://docs.docker.com/ai/sandboxes/security/isolation/ Isolation layers].&lt;br /&gt;
&lt;br /&gt;
=== How it compares ===&lt;br /&gt;
{| style=&amp;quot;width: 100%; border-collapse: collapse; margin-bottom: 10px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 16%; background-color: #e9ecef; padding: 10px; text-align: left;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 28%; background-color: #f8d7da; color: #721c24; padding: 10px; text-align: left;&amp;quot; | Agent run directly on your machine&lt;br /&gt;
! style=&amp;quot;width: 28%; background-color: #fff3cd; color: #856404; padding: 10px; text-align: left;&amp;quot; | Agent in a regular Docker container&lt;br /&gt;
! style=&amp;quot;width: 28%; background-color: #d4edda; color: #155724; padding: 10px; text-align: left;&amp;quot; | Agent in a Docker Sandbox&lt;br /&gt;
|- style=&amp;quot;vertical-align: top; background-color: #f8f9fa;&amp;quot;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Isolation boundary&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | None. The agent runs as &amp;#039;&amp;#039;you&amp;#039;&amp;#039;.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Linux namespaces. All containers share one kernel, so escaping the container means reaching the host (or Docker Desktop&amp;#039;s VM).&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | A separate VM with its own kernel for each sandbox.&lt;br /&gt;
|- style=&amp;quot;vertical-align: top; background-color: #ffffff;&amp;quot;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Files it can touch&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Everything your account can read or write, including other repos, &amp;lt;code&amp;gt;~/.ssh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;~/.aws&amp;lt;/code&amp;gt;, and browser profiles.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Whatever you bind-mount. It&amp;#039;s easy to mount too much.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Only the workspace folder.&lt;br /&gt;
|- style=&amp;quot;vertical-align: top; background-color: #f8f9fa;&amp;quot;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Network&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Unrestricted.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Unrestricted by default. Egress filtering is your problem.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Policy-controlled, with presets and per-host allow and deny rules.&lt;br /&gt;
|- style=&amp;quot;vertical-align: top; background-color: #ffffff;&amp;quot;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Running Docker itself&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Uses your Docker daemon.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Requires mounting the host&amp;#039;s Docker socket, which is effectively root on the host.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | Uses its own daemon inside the VM. Nothing is shared with the host.&lt;br /&gt;
|- style=&amp;quot;vertical-align: top; background-color: #f8f9fa;&amp;quot;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | &amp;#039;&amp;#039;&amp;#039;Setup&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | None.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | You write and maintain the Dockerfile, mounts, and agent install.&lt;br /&gt;
| style=&amp;quot;padding: 10px;&amp;quot; | One command. The common agents come preinstalled.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compared with running an agent directly on your machine:&amp;#039;&amp;#039;&amp;#039; coding agents protect you mostly by asking permission before running commands. After the fiftieth prompt, most people either click &amp;quot;approve&amp;quot; without reading or turn the prompts off entirely. Inside a sandbox, turning prompts off is much less dangerous. A bad command, a hallucinated &amp;lt;code&amp;gt;rm -rf&amp;lt;/code&amp;gt;, or a prompt injection hidden in a README or web page can only reach the workspace and the network hosts you allowed.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Compared with plain Docker:&amp;#039;&amp;#039;&amp;#039; you &amp;#039;&amp;#039;can&amp;#039;&amp;#039; build your own agent container. To make it safe, though, you have to solve the problems Sandboxes already handle. You need a kernel boundary rather than a shared kernel, outbound filtering, a way to keep API keys out of the container, and a way for the agent to use Docker without mounting the host socket. Sandboxes also don&amp;#039;t require Docker Desktop. You may see a &amp;lt;code&amp;gt;docker sandbox&amp;lt;/code&amp;gt; command that ships with Docker Desktop. This article uses the standalone &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; CLI instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f8d7da; border-left: 5px solid #721c24; padding: 15px; margin-bottom: 20px; margin-top: 15px; overflow: hidden;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Warning: What a sandbox does &amp;#039;&amp;#039;not&amp;#039;&amp;#039; protect&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Your workspace.&amp;#039;&amp;#039;&amp;#039; By default the project folder is mounted read-write, so the agent can still delete or break files in it. Commit before you start, or use [https://docs.docker.com/ai/sandboxes/usage/ clone mode] to give the agent a private copy.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;What the agent sends to the model.&amp;#039;&amp;#039;&amp;#039; The sandbox limits what the agent can &amp;#039;&amp;#039;touch&amp;#039;&amp;#039;. It does not limit what gets sent to the model provider&amp;#039;s API as context. Don&amp;#039;t put data you aren&amp;#039;t permitted to share with a third party (for example, restricted or IRB-protected data) in the workspace.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Hosts you allow.&amp;#039;&amp;#039;&amp;#039; The Open policy, or broad allow rules, can still be used to move data out of the sandbox. Tokens you give the agent, such as a GitHub token, can be used for anything they&amp;#039;re scoped for.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [https://docs.docker.com/ai/sandboxes/security/defaults/ Security defaults] for exactly what is and isn&amp;#039;t allowed out of the box.&lt;br /&gt;
&lt;br /&gt;
== Installing on Windows ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f8f9fa; border-left: 4px solid #005A9C; padding: 15px; margin-bottom: 10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements:&amp;#039;&amp;#039;&amp;#039; Windows 11 on a 64-bit Intel or AMD processor (Windows on Arm is not supported), hardware virtualization turned on, and administrator rights &amp;#039;&amp;#039;&amp;#039;once&amp;#039;&amp;#039;&amp;#039; to enable Windows Hypervisor Platform. Run all commands in PowerShell. Steps marked &amp;#039;&amp;#039;&amp;#039;(Administrator)&amp;#039;&amp;#039;&amp;#039; need an elevated prompt: right-click PowerShell and choose &amp;#039;&amp;#039;Run as administrator&amp;#039;&amp;#039;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 1: Check your system ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
# Should print &amp;quot;Microsoft Windows 11 ...&amp;quot;&lt;br /&gt;
(Get-CimInstance Win32_OperatingSystem).Caption&lt;br /&gt;
&lt;br /&gt;
# Should print AMD64&lt;br /&gt;
$env:PROCESSOR_ARCHITECTURE&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next, open &amp;#039;&amp;#039;&amp;#039;Task Manager → Performance → CPU&amp;#039;&amp;#039;&amp;#039; and check that it shows &amp;#039;&amp;#039;&amp;#039;Virtualization: Enabled&amp;#039;&amp;#039;&amp;#039;. If it shows Disabled, turn on Intel VT-x or AMD-V (SVM) in your BIOS/UEFI settings. Microsoft&amp;#039;s guide covers this: [https://support.microsoft.com/en-us/windows/enable-virtualization-on-windows-c5578302-6e43-4b4b-a449-8ced115f58e1 Enable virtualization on Windows].&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Enable Windows Hypervisor Platform (Administrator) ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform -All&lt;br /&gt;
Restart-Computer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After rebooting, check that the feature is on. It should report &amp;lt;code&amp;gt;Enabled&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
(Get-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform).State&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re on a department-managed laptop without admin rights, this is the one step you&amp;#039;ll need IT for.&lt;br /&gt;
&lt;br /&gt;
=== Step 3: Install sbx ===&lt;br /&gt;
In a &amp;#039;&amp;#039;&amp;#039;regular&amp;#039;&amp;#039;&amp;#039; (non-admin) PowerShell window:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
winget install -h Docker.sbx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This installs &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; for your user only, in &amp;lt;code&amp;gt;%LOCALAPPDATA%\DockerSandboxes&amp;lt;/code&amp;gt;, and adds it to your user &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt;. &amp;#039;&amp;#039;&amp;#039;Close and reopen PowerShell&amp;#039;&amp;#039;&amp;#039;, then confirm that it works:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
sbx version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you get &amp;lt;code&amp;gt;sbx is not recognized&amp;lt;/code&amp;gt;, the &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; change hasn&amp;#039;t been picked up yet. Open a new window, or sign out and back in. You can confirm the binary exists with &amp;lt;code&amp;gt;Test-Path &amp;quot;$env:LOCALAPPDATA\DockerSandboxes\bin\sbx.exe&amp;quot;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To install for every user on a shared machine, use the machine-wide MSI described on the [https://docs.docker.com/ai/sandboxes/install/ install page].&lt;br /&gt;
&lt;br /&gt;
=== Step 4: Sign in ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
sbx login&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens a browser so you can sign in with a Docker account. If you don&amp;#039;t have one, create one at [https://hub.docker.com/signup Docker Hub]. The [https://docs.docker.com/ai/sandboxes/faq/ FAQ] explains why sign-in is required.&lt;br /&gt;
&lt;br /&gt;
=== Step 5: Run your first sandbox ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;powershell&amp;quot;&amp;gt;&lt;br /&gt;
cd $HOME\path\to\your-project&lt;br /&gt;
git status        # commit or stash anything you care about first&lt;br /&gt;
sbx run claude&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first time you run a sandbox, &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; asks you to choose a default network policy. &amp;#039;&amp;#039;&amp;#039;Balanced&amp;#039;&amp;#039;&amp;#039; is a sensible starting point. The first run also takes a minute while the agent image downloads. For Claude Code with a Claude subscription, type &amp;lt;code&amp;gt;/login&amp;lt;/code&amp;gt; inside the sandbox. For other agents or API keys, see the [https://docs.docker.com/ai/sandboxes/agents/ agent pages].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Updating later:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;winget upgrade Docker.sbx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing on macOS ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f8f9fa; border-left: 4px solid #005A9C; padding: 15px; margin-bottom: 10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements:&amp;#039;&amp;#039;&amp;#039; a Mac with Apple silicon (M1 or later) running macOS 14 Sonoma or later. Intel Macs are not supported. You also need [https://brew.sh Homebrew]. Run all commands in Terminal.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 1: Check your system ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
uname -m                  # should print arm64&lt;br /&gt;
sw_vers -productVersion   # should be 14.0 or higher&lt;br /&gt;
brew --version            # if this fails, install Homebrew from https://brew.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Install sbx ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
brew trust docker/tap&lt;br /&gt;
brew install docker/tap/sbx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first command marks Docker&amp;#039;s Homebrew tap as trusted. If Homebrew reports &amp;lt;code&amp;gt;brew trust&amp;lt;/code&amp;gt; as an unknown command, run &amp;lt;code&amp;gt;brew update&amp;lt;/code&amp;gt; and try again.&lt;br /&gt;
&lt;br /&gt;
Confirm the install:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sbx version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3: Sign in ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sbx login&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens a browser so you can sign in with a Docker account. If you don&amp;#039;t have one, create one at [https://hub.docker.com/signup Docker Hub]. The [https://docs.docker.com/ai/sandboxes/faq/ FAQ] explains why sign-in is required.&lt;br /&gt;
&lt;br /&gt;
=== Step 4: Run your first sandbox ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/path/to/your-project&lt;br /&gt;
git status        # commit or stash anything you care about first&lt;br /&gt;
sbx run claude&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first time you run a sandbox, &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; asks you to choose a default network policy. &amp;#039;&amp;#039;&amp;#039;Balanced&amp;#039;&amp;#039;&amp;#039; is a sensible starting point. For Claude Code with a Claude subscription, type &amp;lt;code&amp;gt;/login&amp;lt;/code&amp;gt; inside the sandbox. For other agents or API keys, see the [https://docs.docker.com/ai/sandboxes/agents/ agent pages].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Updating later:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;brew upgrade docker/tap/sbx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installing on Linux ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f8f9fa; border-left: 4px solid #005A9C; padding: 15px; margin-bottom: 10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Requirements:&amp;#039;&amp;#039;&amp;#039; Ubuntu 24.04 or later on x86-64 or 64-bit Arm, KVM hardware virtualization, and &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt;. Docker does &amp;#039;&amp;#039;&amp;#039;not&amp;#039;&amp;#039;&amp;#039; support Ubuntu derivatives such as Linux Mint or Pop!_OS, because the install script can configure the wrong package repository on them. For other distributions, see the [https://github.com/docker/sbx-releases#manual-install-from-release-artifacts release artifacts], which Docker does not test. If you&amp;#039;re installing inside a virtual machine, the VM must support nested virtualization.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f8d7da; border-left: 5px solid #721c24; padding: 15px; margin-bottom: 20px; margin-top: 15px; overflow: hidden;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Shared servers and clusters&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
Installing &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; needs &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; and membership in the &amp;lt;code&amp;gt;kvm&amp;lt;/code&amp;gt; group, which you usually won&amp;#039;t have on department compute servers or clusters. Run sandboxes on your own machine, or ask the system administrators.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 1: Check your system ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
lsb_release -ds    # should be Ubuntu 24.04 or later&lt;br /&gt;
uname -m           # x86_64 or aarch64&lt;br /&gt;
lsmod | grep kvm   # should list kvm_intel, kvm_amd, kvm_arm64, or kvm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the last command prints nothing, find out why with:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt install cpu-checker&lt;br /&gt;
kvm-ok&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The usual cause is that virtualization is turned off in the BIOS/UEFI.&lt;br /&gt;
&lt;br /&gt;
=== Step 2: Add yourself to the kvm group ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo usermod -aG kvm $USER&lt;br /&gt;
newgrp kvm                 # or log out and back in&lt;br /&gt;
groups | grep -w kvm       # should now print your groups, including kvm&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3: Install sbx ===&lt;br /&gt;
Choose &amp;#039;&amp;#039;&amp;#039;one&amp;#039;&amp;#039;&amp;#039; of the following options.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Option A: &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; only.&amp;#039;&amp;#039;&amp;#039; Choose this if you don&amp;#039;t need Docker Engine on the host.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
curl -fsSL https://get.docker.com | sudo REPO_ONLY=1 sh   # adds Docker&amp;#039;s apt repository&lt;br /&gt;
sudo apt install docker-sbx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Option B: Docker Engine and &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; together.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
curl -fsSL https://get.docker.com | sudo SBX=1 sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;d rather read the install script before running it with root privileges, download it first:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
curl -fsSL https://get.docker.com -o get-docker.sh&lt;br /&gt;
less get-docker.sh&lt;br /&gt;
sudo REPO_ONLY=1 sh get-docker.sh   # or SBX=1 for Option B&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirm the install:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sbx version&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 4: Sign in ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sbx login&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This opens a browser so you can sign in with a Docker account. If you don&amp;#039;t have one, create one at [https://hub.docker.com/signup Docker Hub]. On a machine without a desktop, see [https://docs.docker.com/ai/sandboxes/troubleshooting/ Troubleshooting].&lt;br /&gt;
&lt;br /&gt;
=== Step 5: Run your first sandbox ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd ~/path/to/your-project&lt;br /&gt;
git status        # commit or stash anything you care about first&lt;br /&gt;
sbx run claude&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first time you run a sandbox, &amp;lt;code&amp;gt;sbx&amp;lt;/code&amp;gt; asks you to choose a default network policy. &amp;#039;&amp;#039;&amp;#039;Balanced&amp;#039;&amp;#039;&amp;#039; is a sensible starting point. For Claude Code with a Claude subscription, type &amp;lt;code&amp;gt;/login&amp;lt;/code&amp;gt; inside the sandbox. For other agents or API keys, see the [https://docs.docker.com/ai/sandboxes/agents/ agent pages].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Updating later:&amp;#039;&amp;#039;&amp;#039; &amp;lt;code&amp;gt;sudo apt update &amp;amp;&amp;amp; sudo apt install --only-upgrade docker-sbx&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #e8f4f8; padding: 15px; text-align: center; margin-top: 20px; font-style: italic;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Next steps:&amp;#039;&amp;#039;&amp;#039; Once your first sandbox runs, read the [https://docs.docker.com/ai/sandboxes/usage/ usage guide] for reconnecting, ports, and clone mode. The [https://docs.docker.com/ai/sandboxes/workflows/git/ Git workflows] page covers letting agents push branches, [https://docs.docker.com/ai/sandboxes/governance/access-controls/local/ Local policy] covers tuning network rules, and the [https://docs.docker.com/reference/cli/sbx/ CLI reference] lists every command.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ajshen</name></author>
	</entry>
</feed>