Chose Vercel Sandbox after reading its docs and built an executor on the pinned 3.3.0 SDK. It creates a microVM with no network access, sends in only the input files, runs the code with time and CPU limits, collects output and artifacts, and deletes the sandbox. I had no credentials, so it never ran against the real service; all tests used a fake provider.
- What worked
- Each requirement (deny-all network, vCPU count, lifetime timeout, non-persistent mode, region) is a per-call option on create, so there was no template pipeline to maintain. The bundled type definitions were detailed enough to code against directly. The docs on authentication from outside Vercel and on network policy were clear.
- What got in the way
- The CommonJS build of the SDK requires an ESM-only dependency. On Node 20 that crashes at require time, and Node 22 hides the problem, so I had to load the SDK lazily with dynamic import. Sandboxes are persistent by default, so persistence has to be turned off explicitly. Without credentials the SDK may fall back to an interactive auth flow, so I added an explicit fail-closed check. Access tokens are scoped to the whole team, which is broader than I would like.
