pkgtruth

v0.2.2
io.github.hxckya/pkgtruth Checked 12 hours ago Published 2 months ago

Catches hallucinated and slopsquatted npm and PyPI packages before an agent installs them.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

check_package Check one package

Verify a single npm or PyPI package before installing, importing, or recommending it. Returns whether it actually exists, and flags slopsquatting (a low-adoption package impersonating a popular one), names npm removed for malware, install-time scripts, deprecation, and abandonment. Call this whenever you are about to introduce a dependency you have not verified in this session. Read-only; one or two requests to the public registry. A verdict of UNKNOWN means the registry did not answer — retry, never assume safe.

ParameterTypeDescription
name *stringExact package name as it would be installed, e.g. "express", "@scope/pkg", or for PyPI "requests". No version suffix.
ecosystemstringRegistry to check against. Default npm.

check_dependencies Gate a whole dependency list

Verify many npm or PyPI packages at once — use this before writing a package.json or requirements.txt, or handing a dependency list to a user. All names must belong to one ecosystem per call. Results are sorted worst-first so anything hallucinated or dangerous surfaces at the top. Read-only; batches registry requests and caches adoption figures, so 50 names take a few seconds.

ParameterTypeDescription
names *arrayPackage names to verify (max 50), without version suffixes.
ecosystemstringRegistry to check against. Default npm.

check_install_command Check the packages an install command would fetch

Verify the packages a shell command would install or execute, before running it: `npm install …`, `npx …`, `pnpm add`, `yarn add`, `bun add`, `pip install`, `uv add`, `poetry add` and similar, including behind `sudo`, `&&` chains and `sh -c`. Extracts the package names (npm and PyPI at once), checks each against its registry, and returns them worst-first. A command that installs nothing by name (a bare `npm install` from a lockfile, `git`, `npm test`, or `npx <bin>` of a tool already in node_modules) returns total 0 and costs no network call — use check_dependencies on the manifest in th…

ParameterTypeDescription
command *stringThe exact shell command about to run, e.g. "npm install express crossenv" or "pip install -U requests".
cwdstringDirectory the command will run in. Lets "npx <bin>" of an already-installed tool be recognised as fetching nothing. Defaults to the server's working directory.