Terminal
Terminal/Skill
Researches a package before you add it, pulling Socket scores, alerts, malware verdicts, CVEs and alternatives into one report.
By Socket
Works with
npx skills add socketdev/sauce --skill socket-inspectResearch a package before you depend on it. This skill pulls every available signal from Socket - scores, alerts, malware verdicts, CVEs, and supply-chain risk indicators - checks the socket.dev package page for additional context, evaluates alternatives when warranted, and surfaces available Socket patches. Use it to make an informed decision before adding, keeping, or replacing any dependency.
Use pnpm dlx socket to run the Socket CLI - this always fetches the latest version and requires no global install. Verify it works:
pnpm dlx socket --version
All commands in this skill use the pnpm dlx socket prefix (e.g., pnpm dlx socket scan create ...).
Optional global install: If you prefer a global socket command, install with npm install -g socket@latest (must be version 1.0.0 or higher).
For users without a Socket account: Configure the public demo token directly:
pnpm dlx socket config set apiToken sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api --no-banner --no-spinner
pnpm dlx socket config set defaultOrg SocketDemo --no-banner --no-spinner
This provides limited access to CLI features like pnpm dlx socket fix, pnpm dlx socket package score, sfw, and socket-patch with rate limits. No account creation is needed for basic usage. Note: The public demo token cannot create scans (pnpm dlx socket scan create requires the full-scans:create permission). For scanning and full-rate access, create a free account at https://socket.dev.
For users with an account: Authenticate with one of:
pnpm dlx socket login (stores credentials in ~/.socket/)SOCKET_CLI_API_TOKEN in your shell profile or CI environmentVerify account authentication:
pnpm dlx socket organization list
If authentication fails or the CLI is not installed, use the /socket-setup skill for detailed guidance including Node.js installation, PATH troubleshooting, and CI/CD token configuration.
For the Batch PURL API: SOCKET_SECURITY_API_KEY is required for direct API calls. Users with a free or enterprise account can create an API key at https://socket.dev/dashboard/org/{ORG}/settings/integrations/api-tokens.
Query the Socket Batch PURL REST API with the package's PURL (Package URL) to retrieve scores, alerts, CVEs, and metadata.
Supported ecosystems: npm, pypi, go, maven, nuget, rubygems, cargo
API call:
curl -X POST https://api.socket.dev/v0/orgs/{org_slug}/purl \
-H "Authorization: Bearer $SOCKET_SECURITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"purls": ["pkg:<ecosystem>/<name>@<version>"]}'
Note: This endpoint requires org access and a SOCKET_SECURITY_API_KEY. The old /v0/purl endpoint is deprecated (returns empty results since Jan 2026).
Warning: The Batch PURL API may be intermittently unavailable (returns 401 or empty responses). If the API call fails, use the CLI fallback in Step 1b below.
For example, to inspect lodash@4.17.21 on npm:
curl -X POST https://api.socket.dev/v0/orgs/{org_slug}/purl \
-H "Authorization: Bearer $SOCKET_SECURITY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"purls": ["pkg:npm/lodash@4.17.21"]}'
If SOCKET_SECURITY_API_KEY is not set, authentication is required before proceeding. Run pnpm dlx socket login or set the SOCKET_SECURITY_API_KEY environment variable. Use the /socket-setup skill for guidance.
Extract all returned data:
If the Batch PURL API is unavailable or returns an error, fall back to the CLI:
pnpm dlx socket package score <ecosystem> <name> <version>
This returns score data without requiring SOCKET_SECURITY_API_KEY.
Construct the package URL:
https://socket.dev/{ecosystem}/package/{name}/overview
For scoped npm packages (e.g. @scope/name), encode the scope:
https://socket.dev/npm/package/@scope/name/overview
Use WebFetch to visit the page and extract:
Note: The socket.dev package page may be blocked by Cloudflare bot protection when accessed via WebFetch. The page URL should still be provided to the user as a manual link, but cannot be relied on as a programmatic data source.
If WebFetch is unavailable or fails (including due to bot protection), note that the report is based on API data only and include the URL so the user can check manually.
Analyze the package across five dimensions. Always check malware first.
Each dimension draws from different data sources:
If the package is flagged as malware, STOP and report immediately with a prominent warning. Do not continue to other dimensions until the malware finding is clearly communicated.
Check for:
preinstall, postinstall)If malware is detected, the warning MUST be the first thing in the output.
Research alternatives when any of the following conditions are met:
To research alternatives:
pnpm dlx socket package score CLI fallback)| Package | Socket Score | Vulnerabilities | Dependencies | Last Published |
|---|---|---|---|---|
| original | ... | ... | ... | ... |
| alt-1 | ... | ... | ... | ... |
| alt-2 | ... | ... | ... | ... |
What are Socket patches? Socket patches are binary-level fixes applied directly to installed packages without changing their version numbers. They fix known vulnerabilities in-place, which is useful when an upstream fix doesn't exist yet or when upgrading would introduce breaking changes.
/socket-dep-patch and /socket-dep-upgrade skills - remind the user they can apply patches with /socket-dep-patch (binary-level, no version change) or run a security-audited upgrade with /socket-dep-upgrade (version upgrade with code migration)When malware is detected, the output MUST begin with this warning before any other content:
MALWARE DETECTED - do NOT install this package.
Package:
{name}({ecosystem}) Malware type: {description of malware behavior}Recommended action: Remove this package immediately if already installed. Check for alternatives below.
Then continue with the standard report sections.
Structure the report as follows:
{name} v{version} ({ecosystem})
Socket Score: {score}/100
Alerts List all Socket alerts grouped by category (security, quality, maintenance, license, miscellaneous).
| CVE | Severity | Affected Versions | Fixed In |
|---|---|---|---|
| ... | ... | ... | ... |
Supply Chain Risk Assessment Summarize findings across the five dimensions (malware, vulnerabilities, dependency tree, maintenance health, author trust). Call out anything that warrants concern.
Socket Patches
State whether Socket patches are available. If yes, mention the patched version and how to apply via /socket-dep-patch.
Alternatives (if applicable) Include the comparison table from Step 4.
Recommendation A clear, actionable recommendation: safe to use, use with caution (with reasons), or avoid (with reasons and alternatives).
Source: socket.dev/{ecosystem}/package/{name}
@babel/core). If SOCKET_SECURITY_API_KEY is not set, use the /socket-setup skill to configure authentication. For users without an account, the public demo token provides limited CLI access but the Batch PURL API requires SOCKET_SECURITY_API_KEY from a free or enterprise account. As a fallback, use pnpm dlx socket package score <ecosystem> <name> <version> for basic score data./socket-dep-upgrade, /socket-dep-patch, and /socket-scan skills/socket-setup to configure) for users without an account, subject to rate limits. The Batch PURL API requires SOCKET_SECURITY_API_KEY from a free or enterprise account.