A code sandbox for AI agents: a fresh computer for each task
Obsession gives your AI agents a code sandbox, a computer in the cloud where they run code, install packages and work with files. It starts when a task needs it and stops when the task ends.
import { Obsession } from "obsession"const obsession = new Obsession({ apiKey: process.env.OBSESSION_API_KEY })// A computer for this task onlyconst sandbox = await obsession.sandboxes.create()// Run the code your agent wroteawait sandbox.run("pip install pandas")await sandbox.run("python report.py")// When the task ends, the sandbox stops and so does the billA computer for each agent, for the files it finds.
An agent downloads a statement, a spreadsheet or a PDF and needs to work on it. The sandbox runs the code, sends back the result and keeps the output in the log.
- 01A report arrives by email
- 02The agent runs code on it
- 03It checks every row
- 04The answer goes to your system
- 06:00email.receivedDaily settlement report · settlements.csv attached
- 06:00sandbox.finished1,204 rows checked in 1.8 s · 3 don’t match the bank
- 06:01email.sentThe 3 mismatches, row by row, to finance@fenwick.example
- 06:01webhookMismatch list sent to your accounting system
1,204 rows checked in 1.8 seconds
Your agent runs its own code, away from your systems.
A full Linux computer for each task, gone when the task is done.
Starts when needed
It starts when your agent calls for one, and stops when the task ends.
Any language
Python and Node are ready to use, with a shell for anything else on Linux.
Install what it needs
pip, npm and apt work as they do on your own machine.
Files in and out
Upload a spreadsheet, run code on it, and download the chart or report it makes.
Sealed off
Each sandbox is set apart from the others and from your systems, so your agent’s code touches only its sandbox.
The internet when you allow it
Turn network access on to fetch data or call an API, or keep it offline.
Every event reaches your webhook, your code or your agent.
Each event is saved in your event log, then sent where you listen.
The events it sends
sandbox.finished- A sandbox finishes its task, with its output.
Where they reach you
One signed webhook
Subscribe once for every piece and blueprint. Each event is signed.
Your event log, by cursor
Read every event since the last one you saw.
Your own agent, over MCP
Events as tools, in Claude Code, Cursor or any MCP client.
Your handler, on our runtime
Your code runs about 50 ms after the event lands. No server to run.
A live stream while you build
Every event, forwarded to your laptop.
Zapier, Make and n8n
Each event starts a Zap, scenario or workflow.
If your server is down, events retry for 27 hours, and any event can be replayed.
See the code for each channelA sandbox is billed only while it works.
Pay for the processor time and memory it uses.
See every price- Sandbox
- $0.12 an active vCPU hour
- Billed only while the CPU works, so a sandbox waiting on a task costs almost nothing.
- Sandbox memory
- $0.015 a GiB hour
The sandbox does the work the other pieces bring in.
One API key and one bill cover every piece.
- EmailWork through an inbox’s attachments, such as invoices and spreadsheets.
- PersonasA persona starts a sandbox only for a task that runs code.
- BrowserClean and check the files the browser downloads.
- PhoneTurn call transcripts into summaries or tickets.
- MessagingReply on WhatsApp or Slack with a chart your code made.
Run the code your agent writes, set apart from everything else.
A computer in the cloud, set apart from your systems, where an agent runs the code it writes. It installs packages, reads and writes files and returns the results.
RL environments for AI agentsAny language that runs on Linux. Python and Node are ready to use, and your agent can install anything else with pip, npm or apt.
The sandbox stops and billing stops with it. Download the files you want to keep before it stops.
Only if you allow it. Turn network access on to fetch data or call an API, or leave it off.
Sandbox: $0.12 an active vCPU hour.