# Why your AI tool should work in a box

Security · For Claude Code and Cursor · Published 2026-11-20 · Last checked against its sources 2026-11-19
Web page: https://vibe.ikangai.com/notices/ai-in-a-box.html

> When Cursor or Claude Code builds your app on your own computer, it runs commands with your access. A sandbox is a fenced-off space where those commands can only reach the folders and websites you allow. Both tools have one built in, with gaps worth knowing. If you only build in your browser, for example in Bolt, you can skip this explainer.

## Is this for you?

It applies if any of these is true:

- You use Cursor, Claude Code or another AI tool that works in the files on your own computer.
- You let it run commands, such as installing add-ons or running tests, without reading each one first.
- Your computer holds secret keys or logins for your live app, your database or your payment provider.
- You are thinking of trying a cheaper or free AI model inside your tool.

## What it is

An AI tool that builds your app on your computer does more than write text. It runs commands: it installs add-ons, starts your app, runs tests. Without limits, those commands run with your own access. The UK’s National Cyber Security Centre (NCSC) points out that an AI tool running on your computer may be able to use any login or key your own user account has.

A sandbox is a fenced-off space for those commands. They still run, but only reach the folders and websites you allow. The NCSC, writing for organisations, says to always run AI tools that act on their own inside a sandbox that controls what they can reach, both on the computer and over the internet.

Why not just approve every command? Simon Willison, writing on the blog of Prime Radiant, an AI research lab, calls that a terrible way to work: it is slow, and people soon approve everything without reading. Built-in safety checks help, he writes, but they still depend on an AI judging each step correctly. A sandbox does not depend on anyone’s judgment.

There are two reasons to want one. AI tools make mistakes. And they can be tricked: a web page or file the tool reads may contain hidden instructions that it then follows. Willison notes that cheaper models and models running on your own computer make more mistakes and are easier to trick this way.

## How it works

A sandbox draws three lines. Files: commands may change your project folder, and the rest of your computer is off limits for changes. Internet: by default nothing goes out, and you list the websites commands may reach, such as the place add-ons are downloaded from. Keys: secret keys stay outside.

The NCSC describes the internet line as a ladder. At the bottom, a tool can reach any website. One step up, only a list of approved websites. At the top, nothing outside at all. It describes the walls the same way: none; a separate compartment on the same computer, which can still be broken out of; a separate virtual computer; and, strongest, a separate machine.

Keys are the clever part. Both the NCSC and Prime Radiant describe a go-between that adds the real key to a request on its way out, so the AI tool only ever sees a stand-in. Prime Radiant released free prototypes on 16 November 2026 that do this. They keep the AI tool itself outside the box and send only its commands in, which they call an external sandbox. They say the prototypes are experimental and not yet checked well enough for sensitive work.

You do not need their prototypes to start. Claude Code has a sandbox for the commands it runs. It is off until you switch it on, and its list of allowed websites starts empty. Cursor runs commands in a sandbox on Mac and Linux in its recommended mode, Auto-review. In its Run Everything mode there is no sandbox. Bolt is different: it runs your project inside your browser, so nothing it builds runs directly on your computer.

## What to watch out for

Built-in boxes have gaps. Claude Code’s sandbox covers commands only. Its own reading and editing of files and its connectors to other services run outside it. By default, commands inside it can still read most of your computer, including files where keys are often kept, and they receive any secret keys Claude Code itself was started with, unless you block them.

The box can open. When a command fails inside it, both tools can run it again outside. Claude Code may ask you first, depending on your settings. Cursor passes the rerun to its own AI reviewer, and its documentation says that reviewer can make mistakes and is not a security boundary. Those requests are the moment the box opens, so read them.

The box may not be there. Claude Code’s sandbox runs on Mac, Linux and Windows through WSL2, a built-in way to run Linux on Windows; on plain Windows it runs commands without one. If the sandbox cannot start, Claude Code carries on without it unless you tell it to stop.

A box only keeps out what you leave out. Prime Radiant warns that anything in a folder the tool may change can still be damaged, so keep a save point. If you put your live database’s master key inside, or allow its website, the tool can still reach your real customers’ data.

## What to tell your AI

1. Ask your AI tool what box it works in now. This message only reads. It works in Claude Code and Cursor; it does not apply to builders that run in your browser.

   Message to paste:

   ```text
   Check how you run commands on this computer and explain in plain words. Change nothing yet.
   1. Do the shell commands you run go through a sandbox? Which one, and is it switched on right now?
   2. Inside it, which folders can commands write to and which can they read? Can they read files that hold secrets, such as .env files, ~/.ssh or ~/.aws?
   3. Which websites can commands reach without asking me?
   4. Which of your tools run outside the sandbox (reading and editing files, MCP servers, anything else)?
   5. If a command fails in the sandbox, can it be run again outside it, and would I be asked first?
   Do not print any keys, passwords or tokens.
   ```

