---
title: "Agents in the Sandbox"
description: "Railway sandboxes now ship Claude Code, Codex, OpenCode and Pi in the default image and can join an environment's private network, which lets agents test against real Postgres, Redis and internal services."
url: "https://swe.quest/articles/agents-in-the-sandbox-6c4d7e3dae7cde47"
canonical: "https://blog.railway.com/p/agents-in-the-sandbox"
source: "Railway"
published: "2026-06-24"
difficulty: "medium"
kind: "How-to"
reading_minutes: 9
tags: ["ai-agents","sandboxing","developer-tools","typescript"]
---

# Agents in the Sandbox

A post on [Railway](https://swe.quest/sources/railway.md), published 2026-06-24, 9 min read, How-to. Original: [https://blog.railway.com/p/agents-in-the-sandbox](https://blog.railway.com/p/agents-in-the-sandbox)

## Summary

Railway sandboxes now ship Claude Code, Codex, OpenCode and Pi in the default image and can join an environment's private network, which lets agents test against real Postgres, Redis and internal services. The suggested workflow builds a template, configures a sandbox, takes a disk checkpoint, then creates or forks sandboxes from it so parallel agents start from a prepared workspace. Templates are cached builds from shell instructions, checkpoints are server-side disk snapshots that outlive the source sandbox, and forks clone a running sandbox's files but not its processes. TypeScript SDK and CLI examples cover detached agent sessions you can reattach to, port forwarding and a four-agent repo review app.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [TypeScript](https://swe.quest/tags/typescript.md) (Languages)

## Prerequisites

- TypeScript basics ([easy posts on TypeScript](https://swe.quest/tags/typescript.md?difficulty=easy))
- CLI usage ([easy posts on Developer tools](https://swe.quest/tags/developer-tools.md?difficulty=easy))
- coding agents ([easy posts on AI agents](https://swe.quest/tags/ai-agents.md?difficulty=easy))

## Keywords

Railway, Claude Code, Codex, OpenCode, Pi, Railway CLI, mise

## Related posts

- [Running AI agents in GitHub Actions with Docker Sandboxes](https://swe.quest/articles/running-ai-agents-in-github-actions-with-docker-sandboxes-9cf9181798d75585.md): Docker · 2026-08-21 · Medium · 7 min read · AI agents, Sandboxing & isolation, CI/CD, Virtualization, AI for coding
  GitHub Agentic Workflows (gh-aw 0.82.9) supports Docker Sandboxes (sbx) as an agent runtime, so a CI coding agent gets root, sudo and unrestricted shell inside a disposable microVM with its own kernel and private Docker daemon.
- [Agent Swarms on Sprites](https://swe.quest/articles/agent-swarms-on-sprites-839304324464381c.md): Fly.io · 2026-02-09 · Medium · 3 min read · AI agents, Sandboxing & isolation, AI for coding
  Running each coding agent in a swarm on its own Sprite (a Fly.io sandboxed machine) avoids the shared-filesystem, conflicting-dependency and blast-radius problems of co-located agents.
- [Where should your code live in a Docker Sandbox?](https://swe.quest/articles/where-should-your-code-live-in-a-docker-sandbox-22cf6de6c5be995d.md): Docker · 2026-11-02 · Medium · 5 min read · AI agents, Sandboxing & isolation, Version control, Developer productivity, Containers
  Docker's sbx sandboxes for coding agents support three ways to place a repository, and each changes how the human participates.
- [Building AI Teams: How Docker Sandboxes and Docker Agent Transform Development](https://swe.quest/articles/building-ai-teams-how-docker-sandboxes-and-docker-agent-transform-development-50a60f5e32d42807.md): Docker · 2026-03-11 · Medium · 9 min read · AI agents, Sandboxing & isolation, Containers, AI for coding, Virtualization
  Docker Agent defines teams of specialized AI agents in YAML, where a root "product manager" agent delegates to designer, engineer, QA and fixer sub-agents, each with its own model, instructions and toolsets (filesystem, shell, think, todo, memory, MCP).
- [Building with Modal and the OpenAI Agents SDK](https://swe.quest/articles/building-with-modal-and-the-openai-agents-sdk-c24777075f600dcf.md): Modal · 2026-04-15 · Medium · 12 min read · AI agents, Sandboxing & isolation, LLMs, Python, Cloud platforms
  A custom agent harness built on the OpenAI Agents SDK runs coding agents inside Modal Sandboxes, optionally with GPUs, rather than on the host, where an unsandboxed exec tool can be abused by malicious prompts.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
