Audit a GitHub repository's npm dependencies
audit_github_repositoryAudit a GitHub repository's npm dependencies from its URL — no pasted files needed. Fetches package.json plus the first lockfile found (pnpm-lock.yaml, then package-lock.json, then yarn.lock) from the default branch (or ref), and detects monorepos (package.json workspaces, pnpm-workspace.yaml), merging member dependencies (up to 50 members).
What it checks:
Every lockfile entry (up to 3,000; the repo's own workspace/link entries skipped) against OSV.dev, so
vulnerablePackageCountcovers the whole dependency set.Up to 100 packages, vulnerable ones first, also get a license verdict (same default policy as check_license_compliance, or pass
policy) and an install-script signal; up to 10 with lifecycle scripts get the deep tarball scan (installScriptScanScope).Up to 5 high-risk packages (critical/high vulnerability, possible typosquat, deprecated) get the maintainer-change and provenance checks; others are named in
ownershipCheckNote.
Read coverage and the summary before calling a repo clean: a summary starting PARTIAL AUDIT (coverage.complete: false) means not every package got every check. findings has full detail only for packages with something to report; the other detailed packages are listed compactly in cleanFindings. Vulnerable packages past the 100-package detail cap are in overflowVulnerablePackages. peerDependencies are skipped unless includePeerDependencies: true. This is the most expensive tool here — do not call it in a loop across many repos.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Branch, tag, or commit SHA to audit. Omit to use the repository's default branch. | |
| url | Yes | GitHub repository URL, e.g. "https://github.com/owner/repo". | |
| policy | No | License allow/deny policy, same shape as check_license_compliance. Omit for the default policy (only copyleft/network-copyleft/proprietary are violations). | |
| includeDevDependencies | No | Include package.json devDependencies in the audit. Default false. Ignored when a lockfile is used instead (its own format decides direct-dependency scope), and yarn.lock can never distinguish dev from production dependencies regardless of this flag. | |
| includePeerDependencies | No | Include package.json peerDependencies (root and, for a monorepo, each workspace member) in the audit. Default false — a peer is often intentionally left unresolved by the consumer. See warnings for which peers were excluded. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | ||
| owner | Yes | ||
| policy | Yes | ||
| summary | Yes | ||
| coverage | Yes | How much of the dependency set was actually checked — read this before calling a repo clean. | |
| findings | Yes | Detailed packages with something to report (vulnerable, unchecked, license issue, install-script/ownership signal, typosquat, deprecated). | |
| repoName | Yes | ||
| warnings | Yes | ||
| isMonorepo | Yes | ||
| inputFormat | Yes | ||
| deepScanNote | Yes | ||
| lockfilePath | Yes | ||
| manifestPath | Yes | ||
| cleanFindings | Yes | Detailed packages with nothing flagged, listed compactly. Together with `findings` these are the `totalPackages` packages that got full detail. | |
| totalPackages | Yes | ||
| workspaceNote | Yes | ||
| truncationNote | Yes | ||
| deepScannedCount | Yes | ||
| overflowPackages | Yes | ||
| defaultBranchUsed | Yes | ||
| workspacePatterns | Yes | ||
| ownershipCheckNote | Yes | ||
| overflowPackageCount | Yes | ||
| licenseViolationCount | Yes | ||
| ownershipCheckedCount | Yes | ||
| workspacePackageCount | Yes | ||
| vulnerablePackageCount | Yes | Vulnerable packages across every vulnerability-checked entry, not just `findings`. | |
| installScriptFlaggedCount | Yes | ||
| ownershipRiskFlaggedCount | Yes | ||
| overflowVulnerablePackages | Yes |