Codegen’s sandbox environments are highly configurable and built for
enterprise workloads
Configure Sandbox Environments
Select VM resources, install dependencies, securely upload secrets and more.
Capabilities
Each sandbox provides a controlled environment with:- File System Access: Read, write, and modify files within the sandbox’s temporary file system.
- Terminal Access: Execute shell commands (
bash
,sh
, etc.) to run scripts, linters, formatters, build tools, and other necessary commands. - Process Execution: Run code in various languages (Python, Node.js, etc., depending on the sandbox image).
- Networking: Controlled network access for tasks like installing packages or fetching data (can be restricted).
How Agents Use Sandboxes
Agents utilize sandboxes for a variety of tasks:- Testing Code: Running unit tests, integration tests, or linters against the code they’ve written or modified.
- Verifying Changes: Executing the code to ensure it runs correctly before committing.
- Installing Dependencies: Using package managers (
pip
,npm
,yarn
) to install necessary libraries. - Running Tools: Executing build scripts, code formatters, or other development utilities.
Configuration
Sandboxes are typically configured per-agent run or defined within your Codegen settings. You often don’t need to manage them directly, but advanced configurations might allow specifying Docker images or environment variables.Sandboxes maintain file system persistence between agent interactions within
the same context. For example, when continuing a conversation across different
Slack messages or Linear comments, the sandbox state is preserved, allowing
agents to seamlessly continue their work without losing context or having to
reinstall dependencies.
Sandbox Configuration
Setup Commands
Configure custom setup commands that run when initializing your sandbox
environment.
Repository Secrets
Manage environment variables and secrets securely injected into your
sandbox.
Image Snapshots
Learn how Codegen creates filesystem snapshots for faster initialization.
Web Preview
Start development servers and view your running applications through
Codegen.
Base Image
Explore the comprehensive Docker image that powers Codegen sandboxes.
Remote Editor
Access a VSCode editor connected directly to your sandbox environment.