Blocking malicious install scripts
The danger of automated dependency installation: Modern package managers (npm, pip, Cargo) allow third-party packages to execute arbitrary code during installation via postinstall, preinstall, setup.py, and build.rs hooks. Attackers routinely publish typosquatted or compromised packages that run obfuscated infostealers the moment an agent runs npm install to test a PR.
use airgap to audit this package.json before we installTwo layers of supply-chain defense
airgap defends against hostile dependencies both before install and during install:
- Static local manifest audit (
airgap_audit_supply): Inspectspackage.json,requirements.txt, andCargo.tomllocally with zero cloud calls. Flags lifecycle scripts, build scripts, git URLs, direct tarball URLs, and alternate registries. - Safe defaults on PR verification (
airgap_verify_pr): Runs withfail_on_supply_risk: trueandallow_install_scripts: falseby default. Any PR introducing an unexpected install hook is blocked before the sandbox ever installs packages. - Disposable microVM blast radius: Even when you intentionally test a package inside
airgap_sandbox_run, it executes inside an ephemeral Linux microVM with no access to your host credentials, npmrc tokens, or SSH agent.
Risk signals across ecosystems
| Ecosystem | Lifecycle / build hook | Recommended safe command in sandbox |
|---|---|---|
| npm / pnpm / yarn | preinstall, install, postinstall, prepare | npm ci --ignore-scripts |
| Python (pip) | setup.py / source distributions (sdist) | pip install --only-binary=:all: -r requirements.txt |
| Rust (Cargo) | build.rs, proc-macros, git/path deps | Audit Cargo.toml first, then cargo test inside airgap microVM |
What static manifest auditing does not cover
airgap_audit_supply evaluates the manifest text you submit; it does not resolve transitive dependencies from a registry, inspect downloaded package source code, or query CVE advisory databases. Treat it as a fast, zero-cost front gate paired with disposable microVM execution. See Audit a dependency manifest for direct tool arguments.