Vivarium
June 19, 2026 ยท View on GitHub
An AI agent that lives inside a microsandbox microVM alongside your app. It has full access to the filesystem, the running process, and a browser โ write code, run it, screenshot it, and auto-save to git. You talk to it from your phone; it builds while you do anything else.
How it works
You (phone): "Build me a tip calculator"
Vivarium: Done! Here's a screenshot:
๐ธ [screenshot of running app]
Live at :3000, pushed to git.
You: "Make the split stepper bigger"
Vivarium: Updated โ bumped hit targets to 48px.
๐ธ [screenshot]
The agent lives with your app โ same VM, same filesystem, same network. It doesn't remote in; it's already there.
Architecture
You (chat) โโโ vivarium-hub (message broker) โโโ WebSocket โโโ Vivarium (this repo)
โ
โโโ Claude Agent SDK
โโโ /workspace (git repo + your app)
โโโ Chromium (screenshots)
โโโ App running on :3000
The vivarium connects outbound to the hub via WebSocket โ no port opening or firewall config needed. Your API key is never sent to the hub โ it stays in your microVM and goes directly to Anthropic.
Quick start
Prerequisites
- An Anthropic API key
- A hub account (hosted at app.vivarium.run, or self-host)
One-command install
curl -fsSL https://vivarium.run/install | bash -s -- --token <TOKEN>
This installs the @vivarium/cli (viv command), which uses microsandbox to run the agent in a lightweight microVM.
Environment variables
| Variable | Required | Description |
|---|---|---|
ANTHROPIC_API_KEY | โ | Your Anthropic API key |
HUB_URL | โ | WebSocket URL of your hub (e.g. wss://hub.example.com/ws) |
HUB_TOKEN | โ | JWT token from the hub |
VIVARIUM_NAME | Name for this vivarium (default: my-vivarium) | |
MAX_TURNS | Max agent turns per message (default: 30) | |
MODEL | Claude model (default: claude-sonnet-4-5) |
What's inside
- Agent runner (
src/agent/runner.ts) โ drives Claude via the Agent SDK, manages conversation turns - Tools (
src/agent/tools.ts) โ screenshot, app-restart, and other capabilities - WebSocket client (
src/ws/client.ts) โ connects to the hub, handles reconnection - Skills (
skills/) โ persistent instructions that teach the agent how to serve apps, take screenshots, manage git, etc. - Auto-save โ commits to git every 15 minutes so nothing is lost
Development
npm install
npm run build
npm test
npm run dev # needs ANTHROPIC_API_KEY, HUB_URL, HUB_TOKEN
Related
- vivarium-hub โ message broker + web console
- vivarium-cli โ the
vivCLI for managing sandboxes - vivarium.run โ landing page & waitlist
License
MIT