The skill that turns the gate rule into an actual action. Fork it, install it, and let PASS / WARN / FAIL decide what gets into your stack.
// TL;DR
Before new external dependencies are installed or added — packages, MCP servers, plugins, binaries, or third-party Claude skills — run the security-audit skill end-to-end on every new direct artifact. Verdict PASS continues, WARN requires explicit approval, FAIL stops. The result is logged to the session handoff.
// No exceptions
The rule applies to "known" and "Microsoft-owned" packages too. Supply chain attacks hit precisely those: xz-utils in 2024 was an infrastructure cornerstone that had been maintained for over a decade before the compromise. A familiar name is not evidence that a particular version is safe.
- Skill source
- github.com/CODEWIRENET/security-audit — open source, MIT.
- Trigger
- Before every new package, MCP server, plugin, binary, or third-party skill.
- Verdicts
- PASS · WARN · FAIL
- Logs to
- Session handoff (
handoff-*.md) — one line per artifact. - Whitelist
~/.codewire/security-audit/whitelist.json+ globally:@playwright/mcp@latest- Binary scanning
- VirusTotal — requires
VIRUSTOTAL_API_KEY, otherwise a manual GUI link
Why a gate, not just a log
We already have a log of external downloads. The log says what came in. It doesn't say whether it should have come in. Once a compromised package is installed, the attack surface is open — postinstall scripts have run, transitive dependencies are pulled in, and your local development machine may have exfiltrated credentials before you got around to reading the log.
An audit gate moves the check to before install. It can't catch everything — no static analysis can — but it catches the patterns that account for recent years' historical attacks: typosquatting, ownership change in new packages, postinstall scripts without reason, a new binary from a recently created account, MCP servers requesting broader permissions than their stated purpose requires.
Log and audit work together: the audit lets the package in, the log records it. Two independent checkpoints. If one fails, the other still catches part of the problem.
What triggers an audit
The rule applies whenever something external is being pulled into a project or development environment. Run the audit on every new direct artifact, not on every transitive dependency — modern package ecosystems have far too many transitives for that to be practical.
Package installations
All package managers are in scope:
npm install,npm/pnpm/yarn adddotnet add packageflutter pub addpip installcargo addgo get
The rule also applies to manual edits with the same effect: adding a line to package.json, *.csproj, pubspec.yaml, requirements.txt, Cargo.toml, or go.mod is a package install when the subsequent install/restore pulls it in.
MCP servers
Adding a server to .mcp.json or claude_desktop_config.json grants the server access to read/write in your session. That's a non-trivial trust transfer. Audit every new server entry, even when it's from a well-known vendor.
Plugins and extensions
Claude plugins (claude plugin add), VS Code extensions, JetBrains plugins. All of them are code that runs with your IDE's privileges — typically file system access, network, and clipboard.
Binaries
.exe, .msi, .dmg, .AppImage, .deb, prebuilt releases from GitHub Releases, Docker images, and model weights. Binary artifacts can't be peer-reviewed like source code — they have to be scanned.
Third-party Claude skills
Skills are prompts plus tools plus any attached scripts. A third-party skill installed in your setup expands what Claude can decide to do. Audit it.
The three verdicts
PASS — continue
Established package, known author, sensible maintenance pattern, no known CVEs for the version in question, no suspicious permissions or scripts. You can install without further approval — but the entry in External-download.md still has to be written.
WARN — explicit approval
The audit found something that doesn't disqualify the package, but the owner should see it. Examples: a major version bump of a known package, ownership change within the last 90 days, a postinstall script that downloads a native binary, an MCP server requesting broader permissions than its purpose requires.
You must not install on WARN without explicit OK. Present the concrete concerns to the owner — not an abstract "there's something" — and wait for yes/no before continuing.
FAIL — stop and propose an alternative
The audit found a sign that disqualifies the package: known CVE for the requested version, typosquatting pattern, author with suspect history, or a binary that fails VirusTotal scanning. Stop the install, propose an alternative, and let the owner make the final decision.
Pre-approved artifacts
Two channels for pre-approval, so the audit doesn't run unnecessarily on the same item again and again:
- Globally
@playwright/mcp@latest— Microsoft's official Playwright MCP server. Maintained as part of the Playwright stack with corresponding review discipline.- Locally
~/.codewire/security-audit/whitelist.json— project- or environment-specific artifacts the owner has approved. Still audited the first time; afterwards the audit skips them until version or ownership changes.
Binaries — special handling
Binary artifacts can't be read like source code. In addition to the normal audit, a VirusTotal scan of the file is required before execution. If you set VIRUSTOTAL_API_KEY, the audit can fetch the verdict programmatically. If the key isn't set, generate a GUI link to VirusTotal with the file's hash and ask the owner to verify manually before installing.
Don't skip binary scanning because "the file comes from a known site." A signed installer is better than an unsigned one, but signing only verifies that the file comes from the owner — not that the owner isn't compromised themselves.
Logging to the handoff
Each audit result is appended to the session handoff on a standard line:
[security-audit] <artifact>@<version> — <verdict> — <risk>/100
Examples:
[security-audit] @anthropic-ai/sdk@0.27.0 — PASS — 12/100 [security-audit] some-image-converter@1.0.0 — WARN — 58/100 [security-audit] uncertain-binary-tool@2.1.0 — FAIL — 88/100
The handoff lines give the next session — or another agent — instant visibility into what came in, what was approved, and what was rejected. Together with External-download.md, this gives a complete forensic trail.
Relationship to other rules
To External downloads
The two rules are paired. Security audit runs before install and decides whether anything comes in at all. External downloads logs after install and gives a permanent record. The audit result belongs in the handoff; the download entry belongs in External-download.md. Neither replaces the other.
To Decisions and coordination
A FAIL verdict on a package the owner still wants to install is a cross-project decision if the package is used in multiple places. Log the exception in DOCS/DECISIONS.md with the [CROSS-PROJECT] tag and a short explanation.
To Build-check
A green build says nothing about the security of a package. Build-check and security-audit cover different dimensions: the build says "the code compiles"; the audit says "we'd be willing to run it."
What the audit gate doesn't catch
Be realistic about the limits. An audit at install time can't catch:
- A supply chain compromise that happens after install but before the next audit run.
- Malicious code that activates only months later (time-bomb patterns).
- Transitive dependencies if we audit only direct artifacts (a tradeoff between coverage and practicality).
- Weights in ML models with backdoors triggered by specific prompt patterns.
The audit is a barrier, not a defense in depth. Pair it with update discipline, dependency scanning in CI, and a plan for what happens when a CVE hits one of your artifacts.