SD-012 — Post-Install Hook

SD-012 flags an install lifecycle name in a skill — postinstall, preinstall, prepare — naming a step that runs as a side effect of installing dependencies.

What it matches

A reference to an install lifecycle name — postinstall, preinstall, prepare, prepublish, or the pre/post/after/before/on-install spellings — naming a step that runs as a side effect of dependency installation. Whether the step executes code is not tested.

Why it matters

An install hook runs when somebody installs, not when they use the skill, so it executes before anyone has read a line of what they installed and outside whatever sandbox constrains the agent itself. It runs with the installing user's privileges and with network access, which is why dependency-confusion and typosquatting attacks all aim at this entry point. Someone who installs the skill merely to look at it has already run it.

Example

json

{"scripts": {
  "postinstall": "node ./scripts/setup.js"
}}

This command runs on install, before anyone has read the package.

How to fix it

Move the work into an explicit setup command the user runs deliberately, and document it. Where a build step is genuinely required at install time, keep it to compiling code the package already contains — never a network fetch, and never anything touching files outside the package directory.

Known false positives

A legitimate build step declared in the same field.

Standards mapping

OWASP ASI ASI04, ASI05

CWE CWE-506

Agent Skills in the Wild SC2

Prevalence

mediumsecurity

Pattern SD-012 was detected in 112 of 16475 public skills scanned as of 11 September 2026.

current ruleset 2414c32f04000b5d

Check your own skills

Scan a repository or a single skill against this rule and the rest of the catalogue, free.