This page is the shortest path from zero to a useful PkgSafe workflow.
curl -fsSL https://github.com/sairintechnologycom/pkgsafe/releases/latest/download/install.sh | bash
pkgsafe doctorPin a version or change the install directory with PKGSAFE_VERSION and
PKGSAFE_BIN_DIR. Full options: install.md.
# npm
pkgsafe scan-npm-package axios
# PyPI
pkgsafe scan-pypi-package requestsYou get a decision and the reasons:
- ALLOW — looks fine under current policy.
- WARN — review first (default mode still lets interactive installs proceed after confirm).
- BLOCK — do not install.
Machine-readable output:
pkgsafe scan-npm-package axios --json# npm lockfile
pkgsafe scan-lockfile ./package-lock.json
# Python (requirements, pyproject, poetry, uv, Pipfile)
pkgsafe scan-python-deps ./requirements.txt
# Preview ecosystems
pkgsafe scan-go-deps ./go.mod
pkgsafe scan-cargo-deps ./Cargo.lockExplain a decision in plain language:
pkgsafe explain axios
pkgsafe explain-pypi requestspkgsafe npm-install lodash
pkgsafe pip install requestsPkgSafe scans first, then runs the real package manager only when policy allows.
You can also put PkgSafe in front of normal commands (shell shims / interceptors). See install-interception.md.
Add --mode to any scan:
| Mode | Behavior |
|---|---|
audit |
Report only. Never blocks. |
warn |
Default. Warn on risk; block critical findings. |
block |
Block at or above the block score threshold. |
Without a file, PkgSafe uses a built-in default policy.
# Create / edit a project policy
mkdir -p .pkgsafe
cp default-policy.yaml .pkgsafe/policy.yaml # or start from policy edit
pkgsafe policy validate .pkgsafe/policy.yaml
# Use it
pkgsafe scan-lockfile ./package-lock.json --policy .pkgsafe/policy.yamlDetails: policy-guide.md.
- uses: sairintechnologycom/pkgsafe@v1.6.0
with:
mode: warn
fail-on: block
changed-only: trueFull Action docs: github-action.md.
Any CI runner: ci-cd.md.
{
"mcpServers": {
"pkgsafe": {
"command": "pkgsafe",
"args": ["mcp", "serve"]
}
}
}The agent should call validate_package_install (or related tools) before
installing. BLOCK means never install. WARN means ask a human.
Per-client guides: docs/integrations/.
# Once, while online
pkgsafe update-db --ecosystem all
# Later, no network
pkgsafe scan-npm-package axios --offlineAir-gapped machines: offline-intelligence-bundle.md.
- Default scans do not run package install scripts.
- Optional
--behavior heuristicruns scripts on the host (not a sandbox). - Optional
--behavior isolatedis Linux-only (bubblewrap). See behavior-analysis.md. - npm and PyPI are public beta. Go and Cargo are preview.
- If something looks wrong, see troubleshooting.md and feedback.md.
- Commands — full reference
- Known limitations — honest scope
- Docs index — everything else