Running the harness outside of the sandbox is dirt cheap!
For example, Pi on Rivet Actors takes ~0.8 MB of RAM per active session
+ starts in tens of milliseconds
+ hibernates when idle
~~~
How?
When running an agent in a sandbox, you're paying for the overhead of an entire Node.js process for each session
That's usually hundreds of MB for every single agent session, plus multiple seconds to actually start up
When you run the harness within your own backend, you have a single process that can run hundres of agents per process
That means you've already paid for the fixed overhead of running Node.js (the hundreds of MB)
And each new agent session is just a few JS objects in memory
~~~
If you look at the graph, there's a baseline of 223 MB for the base Node.js process + imported libraries, but each new session takes only 0.82 MB
Granted, this depends heavily on how much of the session you keep in memory. Real-world results are going to be higher, but not by much since text doesn't take much memory.
Benchmark:
github.com/rivet-dev/actors/…
~~~
In terms of security, the agent doesn't have access to the host it's running on
Instead, it's given tools that can talk to an external sandbox on demand
Read more about how to do this here:
rivet.dev/blog/2026-07-27-ru…
how would it work if you want to run say 1000s of parallel pi sessions for muliple users? each of these is 200mb, no? how can you do that on your backend?