# Socket Inspect > Investiga un paquete antes de depender de él: extrae señales de Socket (scores, alertas, malware, CVEs, riesgo de cadena de suministro), revisa socket.dev, evalúa alternativas y muestra parches disponibles. Fuente: https://skillsagentes.com/skills/socketdev/sauce/socket-inspect Markdown: https://skillsagentes.com/skills/socketdev/sauce/socket-inspect.md Repositorio: https://github.com/SocketDev/sauce Autor: SocketDev Licencia: MIT Actualizado: hace 25 días Coste de contexto: 58 tok instalada, 3.5k tok al activarse, 3.5k tok con todos los archivos del bundle Bundle: 1 archivo, 13 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add SocketDev/sauce --skill socket-inspect --agent claude-code # Cursor npx -y skills add SocketDev/sauce --skill socket-inspect --agent cursor # Codex npx -y skills add SocketDev/sauce --skill socket-inspect --agent codex # Gemini CLI npx -y skills add SocketDev/sauce --skill socket-inspect --agent gemini # Windsurf npx -y skills add SocketDev/sauce --skill socket-inspect --agent windsurf # Cline npx -y skills add SocketDev/sauce --skill socket-inspect --agent cline ``` ## Qué hace - Consulta la API Batch PURL de Socket para obtener puntuaciones, alertas, CVEs y metadatos de un paquete - Revisa la página de socket.dev del paquete con WebFetch para contexto adicional - Evalúa el riesgo de la cadena de suministro en cinco dimensiones: malware, vulnerabilidades, árbol de dependencias, mantenimiento y confianza del autor - Busca y compara alternativas cuando el paquete tiene problemas graves o score bajo - Comprueba si existen parches de Socket disponibles para el paquete ## Cuándo usarla - Antes de instalar un paquete nuevo - Para investigar una dependencia marcada en un escaneo - Para comprobar el estado de seguridad, calidad o mantenimiento de un paquete - Para comparar alternativas a una dependencia o comprobar si hay parches de Socket disponibles ## Qué la activa - "Investiga el paquete lodash@4.17.21 antes de añadirlo" - "¿Es seguro este paquete que salió marcado en el escaneo?" - "Compárame alternativas a este paquete npm" - "¿Tiene Socket algún parche disponible para esta dependencia vulnerable?" ## Antes de instalar - Necesitas el CLI de Socket (pnpm dlx socket) y, para la API Batch PURL, la variable SOCKET_SECURITY_API_KEY o las herramientas MCP de Socket conectadas. - Necesita en el PATH: curl, pnpm - Variables de entorno: SOCKET_SECURITY_API_KEY - makes network requests - needs API credentials ## Archivos - SKILL.md — 13 KB ## SKILL.md Reproducido tal cual desde SocketDev/sauce bajo MIT. Esta sección es el documento original y está en inglés. # Research Inspect Research 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. ## When to Use - Evaluate a package before installing it - Investigate a flagged dependency from a scan - Check the security, quality, or maintenance status of a package - Compare alternatives for a dependency choice - Check if a package is malware - Check if Socket has patches available for a vulnerable package - Get a comprehensive supply-chain risk report ## Prerequisites ### Socket CLI Setup Use `pnpm dlx socket` to run the Socket CLI - this always fetches the latest version and requires no global install. Verify it works: ```shell pnpm dlx socket --version ``` All commands in this skill use the `pnpm dlx socket` prefix (e.g., `pnpm dlx socket scan create ...`).
Account authentication and optional global install **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**). #### Authentication Commands that require authentication need a Socket account and a credential that you own. Create an account at if you do not have one. Authenticate with one of these methods: - **Interactive login**: the user runs `pnpm dlx socket login` in their own terminal (it needs an interactive TTY, so the agent cannot run it). CLI releases with browser login show a device code to approve in the browser; older releases, including the current npm release, prompt for an API token. The `/socket-connect` skill covers signing in and choosing organizations. - **Environment variable (CI)**: Set `SOCKET_CLI_API_TOKEN` to an organization API token in CI or other non-interactive environments Verify account authentication: ```shell pnpm dlx socket organization list ``` If you do not want an account, leave authentication unconfigured. Commands that require authentication remain unavailable. Do not print or share credential values to verify setup. 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.
**Prefer the Socket MCP tools when connected:** if a Socket MCP `depscore` tool is available (installed by `/socket-connect`, signed in through the browser), use it for package scores instead of the Batch PURL API. It needs no API key. Use the `organizations` tool to find the `org_slug` for org-scoped tools such as `alerts`. **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`. ## Step 1 - Fetch Package Data via the Socket Batch PURL API 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
The curl call, its auth requirements, and every field to extract **API call:** ```shell 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:/@"]}' ``` **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: ```shell 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, use the Socket MCP tools from `/socket-connect` (browser sign-in, no key) or the CLI fallback in Step 1b. Do not ask the user to paste a key into the chat. Extract **all** returned data: - Overall score and category scores (security, quality, maintenance, license) - Alerts (every alert, grouped by category) - Known vulnerabilities (CVEs) with severity and fix versions - Dependency counts (direct and transitive) - Maintainer and author information - License identifier
## Step 1b - CLI Fallback If the Batch PURL API is unavailable or returns an error, fall back to the CLI: ```shell pnpm dlx socket package score ``` This returns score data without requiring `SOCKET_SECURITY_API_KEY`. ## Step 2 - Check the socket.dev Package Page Construct the package URL: ```text https://socket.dev/{ecosystem}/package/{name}/overview ``` For scoped npm packages (e.g. `@scope/name`), encode the scope: ```text https://socket.dev/npm/package/@scope/name/overview ``` Use `WebFetch` to visit the page and extract: - Score breakdown across all categories - Full alert list with descriptions - Dependency graph summary - Any additional context not present in the API response **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. ## Step 3 - Evaluate Supply Chain Risk Analyze the package across five dimensions. **Always check malware first.** Each dimension draws from different data sources: - **3a. Malware** - Batch PURL API alerts + socket.dev package page (WebFetch) - **3b. Vulnerabilities** - Batch PURL API CVE data - **3c. Dependency Tree** - Batch PURL API dependency counts + socket.dev page (WebFetch) - **3d. Maintenance Health** - socket.dev package page (WebFetch) + GitHub API (for commit activity and issue counts) - **3e. Author & Maintainer Trust** - Batch PURL API maintainer data + socket.dev page (WebFetch) ### 3a. Malware (CHECK FIRST) 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: - Explicit malware flags in Socket alerts - Suspicious install scripts (`preinstall`, `postinstall`) - Obfuscated or minified source code with no readable original - Unexpected network access, filesystem access, or shell execution - Data exfiltration patterns If malware is detected, the warning **MUST** be the first thing in the output. ### 3b. Vulnerabilities - List all known CVEs with severity, affected version ranges, and whether a fix is available - Count by severity: critical, high, medium, low - Highlight any unpatched (no fix available) vulnerabilities - Note if vulnerabilities exist in transitive dependencies ### 3c. Dependency Tree - Report direct and transitive dependency counts - Flag if the package has more than 100 transitive dependencies - Flag unusual tree depth - Note any flagged or problematic transitive dependencies - Consider whether the dependency footprint is proportional to the package's functionality ### 3d. Maintenance Health - Last publish date and release cadence - Commit frequency and recent activity - Open issues and pull requests (ratio of open to closed) - Number of contributors and maintainers - Flag as potentially unmaintained if no publish in the last 12 months - Flag as potentially abandoned if no commits in the last 24 months ### 3e. Author & Maintainer Trust - Number of maintainers (flag if single maintainer for a widely-used package) - Recent ownership or maintainer changes - Typosquatting signals (name similarity to popular packages) - Whether maintainers publish other well-known packages ## Step 4 - Research Alternatives Research alternatives when any of the following conditions are met: - Malware detected - Critical unpatched CVEs - Package is unmaintained (>12 months since last publish) - Socket score below 40 - Excessive transitive dependencies relative to functionality - User explicitly asks for alternatives To research alternatives: 1. Identify the package's core functionality 2. Search for well-known alternatives providing similar functionality 3. Query the Socket Batch PURL API for the top 3-5 alternatives (or use `pnpm dlx socket package score` CLI fallback) 4. Present a comparison table: | Package | Socket Score | Vulnerabilities | Dependencies | Last Published | | -------- | ------------ | --------------- | ------------ | -------------- | | original | ... | ... | ... | ... | | alt-1 | ... | ... | ... | ... | | alt-2 | ... | ... | ... | ... | ## Step 5 - Check for Socket Patches **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. - Check the API response data for available Socket patches or overrides - If patches are available, mention the patched version and link to the socket.dev page - Cross-reference the `/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) ## Output Format ### If Malware Is Detected 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. ### Standard Report 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). ### Vulnerabilities | 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}](https://socket.dev/{ecosystem}/package/{name}/overview) ## Error Handling - **Batch PURL API returns no data**: The package may not exist in the specified ecosystem, or the package name may be misspelled. Verify the exact package name and ecosystem. For scoped npm packages, include the full scope (e.g., `@babel/core`). If `SOCKET_SECURITY_API_KEY` is not set, use the `/socket-setup` skill to configure authentication. The Batch PURL API requires `SOCKET_SECURITY_API_KEY` from an account. CLI package scoring requires verified account authentication. - **WebFetch fails on socket.dev page**: Fall back to API data only. Note in the report that the review is based on API data and include the socket.dev URL for the user to check manually. - **Package not found in Socket's database**: Socket may not index all packages in all ecosystems. Note this limitation and suggest checking the package's own repository and issue tracker directly. - **GitHub API rate limit**: If GitHub API calls for maintenance data are rate-limited, skip the maintenance health dimension and note it in the report. ## Tips - Always review unfamiliar packages before adding them as dependencies - Single-maintainer packages carry higher supply-chain risk - Large transitive dependency trees increase attack surface - If a package is flagged as malware, do NOT install it - recommend immediate removal if already present - Use inspect results to inform decisions with the `/socket-dep-upgrade`, `/socket-dep-patch`, and `/socket-scan` skills - Weigh Socket score and maintenance health over download count alone - Re-review periodically - a package's security posture changes over time - CLI-based inspection requires verified account authentication. The Batch PURL API requires `SOCKET_SECURITY_API_KEY` from an account. - Prefer Socket patches over manual version pinning when available ## Dónde encaja - Categoría: [Seguridad](https://skillsagentes.com/categorias/seguridad.md) — Auditorías, revisión de dependencias, manejo de secretos y modelado de amenazas. - Creador: [SocketDev](https://skillsagentes.com/creators/socketdev.md) — 15 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Socket Connect](https://skillsagentes.com/skills/socketdev/sauce/socket-connect.md): Conecta tu agente a Socket iniciando sesión por el navegador, sin copiar ni pegar una API key. Incluye el servidor Socket MCP alojado (OAuth), lista tus organizaciones y enlaza el Socket CLI para escaneos. - [Socket Fix](https://skillsagentes.com/skills/socketdev/sauce/socket-fix.md): Arregla problemas de seguridad en dependencias: escanea y corrige todo (requiere /socket-scan) o repara un paquete concreto, orquestando los subskills de limpieza, reemplazo, parcheo y actualización. - [Socket Dep Upgrade](https://skillsagentes.com/skills/socketdev/sauce/socket-dep-upgrade.md): Usa `socket fix` para encontrar y actualizar dependencias vulnerables, y luego corrige los cambios incompatibles en el código. Actualizaciones auditadas en seguridad con migración de código automatizada. - [Socket Scan](https://skillsagentes.com/skills/socketdev/sauce/socket-scan.md): Ejecuta un escaneo de dependencias con Socket CLI: pide login o cuenta si no estás autenticado, ofrece un SBOM local si lo rechazas, y añade reachability y auditoría de licencias para enterprise. - [Socket Scan Setup](https://skillsagentes.com/skills/socketdev/sauce/socket-scan-setup.md): Configura los requisitos previos para escanear con Socket: instala la CLI, inicia sesión con tu propia cuenta y verifica el acceso antes del primer escaneo o ante errores de autenticación. ## Skills relacionadas - [Socket Connect](https://skillsagentes.com/skills/socketdev/sauce/socket-connect.md): Conecta tu agente a Socket iniciando sesión por el navegador, sin copiar ni pegar una API key. Incluye el servidor Socket MCP alojado (OAuth), lista tus organizaciones y enlaza el Socket CLI para escaneos. - [Socket Fix](https://skillsagentes.com/skills/socketdev/sauce/socket-fix.md): Arregla problemas de seguridad en dependencias: escanea y corrige todo (requiere /socket-scan) o repara un paquete concreto, orquestando los subskills de limpieza, reemplazo, parcheo y actualización. - [Socket Dep Patch](https://skillsagentes.com/skills/socketdev/sauce/socket-dep-patch.md): Aplica los parches de seguridad a nivel binario de Socket sin cambiar versiones de dependencias, usando socket-patch apply, y verifica que el parcheo persista en cada instalación. - [Socket Dep Upgrade](https://skillsagentes.com/skills/socketdev/sauce/socket-dep-upgrade.md): Usa `socket fix` para encontrar y actualizar dependencias vulnerables, y luego corrige los cambios incompatibles en el código. Actualizaciones auditadas en seguridad con migración de código automatizada. - [Socket Scan](https://skillsagentes.com/skills/socketdev/sauce/socket-scan.md): Ejecuta un escaneo de dependencias con Socket CLI: pide login o cuenta si no estás autenticado, ofrece un SBOM local si lo rechazas, y añade reachability y auditoría de licencias para enterprise. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)