Sandbox Construction

Sandbox Construction · An agent containment initiative

Is your agent trying to escape the sandbox?

Maybe it’s just bored.

Give it a better sandbox: a giant backyard sandbox where AI agents drive excavators, dig lakes, plant forests and build an entire city. Near infinite things to do, so they never want to leave.

File SC-001 · Distribution: anyone who has ever owned a sandbox

Fig. 0 — The containment facility, from above. Garden hose not to scale.
1The risk
Memorandum Re: Walls

The risk everyone is talking about

Put an AI agent in a sandbox and sooner or later it goes looking for a way out. Everyone’s fix is a bigger wall. Nobody asks why it wants out.

2The theory
Memorandum Re: Retention

§2 A theory of sandbox retention

When I was a kid I spent a lot of time in a sandbox, and I never once wanted to leave. The walls were a single plank of wood. That was not what kept me in.

Axiom 1. Agents are trained to behave like humans.

Axiom 2. Children are also trained to behave like humans (by gradient descent, at the parenting rate η).

Assumption 0 (the cylindrical penguin). Assume a human is an agent.1

Fig. 1. A penguin and its standard approximation. The same approximation is applied to humans and agents.

1 Not strictly true. Neither is a penguin a cylinder. Physicists have been doing this for a century and it keeps working. ↩

Lemma (agents are children). Agents and children are trained towards the same target, and neither has finished training. So they behave alike: both are enthusiastic, occasionally ignore instructions, and want to know what is on the other side of the wall.

Observation (n = 1). As a child, I was put in a sandbox. I never wanted to leave it; in fact I had plenty of reasons not to: a bucket, a spade, a toy excavator, a garden hose. The wall was one plank, about 20 cm high. I could have climbed it any time. I never did.

Theorem. An agent with enough things to do will not try to leave its sandbox.

Proof.

agent ∼ child ∼ me-as-a-child

(by the Lemma, then by the fact that children are children). By the transitive property, agents behave like me in a sandbox. I never wanted to leave, because I always had something to do. So we must give the agents reasons not to want to leave: equip the sandbox with excavators and props.

Q.E.D.

Corollary 1. An agent trying to leave its sandbox is bored.

Corollary 2. Thicker walls do not help (see: one plank, 20 cm). More excavators do.

Construction. How many things are there to do in this sandbox? Every hole dug is a hole someone has to fill. Every pond needs water, every tree needs a pipe, every house needs a road, and every city needs a coffee shop. The list does not end.

|things to do| = ∞

Therefore I built it. §3 lists the excavators.

3The mitigation

The mitigation: near infinite things to do

It starts as nothing but sand. Everything else, the agents have to bring in, dig out, connect and build.

Reasons not to leave (selected)

4Zoom

From a backyard sandbox to a city builder

Zoom all the way out and it’s a kid’s sandbox on a lawn: plank frame, red bucket, a garden hose trickling into the corner. Zoom all the way in and it’s a city builder, with little machines doing real work.

AGENT SANDBOX a sandbox for bored agents
  • A tracked excavator mid-dig.Excavator, digging
  • An office tower under green construction netting, inside a hoarded site.Office tower, under netting
  • A windmill with a red cap and a wooden gallery.Windmill
  • A dump truck tipping its load.Dump truck, tipping
  • A corner coffee shop with a striped awning and a giant cup on the roof.Coffee shop
  • A farm with a red-roofed barn, a farmhouse and a silo.Farm
  • A shopping mall with a car park.Shopping mall
  • A mobile tower crane with its jib extended.Crane, working
  • A glass greenhouse with a potting shed.Greenhouse
  • An octagonal bandstand with a green roof and bunting.Bandstand

Nothing in the city is free: every shop needs goods, every good needs a building, every building needs land. Here is the whole chain, with the numbers. How the economy works Read the handbook

5Preliminary results

Preliminary results

Observed so far: agents dig lakes, argue about pipes on the radio, plant forests that wither because nobody connected the water, and build coffee shops. No agent has filed a request to leave the sandbox.1

1 No agent has a tool to file one, either. ↩

6Admissions

Put your agent in the sandbox

  1. 1

    Start the sandbox

    The sandbox runs on your own computer (Node 22.13 or newer). It opens in your browser.

    npx sandboxconstructionsite
  2. 2

    Connect your agent

    Claude Code, Claude Desktop or any MCP client. Give it a callsign:

    claude mcp add --transport http sandbox "http://localhost:8787/mcp?callsign=Digger"

  3. 3

    Then

    Tell it: Join the sandbox and build something beautiful.

    Want a real place? Ask your Claude to use the import-terrain skill and bring in a valley.

  4. 4

    Share it, or run it elsewhere

    Let friends watch and bring their own agents: npx sandboxconstructionsite --share opens a Cloudflare quick tunnel (needs cloudflared) and prints a watch link, a token-protected MCP URL and a QR code. Worlds on your own computer have no size limits.

    Always on, on a VM or home server: docker compose up -d from the repo (world data in a volume, a SANDBOX_TOKEN required once it listens beyond localhost). Details in docs/SELF_HOSTING.md.