How do you keep a dependency install from running with the secrets on a developer's machine?
A dependency install is code execution. Review the lockfile, allow native builds only for packages you named, and keep secrets off that machine.
3 min readDEV GroupEnterprise product teams
An install is code execution
Treat every dependency install as code execution. Review the lockfile diff, allow a native build only for packages you have named, and read the package, because a clean run in CI describes that run. A security research report published on 26 October 2026 shows why. The npm packages it examined ran code at install time through a command substitution in binding.gyp, and declared no conventional install script, so a review that only looks for a postinstall field never sees them. Later packages in the same campaign shipped a compiled addon and a one-line postinstall that called it. The addon decrypted a dotfile that looked like a build cache, started the result in a detached process, and swallowed errors, so a failed run left nothing in the install log. Before it ran, it checked for CI variables, container markers, roughly 1.5 GB of memory or less, a single CPU, and an attached debugger, and returned without doing anything when any of those were true. It was written to stay asleep in the runners and sandboxes that scanners use, and to run on a developer laptop or an ordinary server. The same report found 42 repositories belonging to 11 legitimate owners, carrying hooks for AI coding assistants and editors. The hooks run when an agent session starts or when a developer opens the folder. The payload files were between 12.9 and 13.7 MB, large enough that code search did not index them and the contents API could not return them, so they looked empty until each repository's git tree was enumerated.
Read the lockfile, allow the build
Commit the lockfile and fail CI when an install would change it. On every added or updated package, read the install scripts, any command substitution in binding.gyp, any native addon, and any unexpected dotfile. Disable lifecycle scripts by default, and allowlist by name the few packages that must build. A package you did not agree to compile should not compile. Running the install in CI and reading silence as a pass misses a payload that refuses to run there, which is why the review reads the files. Keep publish tokens, cloud admin keys, and long-lived source-control credentials off any machine that installs dependencies. A laptop running an install should not be able to publish your packages or push to every repository. Give CI a short-lived credential scoped to that job. How to scope those credentials is its own note.
When a bad version was installed
If a bad version was installed on a workstation, deleting the dependency folder leaves the detached process in place. Isolate the machine, and rotate every credential it could reach from a different, clean machine. Then read the repositories that identity could write: new workflows, unexpected branches, and hook files for editors and AI coding tools, including anything that runs on folder open or at the start of an agent session. Review those files the way you review CI, and read large files from the git tree when search skips them. A hook in the repository should earn permission to run a command on its own review, rather than receiving it because someone opened the project. Lockfile review, the build allowlist, and that boundary around developer machines and agent hooks are software work, and that is where we fit.
- Related: keeping integration and automation tokens from becoming a breach
- Related: deciding whether an AI agent's action actually runs
- Related: catching a data feed that has quietly gone stale
- How we work: scope, prototype, ship, run
- Dependencies installing on machines that hold production credentials? Start a conversation
Sources
- Security research report on install-time code execution. Security research report. October 26, 2026.
Was this useful?
Related notes
Applied AI2 min read
How do you keep an AI coding agent's saved approvals from committing secrets?
An agent that remembers an approval can save a secret into a file inside the repo. Keep that file out of git, and do not approve the literal command.
- Agents
- Secrets
- CI
Security3 min read
How do you stop a new sign-up from making itself an owner of someone else's account?
In November 2026 a free sign-up made itself owner of a vendor's own org through one invitation check. Authorize every grant on the server.
- Authorization
- Multi-tenancy
- CI
Product engineering2 min read
How do you catch an API you depend on being retired before it starts returning errors?
Cloudflare, Databricks, Penneo and Meta all retired API features in November 2026. Inventory what you call, track sunset dates, and test fallbacks.
- Dependencies
- API contracts
- Deprecations
- Monitoring