2. Read the answer. A good one names the sandbox, says it is on, and lists what runs outside it. Warning signs: no sandbox at all; Cursor set to Run Everything; every website allowed; commands that can read your key files.
3. In Claude Code: type /sandbox and choose a mode. Then send this message. It proposes changes and waits for your OK.

   Message to paste:

   ```text
   Propose sandbox settings for this project. Show me the exact change and wait for my OK before editing any settings file.
   - sandbox enabled, with allowUnsandboxedCommands set to false, so a blocked command is never retried outside the sandbox
   - failIfUnavailable set to true, so you stop instead of running unsandboxed if the sandbox cannot start
   - the sandbox credentials setting to deny reads of files holding secrets (.env files, ~/.ssh, ~/.aws) and to remove secret environment variables from sandboxed commands
   - network access only to the domains this project needs, listed for me first
   Tell me what each change might break. Do not print any secret values.
   ```

4. In Cursor: open Settings, then Agents, then Approvals & Execution. Choose Auto-review rather than Run Everything. Under Read Access choose Workspace, so Cursor asks before it reads files outside your project; this needs Cursor 3.23 or later.
5. From now on, when your tool asks to run something outside the box, read what it wants to do before you say yes. If it wants your live database or your payment keys, say no and ask why. Where your keys should live is covered in [Your AI tool can do everything your passwords can do](/notices/agent-credentials.html).

## What this is based on

Written from these 5 sources together. Each entry says what it contributed.

- [External sandboxes for coding agents](https://blog.primeradiant.com/external-sandboxes-for-coding-agents/). Simon Willison, Prime Radiant blog. Engineering post, 16 November 2026. Why approving every action fails (slow, leads to approving without reading); that built-in checks still rely on a model judging each action, while a sandbox does not; that cheaper and local models make more mistakes and are easier victims of hidden instructions; the external sandbox pattern, with the AI tool outside and its commands inside; credential replacement with a stand-in key; no internet by default with a list of allowed sites; the release of three free prototypes; that they are experimental and not audited for sensitive work; and that a folder the tool may write to can still be damaged. Willison’s own link post of 17 November 2026 (https://simonwillison.net/2026/Nov/17/external-sandboxes-for-coding-agents/) was the lead. Note: The post introduces the authors’ own free sandbox prototypes. Prime Radiant is an AI research lab.
- [Managing the cyber risk of agentic AI](https://www.ncsc.gov.uk/blogs/managing-the-cyber-risk-of-agentic-ai). Toby W, National Cyber Security Centre (UK). Government guidance (interim blog), 20 August 2026. That AI tools acting on their own should always run in a sandbox controlling what they can reach locally and over the network; to block all network traffic by default and allow only what is needed; the four levels for network access and for isolation, including the residual risk of breaking out of containers; that a tool without isolation may use the credentials of the user account it runs under; and that a proxy can inject credentials without exposing them to the tool. Written for system designers and operators in organisations.
- [Configure the sandboxed Bash tool](https://code.claude.com/docs/en/sandboxing). Claude Code documentation (Anthropic). Documentation, no date shown. That the sandbox is off by default and turned on with /sandbox; that it covers shell commands only, while file tools and MCP servers run outside it; that sandboxed commands can write to the working directory, can by default read most of the machine including credential files, inherit environment variables including secrets, and have allowed domains that start empty; the credentials, allowUnsandboxedCommands and failIfUnavailable settings; the unsandboxed retry and who approves it; that it runs on macOS, Linux and WSL2, unsandboxed on native Windows; and that it runs commands without the sandbox if it cannot start. Note: Anthropic sells Claude Code, an AI coding tool named in this explainer.
- [Run Modes](https://cursor.com/docs/agent/security/run-modes). Cursor documentation. Documentation, no date shown. The three run modes and that Run Everything has no sandbox; that Auto-review sandboxes shell commands when it can and is not a security boundary; that a command failing in the sandbox can be rerun outside it after the classifier reviews it; the sandbox on macOS and Linux; network blocked by default except a default list of package sites; and the Read Access setting (System by default, Workspace to ask first; Cursor 3.23 or later) under Settings > Agents > Approvals & Execution. Note: Cursor sells the AI code editor named in this explainer.
- [FAQs](https://support.bolt.new/concepts/faq). Bolt help centre. Documentation, no date shown. That Bolt runs on WebContainers, a full development environment that runs directly in the browser, with nothing to install. Note: Bolt sells the AI app builder named in this explainer.
