The biggest challenge was achieving this without the typical latency associated with spinning up new sandboxes. We eventually landed on using quickjs-emscripten, which utilizes a WASM-compiled QuickJS engine to execute JS scripts in a secure, isolated environment.
By going this route, we managed to achieve 0.025s cold starts for new sandboxes. This allows us to offer a free hosting and a hot reload experience where you can host and call tools instantly without worrying about the infrastructure overhead.