Agent Sandboxesagentsandboxes.org
Sandbox profile · Hosted platform

GitHub Codespaces

Answer in brief

GitHub's cloud development environments: a Dev Container running on a freshly built, dedicated VM per codespace, created from the web, gh CLI or REST API, billed per core-hour with a free monthly quota. A solid VM-isolated workspace for humans and their assistants on GitHub, but its lifecycle and API are not designed for autonomous agent fleets.

By the Agent Sandboxes editors · Updated

Overview

GitHub Codespaces is a cloud development environment attached to a repository or template. Each codespace is a Docker container built from the repo's devcontainer.json (or a default Ubuntu image) that runs on "its own newly-built virtual machine" with its own virtual network, so isolation is at the VM level. You open it in the browser, VS Code or over SSH, and create or control it from the web UI, the gh codespace CLI (create, ssh, stop, delete, ports, cp) or the REST API (POST /repos/{owner}/{repo}/codespaces, start, stop, delete). Machine types run from 2 cores / 8 GB / 32 GB to 32 cores / 128 GB / 128 GB.

Lifecycle is designed around humans: a codespace stops after 30 minutes idle by default, has a hard 12-hour maximum lifetime per session, and stopped codespaces are retained for 30 days before deletion. Saved files persist across stops. Billing is per core-hour ($0.18/hour for 2 cores) plus $0.07 per GB-month of storage, with free monthly quotas for personal accounts. There is no snapshot or fork API, no GPU and no documented startup figure. GitHub's Copilot coding agent uses separate infrastructure and is not covered here.

Notable

  • Personal GitHub Free accounts include 120 core-hours and 15 GB-month of Codespaces usage per month; Pro includes 180 core-hours and 20 GB-month.
  • Hard limits: 12-hour maximum active lifetime, 30-minute default idle timeout, 30-day default retention.
  • Compute is billed per core at $0.09 per core-hour (2-core $0.18/hour up to 32-core $2.88/hour).

GitHub Codespaces specifications

AttributeDetails
IsolationDocker container on a dedicated virtual machine — "Each codespace is hosted on its own newly-built virtual machine (VM)" with its own virtual network; two codespaces never share a VM
DeploymentHosted platform
Open sourceNo
SDKs and interfacesCLI, REST API
Cold start (vendor claim)Not documented
Max session lengthStops after 30 minutes of inactivity by default (customisable); a fixed maximum lifetime of 12 hours even while in use; stopped codespaces are deleted after 30 days of inactivity by default (customisable)
PersistenceStopping preserves saved changes and terminal history; /workspaces survives rebuilds; full rebuilds clear everything outside /workspaces; retained for 30 days by default
GPUNo — machine types listed on the billing page are 2- to 32-core CPU machines only
NetworkingFirewalls block inbound internet connections and inter-codespace traffic; forwarded ports default to private (authenticated) and can be made organisation-visible or public
Pricing2-core $0.18/hour, 4-core $0.36/hour, 8-core $0.72/hour, 16-core $1.44/hour, 32-core $2.88/hour; storage $0.07 per GB-month; prebuilds consume Actions compute and storage
Free tierPersonal accounts: 120 core-hours and 15 GB-month per month on GitHub Free, 180 core-hours and 20 GB-month on GitHub Pro; organisations and enterprises have no included quota
ComplianceNot documented
RegionsSet automatically from your location or chosen manually in user settings; the region list is shown in the settings dropdown rather than documented

Facts from GitHub Codespaces’s public documentation, verified November 9, 2026. Performance numbers are vendor claims.

Strengths and trade-offs

Strengths

  • You want repo-linked Dev Container workspaces on dedicated VMs with a REST API and CLI
  • You need per-user isolation, private port forwarding and GitHub secrets without running infrastructure
  • You are a personal account that can use the free monthly core-hour quota

Trade-offs

  • 12-hour maximum session and human-oriented idle/retention policies rather than an agent lifecycle
  • No snapshot, fork or pause-with-memory APIs; no GPU machine types
  • Cannot run on your own cloud; organisations pay for every core-hour with no included quota

Good fit for: Developer-driven workspaces tied to GitHub repositories, where an agent assists a human inside a Dev Container.

Use cases GitHub Codespaces fits

  • Coding agents: Dev Container workspaces tied to GitHub repositories, one VM per codespace with prebuilds and port forwarding, where an agent works alongside a developer.

How GitHub Codespaces compares

SandboxIsolationOpen sourceSelf-host / BYOCCold start (vendor)Max sessionSnapshots / pauseGPUSDKs
GitHub CodespacesDedicated VM per codespaceNoNo / NoNot documented12 h, 30 min idleNo / YesNoCLI, REST API
Ona (formerly Gitpod)Dedicated cloud VMNoNo / YesNot documentedNot documentedNot documented / YesYesPython, JavaScript/TypeScript, Go, CLI, REST API
CoderTemplate-defined (VM/pod/container)YesYes / NoNot documentedNot documentedNot documented / YesNot documentedCLI, REST API, MCP server
Together Code SandboxMicroVMNoNo / Not documented0.5 s (snapshot)Until terminatedYes / YesNot documentedPython, TypeScript
DaytonaContainers or VMsNoNot documented / Yes<90 msUnlimitedYes / YesYesPython, TypeScript, Ruby, Go, Java
Control Plane SandboxesContainer (runtime not named)NoYes / Yes60-90 sNot documentedNot documented / YesNot documentedCLI

See all GitHub Codespaces alternatives →

Frequently asked questions

What is GitHub Codespaces?
GitHub's cloud development environments: a Dev Container running on a freshly built, dedicated VM per codespace, created from the web, gh CLI or REST API, billed per core-hour with a free monthly quota. A solid VM-isolated workspace for humans and their assistants on GitHub, but its lifecycle and API are not designed for autonomous agent fleets.
How does GitHub Codespaces isolate code?
GitHub Codespaces documents its isolation as: Docker container on a dedicated virtual machine — "Each codespace is hosted on its own newly-built virtual machine (VM)" with its own virtual network; two codespaces never share a VM.
Is GitHub Codespaces open source?
No, GitHub Codespaces is not open source.
How much does GitHub Codespaces cost?
2-core $0.18/hour, 4-core $0.36/hour, 8-core $0.72/hour, 16-core $1.44/hour, 32-core $2.88/hour; storage $0.07 per GB-month; prebuilds consume Actions compute and storage Check the official pricing page for current rates.
What are the alternatives to GitHub Codespaces?

Sources

  1. docs.github.com/en/codespaces/about-codespaces/what-are-codespaces
  2. docs.github.com/en/codespaces/about-codespaces/the-codespace-lifecycle
  3. docs.github.com/en/codespaces/reference/security-in-github-codespaces
  4. docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-codespaces/about-billing-for-github-codespaces
  5. docs.github.com/en/codespaces/setting-your-user-preferences/setting-your-default-region-for-github-codespaces
  6. docs.github.com/en/rest/codespaces/codespaces
  7. docs.github.com/en/codespaces/developing-in-a-codespace/using-github-codespaces-with-github-cli

Cite this page

Agent Sandboxes. (2026). GitHub Codespaces. agentsandboxes.org. Last reviewed November 9, 2026. https://agentsandboxes.org/sandboxes/github-codespaces/

Found an error or a missing sandbox? Submit a correction — every entry links to the sources it relies on.