1
Make a key for CI
In the dashboard, create a key with the Create and use preset and a 30 or 90 day expiry. It can create, use and delete sandboxes, and nothing else. See CI and API keys.
2
Store it as a secret
Expose it as
E2B_API_KEY with E2B_DOMAIN=compute.anonalabs.com. The stock e2b SDK works as is.3
Create, run, kill
Create a sandbox per job, copy the repository in, run the tests, and kill the sandbox in a step that always runs. The CLI’s
exec and run exit with the remote command’s exit code, so a failing test fails the job.