Learning resourcesReviewed · Together AI

Together Code Sandbox Guide

Together AI's code sandbox guide teaches developers how to run code for AI agents in hosted environments, but runtime access requires organization-level enablement through sales. It covers Python, TypeScript and CLI workflows using snapshots built from Docker images or Dockerfiles. Sandboxes keep running unless explicitly terminated or given a time limit.

Researched 15 Nov 2026

In short.

Together AI's code sandbox guide is an introduction for developers whose AI agents need to execute code, but their organization must request runtime access through sales. It explains how to build reusable snapshots remotely, launch sandboxes, run commands, work with files and preserve state before termination. The main operational catch is cleanup: closing a Python context manager does not stop a sandbox. Pricing, detailed security guarantees and measured performance are not established by the page. Nothing was executed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete documentation page at [https://docs.together.ai/docs/together-code-sandbox.md], including the access requirement, installation and authentication, snapshots, command and file operations, resource sizing, lifecycle warnings, reference links and legacy-SDK notice. All linked pages and files are excluded. No installation, build, command, SDK call or sandbox session was executed. Security properties, performance, pricing and production behavior remain unassessed.

The overview

identity

This is Together's documentation guide for its hosted code sandbox service and together-sandbox Python SDK, TypeScript SDK and CLI. The original page is [https://docs.together.ai/docs/together-code-sandbox.md]. It teaches the core workflow for executing untrusted or model-generated code, agent tool calls and reinforcement-learning rollouts.

assessment

The guide provides a concrete introduction, including installation commands, examples in three interfaces and lifecycle warnings. Its most useful detail is the distinction between closing a client connection and terminating the remote environment. It supports understanding and planning an integration, but does not establish production reliability, security suitability or predictable costs.

users

The documented uses fit agent developers who need command execution, developers handling generated or otherwise untrusted programs, and reinforcement-learning engineers needing rollout environments. Python and TypeScript users receive SDK examples; developers preferring terminal workflows receive CLI examples. Running these workflows requires an enabled Together organization, so installing the package alone is insufficient.

capabilities

The page documents creating snapshots from public Docker images or Dockerfile build contexts, launching sandboxes, executing commands, creating and reading files, opening an interactive shell through the CLI, listing running sandboxes and saving state during termination. Snapshot aliases provide reusable names. The full-reference links also advertise streaming output, port discovery, filesystem watching, tagging, retries and error handling, but their details are not included.

Each sandbox defaults to 1 vCPU and 2 GiB of memory. Creation parameters allow 0.1 to 16 CPU cores and memory described as 1 to 8 GB per CPU. The page does not establish workload performance at these sizes.

Using it

requirements

Together must enable together-sandbox for the organization; the page directs users to sales for access. Authentication requires a Together API key. The Python SDK requires Python 3.10 or later, and the TypeScript SDK requires Node.js 18 or later. The CLI installer supplies a self-contained binary in ~/.local/bin without requiring Node.js or npm. Docker need not be installed locally because Together builds snapshots remotely. Supported CLI operating systems and architectures are not specified.

mechanism

A snapshot is a reusable starting environment built from an image or Dockerfile; a sandbox is a running instance of that snapshot. Creating the sandbox starts it and returns a connected client. Aliases use namespace@tag names, such as my-python@v1. Together's remote builder is described as optimizing images for fast cold starts, but no timings are supplied. A stable cache_key allows repeated builds to share a layer cache; without one, the page says builds start cold.

Termination permanently ends the sandbox and normally discards its filesystem. Requesting a snapshot during termination preserves state for a new sandbox. This resumes through a new instance rather than restarting the terminated one.

setup

