Run tests or a one-off command
Short answer: Use airgap_sandbox_run for any ad-hoc test run, build, bug reproduction, or script you do not want executing on your laptop. airgap uploads only the files you pass into /workspace inside a fresh Linux microVM on GMI AgentBox v2, runs the command, scrubs secrets from stdout and stderr, and deletes the sandbox on exit.
use airgap and run the testsreproduce issue 88 in a sandbox with node 20Auto-detected runtime images
When you omit the image parameter, airgap picks a Debian Bookworm container image based on the root files in your snapshot. On images that ship Corepack, setup runs corepack enable automatically so pnpm and yarn work without global installs, and sets TMPDIR=/root/tmp so large builds do not fill the 1 GiB /tmp tmpfs.
| Repo root contains | Default image | Best for |
|---|---|---|
Cargo.toml | docker.io/library/rust:1-bookworm | Rust crates, cargo check, cargo test, clippy |
package.json | docker.io/library/node:20-bookworm | Node.js, TypeScript, npm, pnpm, yarn, Vitest, Jest |
| Anything else | docker.io/library/python:3.12-bookworm | Python scripts, pytest, shell tools, data parsing |
Direct MCP tool call
{
"tool": "airgap_sandbox_run",
"arguments": {
"command": "npm ci --ignore-scripts && npm test",
"files": {
"package.json": "{ \"name\": \"demo\", \"scripts\": { \"test\": \"node --test\" } }",
"index.test.js": "import test from 'node:test'; import assert from 'node:assert'; test('ok', () => assert.equal(1+1, 2));"
},
"timeout_secs": 120
}
}Sizing, timeouts, and exit codes
| Setting / Signal | Default or meaning | How to adjust |
|---|---|---|
| Instance type | gmi.sandbox.medium (2 vCPU, 4 GiB) | Set GMI_AGENTBOX_INSTANCE_TYPE to small (1 vCPU, 2 GiB) or large (4 vCPU, 8 GiB) |
| Command timeout | 120 s (range 1..1800 s) | Pass timeout_secs or update defaults with airgap_configure |
| Template caching | Kept as airgap-{image}-{instance_type} | First run builds the template; later runs reuse it and start much faster |
| Exit code 137 | Out-of-memory kill (SIGKILL) | Switch to gmi.sandbox.large or narrow the test target |
| Exit code 124 / 130 | Timed out / cancelled | Never marked passed; sandbox cleanup still runs and is awaited |
Credentials and concurrency: airgap_sandbox_run needs only GMI_AGENTBOX_API_KEY. Up to 4 sandbox jobs run in parallel per server process. For why a remote microVM isolates better than local Docker, read Docker vs. remote microVMs.