Skip to main content

Core Concepts

This page explains the fundamental building blocks of the Caged platform.
New to Caged? Start with the Quickstart to create your first sandbox, then come back here to understand the concepts in depth.

Sandboxes

A sandbox is an isolated Linux environment where an AI agent does its work. Each sandbox is:
  • A dedicated Firecracker microVM (production) or Docker container (local dev)
  • Has its own kernel, filesystem, and network namespace
  • Runs a single agent session at a time
  • Billed per-second of compute time

Sandbox Lifecycle

Idle Timeout

Sandboxes auto-sleep after a period of inactivity (default: 15 minutes). Configure this in .caged.yaml:

Sessions

A session is one agent interaction with a sandbox. It captures:
  • Start/end time and duration
  • Agent type (Claude Code, Cursor, Aider, etc.)
  • Total tokens in/out
  • LLM cost + compute cost
  • Trust score
  • All events (commands, file changes, LLM calls)
Sessions are created when an agent connects and end when it disconnects.

Trust Scores

Every session gets a trust score (0–100) based on agent behavior:

What Affects Trust

Trust scores are stored per-session and aggregated per-sandbox.

Budget Guards

Set a maximum spend per sandbox to prevent runaway costs:
When a sandbox reaches its budget:
  1. Warning alert at 80%
  2. Critical alert at 95%
  3. Sandbox is automatically destroyed at 100%

Snapshots

A snapshot is a point-in-time capture of a sandbox’s filesystem, stored as a compressed archive.
  • Manual snapshots — create anytime via CLI or dashboard
  • Auto-snapshots — created automatically when a sandbox is paused
  • Restore — restore a snapshot into any sandbox
  • Fork — create a new sandbox from a snapshot
  • Download — export as .tar.gz
Limits: 20 snapshots per sandbox, 10 GB total per account.

Preview URLs

When an agent starts a web server inside a sandbox, Caged automatically detects the listening port and generates a public preview URL:
  • Auto-detected via /proc/net/tcp scanning
  • Optional password protection
  • Rate-limited (100 req/min)
  • HTTPS with wildcard cert

Network Modes

Control what a sandbox can access:

Config-as-Code

A .caged.yaml file in your repo root defines reproducible sandbox settings. See the full guide.