How do you run untrusted agents of your users?
12 providers compared, only 1 met all 5 criteria.
I spent the last week trying to solve this for Delegate OS, because without it I can't actually have users.
I'm biased towards running things on my own VPS, so my first idea was to run the code my users' agents write in Docker under gVisor. gVisor is pretty cool: a reimplementation of the Linux syscalls in Go, so no syscall goes straight to the host kernel.
But gVisor doesn't work with rootless Docker (open issue since February), and without rootless, whatever starts the containers has root on my server. That ruled it out.
After more research: everyone I found who runs strangers' code as a service uses a VM per job or per tenant. So the criteria became:
1. A VM as the separation, at least per org
2. I can set simple network access rules. Like the workers cannot talk to the internet, only to my own API.
3. If it's not running, I don't have to pay, and it wakes up on the next request
4. Runs my own container image
5. Low minimum fee, especially in the beginning
What I looked at, and why not:
Modal: appealing, but an idle sandbox ends and nothing wakes it on a request, I'd create a new one every time
Fly Sprites: would be the cheapest, but doesn't take a container image
E2B: free up to 10 sandboxes at once, then $150 a month
Blaxel: the network filter is still in preview
Daytona: network allow lists only on a higher tier
Cloud Run and Lambda: closing the network needs a VPC and a NAT gateway, which only makes sense if I move everything to GCP or AWS
The top 2, which I actually tested:
Fly Machines wakes from suspend in 0.3 s. But a machine can reach the whole internet by default, and the egress rules can't name a destination. I got it closed with a private network per user, routes removed as root, and my own gateway, three things I would have to keep right forever.
Cloudflare Containers takes 1.2 s, always a fresh start. But "no internet except my API" is one setting outside the container, and it held against root inside.
What 100 orgs would cost me on Cloudflare: about $50 a month at the most.
Assumptions: every org runs about 30 minutes a day on 1/4 vCPU and 1 GiB with the CPU busy the whole time. A sleeping VM costs nothing, and CPU is only billed while it works, so the real number should land closer to $25.
So all things considered, I went with Cloudflare, the best all-around fit for early growth.
