Some things I'm doing now to reduce the risk of software supply chain attacks:
I run all package manager installs through Socket Firewall (sfw npm install ...), which blocks known malicious packages and warns on various other problems.
Claude Code sessions run as a separate user[1], and I plan to move them all the way to a VM[2] in the near future.
Unfortunately, this user does need access to a lot of API keys including a GitHub token, but I limit their scope to the extent I can.
The risk of prompt injection seems to be relatively low in modern Claudes, so I'm not that worried about it. I do use agent-sanitizer in my custom harness though.
Claude has instructions to immediately notify me if malicious packages get installed anyway.
Claude does various supply chain checks on every dependency update PR from Dependabot.
I also use sfw on my own user account, and have removed passwordless docker and libvirt access, although I think if a supply chain attack hits my user account I'm probably doomed anyway.
I should have done this from day one, but agents need GPU access which is tricky to sandbox. Now that I have a custom GPU queue, my plan is to run normal agent sessions in a VM and expose a container with GPU access through gVisor.
The first line in each adds a cooldown; the second prevents untrusted code from executing immediately at installation time. Note, ignore-scripts / no-build will break a bunch of real dependencies, but you can override it individually on a per-project + per-dependency basis for dependencies that actually need it. (And someti... (read more)