Tip: on servers, don't run npm install as root, use --ignore-scripts for vendor SDKs, and alert when a new systemd unit or AI-agent framework shows up
- Build as an unprivileged user in CI and ship artifacts; don't install on production hosts.
- Set
ignore-scripts=truein the project or CI.npmrcand allow scripts only for packages that need them. - Flag dependencies that resolve to URLs or tarballs outside the registry; they can change without a new version.
- Alert on new system or user systemd units, on
loginctl enable-linger, and on hosts that start long-polling chat APIs like Telegram.
Sources: SafeDep: Malicious npm Package Turns Hermes Agent into a Backdoor (Nov 19, 2026)