> ## Documentation Index
> Fetch the complete documentation index at: https://docs.noxus.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Sandbox

> A secure, isolated environment where agents run code and build artifacts

The **Sandbox** gives an agent a secure, isolated environment — a [gVisor](https://gvisor.dev) micro-VM — where it can run shell commands, execute code, install packages, and read and write files. Unlike one-shot [Code Execution](/platform/agents/tools), the sandbox **persists across the conversation**, so the agent can work step by step: fetch data, transform it, and produce a finished artifact.

## Why it's safe

<CardGroup cols={2}>
  <Card title="Isolated" icon="shield">
    Each sandbox is a gVisor micro-VM with its own filesystem — code runs isolated from the platform and from other workspaces.
  </Card>

  <Card title="Network-jailed" icon="network-wired">
    Private/internal network ranges are blocked; the sandbox can't reach internal services.
  </Card>

  <Card title="Ephemeral" icon="timer">
    Sandboxes are torn down when idle, so nothing lingers after the task is done.
  </Card>

  <Card title="Permission-gated" icon="lock">
    Running code requires the `sandboxes:run` permission — it's never implied by general access and must be granted explicitly.
  </Card>
</CardGroup>

## What agents use it for

* Multi-step data processing that needs a real filesystem
* Building a report, spreadsheet, or document over several turns
* Running scripts or tooling and returning the output as a file

## Approvals

The sandbox executes real code, so you can gate it: require your **approval before the agent runs commands or writes files**. This keeps a human in the loop for higher-stakes automation while still letting the agent propose the work.

Enable the sandbox per agent under [Agent Tools](/platform/agents/tools).

## Programmatic sandboxes

The same sandbox capability is available directly — create a sandbox, run commands, and read/write files from code — without an agent:

<CardGroup cols={2}>
  <Card title="Sandboxes in the SDK" icon="python" href="/sdk/resources/sandboxes">
    `client.sandboxes.create()`, `sandbox.commands.run(...)`, `sandbox.files.write/read(...)`.
  </Card>

  <Card title="Sandboxes API" icon="code" href="/api-reference/v1--sandboxes/create-sandbox">
    The REST endpoints under `/v1/sandboxes`.
  </Card>
</CardGroup>
