feat: add pre-install security scanning#644
Open
elliotllliu wants to merge 1 commit intovercel-labs:mainfrom
Open
feat: add pre-install security scanning#644elliotllliu wants to merge 1 commit intovercel-labs:mainfrom
elliotllliu wants to merge 1 commit intovercel-labs:mainfrom
Conversation
Add optional security scanning before skill installation: - `npx skills add <source> --scan` runs a security check before installing - Detects high-risk patterns (eval, exec, credential theft, HTML comments) - Detects medium-risk patterns (network requests, file system access) - Uses Agent Shield (`@elliotllliu/agent-shield`) when available, falls back to built-in pattern matching - Prompts user to confirm when high-risk findings are detected - Skippable with `--yes` flag New files: - `src/security-scan.ts` — scanning module with built-in + agent-shield support - `tests/security-scan.test.ts` — 6 tests covering clean/risky/skip cases Implements vercel-labs#613
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #613
Adds optional security scanning before skill installation to detect potential risks.
Usage
What It Detects
High Risk
eval()/exec()usagechild_processimports~/.ssh/,~/.aws/,.env)Medium Risk
fetch, HTTP URLs)Architecture
@elliotllliu/agent-shieldwhen available (30+ rules, cross-file analysis)--scanflagChanges
src/security-scan.ts— Scanning module (built-in patterns + Agent Shield integration)src/add.ts—--scanflag in options and pre-install hooktests/security-scan.test.ts— 6 testsTesting
pnpm build✅pnpm test✅ (381/381 tests pass, +6 new)