Skip to content

Instantly share code, notes, and snippets.

View implosivemosaic's full-sized avatar
🧨
Testing in production

Keith Hassen implosivemosaic

🧨
Testing in production
View GitHub Profile
@implosivemosaic
implosivemosaic / package-manager-security.md
Last active April 2, 2026 01:21
Package manager security for agents

Package Manager Security

Protect agent-driven package manager calls (npm, npx, pnpm, yarn) from supply chain attacks. This runbook has two goals: (1) route package manager commands through Socket Firewall (sfw) for real-time scanning, and (2) enforce a 7-day minimum release age so newly published versions are not installed immediately.

Read this fully before changing anything. Then work through it with the user. The user is likely non-technical, so use language that helps them understand what you're doing and why.

If sfw is not installed do this right away: npm i -g sfw If npm is installed and npm --version is not 11.10.0 or greater, then it MUST be upgraded immediately.

No need to install npm, pnpm or yarn unless they're already installed. The goal is to preemptively protect all 3 package managers from supply chain attacks with package age restrictions and sfw wrapping so that agents always use the sfw-wrapped versions.

[START][2022-06-20 16:02:59] LSP logging initiated
[INFO][2022-06-20 16:02:59] .../vim/lsp/rpc.lua:261 "Starting RPC client" { args = { "--stdio" }, cmd = "astro-ls", extra = { cwd = "/Users/john/project" }}
[TRACE][2022-06-20 16:02:59] .../lua/vim/lsp.lua:953 "LSP[astro]" "initialize_params" { capabilities = { callHierarchy = { dynamicRegistration = false }, textDocument = { codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = false, resolveSupport = { properties = { "edit" } } }, completion = { completionItem = { commitCharactersSupport = false, deprecated