AI that runs the code it writes
My product runs code nobody on my team reviewed, written by an LLM or uploaded by a customer.
My stack for this
- 01Cloudflare Sandbox
The default: a container per session with a ready-made toolkit, billed on active CPU. About a quarter of the price for short bursts.
- 02Lambda MicroVMs
When the code must run in Australia, reach a private VPC, use more than 4 vCPU, or keep its processes through long sessions.
Don't
- AWS Lambda
Not for code nobody reviewed: it runs with the function's role and environment variables, and its /tmp survives into the next invocation.
Instead: Cloudflare Sandbox or Lambda MicroVMs
Questions that change the answer
Who wrote the code? If your team reviewed it, you don't need a sandbox.
Must the code or the data stay in Australia, or reach a private VPC? Then it's Lambda MicroVMs.
How long is a session? Seconds to minutes points to Cloudflare Sandbox; hours with a running dev server to Lambda MicroVMs.
The picks, in brief
What each one is, my verdict, and what it costs. Every name opens the full entry: when to use it and when not, the gotchas with their fixes, provisioning and alternatives.
Where an AI product runs code nobody reviewed: an isolated container per session, started and driven from a Worker, billed only for the CPU it actually uses.
Pricing: On Workers Paid ($5 a month): active CPU at $0.000020 per vCPU-second, with 375 vCPU-minutes, 25 GiB-hours of memory and 200 GB-hours of disk included each month. Egress from Oceania $0.05/GB after 500 GB.
A Firecracker VM per session for code nobody reviewed, inside your AWS account, in Sydney, with VPC access. It suspends with its memory intact and resumes on the next request.
Pricing: Baseline compute billed per second while the MicroVM runs, from 1 vCPU and 2 GB (about $0.126 an hour at US East Arm rates: $0.0000276944 per vCPU-second and $0.0000036667 per GB-second). Resources above the baseline, up to 4×, billed only while used. Suspended: no compute, only snapshots ($0.0038 per GB written, $0.00155 per GB read, $0.08 per GB-month stored). Sydney rates not checked.
Where they sit
The layers of the stack this job touches, with every tool named on this page.
Compute
Where business logic runs.
Want this stack in your AWS account?
Cloudless Labs is a Sydney consultancy. We migrate on-premises systems to AWS, build serverless apps on this stack, and coach teams to ship with Claude Code and Codex.
Talk to us