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

# Sandboxes

> Inspect a run's sandboxes over the Platform API: runs that used them, the fleet summary, a run's lineage, active sandboxes and step commands; diff two snapshots and replay a command.

A workflow step that runs code does so in a sandbox: a VM whose state is saved as snapshots in a lineage the run owns. The routes on this page (at v2, under `/api/v2/sandboxes/*`) are the Console's Sandboxes pages for machines: they read the same rows, and diff and replay start VMs the way the Console's diff and replay pages do. Times are epoch milliseconds.

## Authority

| Operations | Permission |
| - | - |
| [List sandbox runs](https://docs.gloo.com/forge/reference/http-api/sandboxes/listRuns.md), [Get sandbox fleet summary](https://docs.gloo.com/forge/reference/http-api/sandboxes/getFleetSummary.md), [Get sandbox lineage](https://docs.gloo.com/forge/reference/http-api/sandboxes/getLineage.md), [List active sandboxes](https://docs.gloo.com/forge/reference/http-api/sandboxes/listActive.md), [List sandbox commands](https://docs.gloo.com/forge/reference/http-api/sandboxes/listCommands.md), [Diff sandbox snapshots](https://docs.gloo.com/forge/reference/http-api/sandboxes/diffSnapshots.md) | `factories:read` |
| [Replay sandbox command](https://docs.gloo.com/forge/reference/http-api/sandboxes/replayCommand.md) | `factories:manage` |

A sandbox belongs to its run, so each read is decided at the run's home (its own org unit, else its workflow's owning org unit) and at every company the run carries; a run or snapshot out of reach answers `404` like a missing one. The fleet summary belongs to no org unit and needs `factories:read` at the platform scope. Replay also needs `factories:manage` at the snapshot run's home (`403` otherwise).

* A Personal key acts as its owner: the owner's grants must hold the permission, and the key's scopes must reach the same permission.
* An External App or a platform API key needs a role grant whose role carries the permission.
* A Forge agent may hold both permissions and acts as its own grants say.

## What never crosses

Every answer is a closed set of fields. A command's raw input and output, the contents of files a command wrote, a snapshot's source (its repository URL and credential reference), environment values and the replayed command never cross. Command text, stdout, stderr, errors and diffed file contents are masked before they are cut to their caps: credential-shaped strings are replaced by `[REDACTED]`. Masking is defense in depth, not a scrubber.

## Billing and stops

[Diff sandbox snapshots](https://docs.gloo.com/forge/reference/http-api/sandboxes/diffSnapshots.md) starts two VMs and [Replay sandbox command](https://docs.gloo.com/forge/reference/http-api/sandboxes/replayCommand.md) one; both are billable and both are refused while Forge is stopped. A replay is recorded in an audit event before its VM starts, and its output is never stored, so an `Idempotency-Key` repeat answers `409` and never runs the command twice.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.