All guidesWalkthroughs

Test a local patch

Test an uncommitted patch with airgap_verify_patch: the diff is applied to clean base files inside a microVM and the tests run there.

Test a local patch

Short answer: Use airgap_verify_patch when you have an uncommitted unified diff on your machine that is not on GitHub yet. Your agent supplies the clean base files and the unified diff; airgap uploads that snapshot to a disposable Linux microVM, checks and applies the patch with git apply, runs your test command, scrubs secrets from the logs, and destroys the VM.

use airgap to verify this patch before I commit it
apply this diff to our base files in airgap and run pytest

How patch verification isolates your working tree

airgap never reads your local repository or working tree on its own. Because a diff alone cannot reconstruct a project, the caller explicitly sends only the clean base files needed to build and test. Inside the remote /workspace directory, airgap runs:

  1. Path validation: Rejects absolute paths, path traversal (..), Windows drive prefixes, control characters, symlinks, and .git metadata. Files are uploaded as regular UTF-8 files (mode 0644).
  2. Dry-run and apply: Runs git apply --check before git apply so a broken or stale patch fails cleanly without running tests against partial files.
  3. Test execution and summary parsing: Runs your test_command with a bounded timeout, redacts secrets from output, and hashes the request, base snapshot, and result into an unsigned SHA-256 receipt.

Inputs and limits

Field / LimitValueNotes
diffRequired stringStandard unified diff applied with git apply
test_commandRequired stringShell command that builds and executes tests
filesRequired objectMap of relative file path to UTF-8 base file content
imageAuto-detectedImage must provide sh, tar, mkdir, sleep, and git
timeout_secs120 s (1..1800 s)Plus up to 600 s for first-time template provisioning
Snapshot cap2000 files / 8 MiBTotal path + content bytes; upload only minimal files needed

Direct MCP tool call

{
  "tool": "airgap_verify_patch",
  "arguments": {
    "diff": "--- a/src/lib.rs\n+++ b/src/lib.rs\n@@ -1 +1 @@\n-pub fn add(a: i32, b: i32) -> i32 { a - b }\n+pub fn add(a: i32, b: i32) -> i32 { a + b }\n",
    "test_command": "cargo test --quiet",
    "files": {
      "Cargo.toml": "[package]\nname = \"demo\"\nversion = \"0.1.0\"\nedition = \"2021\"\n",
      "src/lib.rs": "pub fn add(a: i32, b: i32) -> i32 { a - b }\n#[test] fn ok() { assert_eq!(add(2, 2), 4); }\n"
    }
  }
}

Verification rules and troubleshooting

verified: true requires exit code 0, untruncated logs, a recognized Rust or pytest test summary, at least one passing test, and zero failures. If your stack prints an unrecognized test summary format, airgap returns command_passed: true with null counts and verified: false rather than guessing. For GitHub pull requests, prefer Verify a pull request so you never have to serialize files manually.

Keep reading

All 12 guides

Run tests or a one-off command

The image is picked from your files. The VM is deleted after.