Package vetting

Before you add a third-party package, have agents read it for intentionally harmful code: install scripts that phone home, obfuscated payloads, credential theft. The package is never installed, built or run.

warning

Treat the package as hostile until vetted. Download its source without installing it, analyze it statically in its own workspace, and tell every agent not to execute, install or build anything.

Get the source without running it

mkdir -p ~/vetting && cd ~/vetting
npm pack [email protected] --ignore-scripts && tar xzf left-pad-ng-2.1.0.tgz
beswarm workspace add --name vet-leftpad --path ~/vetting/package

For Python, pip download --no-deps --no-binary :all: fetches the source distribution without installing it.

Split by concern

Start these from a terminal in the vet-leftpad workspace:

beswarm agent start --name install-hooks --agent claude --group vet \
  --prompt "Static analysis only: don't run, install or build anything. Read package.json lifecycle scripts (preinstall, install, postinstall, prepare) and anything they call. Report any network access, file writes outside the package, or spawned processes. file:line for each. Write to reports/install-hooks.md."
beswarm agent start --name obfuscation --agent codex --group vet \
  --prompt "Static analysis only. Look for obfuscated or encoded code: long base64 or hex strings, eval/Function on built strings, minified code in a package that ships source otherwise. Decode what you can without executing it. Write to reports/obfuscation.md."
beswarm agent start --name exfil --agent gemini --group vet \
  --prompt "Static analysis only. Look for access to credentials, env vars, SSH keys, browser or wallet data, and for any network calls. Is each justified by what the package claims to do? Write to reports/exfil.md."

Verdict

beswarm agent start --name verdict --agent claude --group vet \
  --prompt "Read reports/*.md. Give a verdict: safe to adopt, adopt with caution, or reject. Justify it with the findings, and list what you could not check. Write to reports/verdict.md." \
  --wait --timeout 1200

Also compare the package source with the repository it claims to come from. A published package that differs from its repo is a red flag on its own.

When you're done, beswarm agent close --group vet and delete the downloaded files.