Skip to main content

AI coding glossary

Code Sandbox (Agent Sandbox)

Also known as: agent sandbox, ai sandbox, execution sandbox

In one sentence

An isolated execution environment where an AI agent runs code, usually a container, VM, or git worktree, to prevent agent actions from damaging the host system or main branch.

Full definition

A code sandbox is the isolated environment where an AI agent executes code. Sandboxing is the safety layer that lets agents run shell commands, install dependencies, modify files, and run tests without those actions corrupting the host system or polluting the main branch. Common 2026 patterns: ephemeral Docker containers (Codex CLI, GitHub Copilot Workspace), git worktrees (Claude Code's --worktree flag), full VMs (Devin's per-task VMs), and the browser-based WebContainer used by Bolt.new. The trade-off: tighter sandboxes are safer but slower to spin up; lighter sandboxes (just a git worktree) are fast but riskier.

On skills-hub.ai

Related terms