Skip to main content

Install Safe Chain

1

Run the installer

curl -fsSL https://github.com/AikidoSec/safe-chain/releases/latest/download/install-safe-chain.sh | sh
2

Restart your terminal

You must restart your terminal after installation. The installer adds shell aliases for npm, npx, yarn, pnpm, pnpx, bun, bunx, pip, pip3, uv, poetry, and pipx to your startup file. These aliases are not active until a new terminal session is started.
3

Verify the installation

Run the verification command with any supported package manager:
npm safe-chain-verify
You should see: OK: Safe-chain works!

Pin to a specific version

To install a specific version instead of the latest, replace latest with the version number in the URL. Version pinning is available from version 1.3.2 onwards.
curl -fsSL https://github.com/AikidoSec/safe-chain/releases/download/x.x.x/install-safe-chain.sh | sh
All available versions are listed on the GitHub releases page.

Test malware blocking

You can optionally confirm that Safe Chain is actively blocking malicious packages by trying to install a test package. Safe Chain will intercept the request and report the package as malware.
npm install safe-chain-test

Check the installed version

safe-chain --version

Uninstall Safe Chain

curl -fsSL https://github.com/AikidoSec/safe-chain/releases/latest/download/uninstall-safe-chain.sh | sh
Restart your terminal after uninstalling to ensure all shell aliases are removed.

Build docs developers (and LLMs) love