After obtaining access, install the Python package with uv add together-sandbox or the TypeScript package with npm install together-sandbox. For the CLI, the page shows curl downloading a script from [https://raw.githubusercontent.com/togethercomputer/together-sandbox/main/install.sh] and piping it into bash. The script itself is outside the captured evidence and was not reviewed, so readers may want to inspect it before running it. Set TOGETHER_API_KEY, or pass api_key in Python or apiKey in TypeScript when creating the client. Create a snapshot from a public image or a build context containing a Dockerfile, then create a sandbox from its ID or alias.

Decide cleanup behavior before running a workload. Set ttl at creation, use --rm with the CLI's sandboxes run command, or explicitly terminate the sandbox. In Python, exiting an SDK or sandbox async context manager closes its HTTP connection but does not terminate the remote sandbox.

example

The documented example builds a snapshot from python:3.12-slim with the alias my-python@v1. It creates a sandbox from that alias, asks Python to calculate 6 multiplied by 7, prints the returned exit code and output, creates and reads /tmp/data.txt, then terminates the sandbox. The TypeScript example mirrors this workflow. The CLI example runs the same calculation, either in a throwaway sandbox with --rm or in a sandbox it keeps for repeated commands and an interactive bash shell, then terminates it; it does not show file operations. These are instructional examples; no execution results were observed.

Assessment & evidence

limitations

The service is described as isolated, but the page does not explain the isolation boundary, network restrictions, secret handling, data residency, retention policies or security assurances. Startup latency, throughput, concurrency quotas and service guarantees are also unknown. The guide therefore cannot establish suitability for sensitive code or data.

Lifecycle behavior requires care: termination is irreversible, files disappear unless state is saved, and sandboxes have no automatic cleanup unless configured. Details of streaming, retries and error handling require the separate references, whose contents are not available here.

reasoning

Reusable environments, remote image builds and command and file operations make the documented workflow relevant to agents that need repeatable execution environments. Avoiding a local Docker installation may simplify setup. Practical fit depends on obtaining access, understanding the hosting terms and implementing cleanup and state preservation. The cold-start optimization claim has no measurements here, so it cannot support a latency target or performance comparison.

alternatives

Python, TypeScript and the CLI are interface choices for the same documented service. The page also identifies an earlier integration built on @codesandbox/sdk for existing users and directs new integrations to together-sandbox. It supplies no comparison with other hosted sandbox providers or local execution options, so relative cost, performance and security are not assessed.

evidence

The evidence is the complete Together Code sandbox documentation page at [https://docs.together.ai/docs/together-code-sandbox.md]. Its prose and examples establish the documented interface and intended behavior, not independently observed performance or isolation. The linked documentation index, sales page, repository, installer, SDK and CLI references, and legacy guide are outside the available evidence. Nothing was executed.

Access & freshness

costs

Pricing is unknown. The page gives no rates, included allowance, free tier, minimum commitment or billing rules for runtime, builds, snapshots, storage or networking. Contacting sales is required for access, but that does not establish a particular fee. Sandboxes continue running by default, making their lifetime operationally important; the billing consequences are not stated. Obtain pricing and charging rules before estimating workload costs.

rights

The page does not establish documentation redistribution rights, SDK or CLI licences, or hosted-service terms. Links to a GitHub repository do not establish those permissions. Licence obligations for the chosen Docker image and any added dependencies also remain outside this evidence. Confirm the applicable terms before redistributing materials or deploying an integration with contractual requirements.

freshness

The documentation capture is dated 15 November 2026. The page provides no publication date, last-update date or pinned together-sandbox package version. The python:3.12-slim image is an example runtime choice, not an SDK version. The page recommends together-sandbox for new integrations, but subsequent availability and compatibility changes are unknown.

actions

Request organization access through [https://www.together.ai/contact-sales] and obtain pricing and relevant service terms. Choose a supported SDK runtime or the CLI, then use the documented snapshot-and-command example as a starting point. Configure a time limit or explicit termination, and decide whether filesystem state must survive termination. Before adopting it for an agent workload, verify the required isolation, concurrency, latency and failure behavior; these properties remain unassessed.

Evidence for this report

selected-page.txtselected · checked 2026-11-15