pkg guard
Prevent typosquatting and hallucinated package installs with automated dependency verification and lockfile scanning.
Free
Works with the AI Agents you already use
pkg guard
Example session with this skill installed
I need a library to handle dates in this Node project. Can you install 'moment-js'? Also, scan the current repo for risks.
- Read your context and instructions
- Compiled the pkg guard
I have audited the repository and checked the requested package. The scan of your existing package.json and package-lock.json found no high-risk dependencies. However, I have blocked the installation of moment-js because it appears to be a typosquat or hallucination of the popular moment library.
Dependency Security Report
| Action | Target | Result | Reason |
|---|---|---|---|
| Scan | package.json | PASS | No suspicious packages found in manifest. |
| Scan | package-lock.json | PASS | Lockfile hashes appear consistent. |
| Check | npm install moment-js | BLOCKED | Package "moment-js" looks like a typosquat of "moment". |
| Check | npm install moment | RECOMMENDED | Established package with high download volume. |
I recommend installing moment instead, or better yet, using the native Intl object if you only need basic formatting to avoid adding a dependency.
Next steps
- Run
npm install momentif you require the full library features. - Review your
PKG_GUARD_ALLOWenvironment variable if you intended to use a specific fork. - Consider using native
Datemethods to keep the dependency tree light.
Connects securely to your tools. The creator never sees your data.
About this skill
Supply chain attacks via typosquatting and slopsquatting are a constant threat to developer environments. This skill enforces a strict verification workflow before any new package enters your codebase, preventing the accidental installation of malicious or hallucinated dependencies. It integrates a defensive check into the agent's decision-making process to ensure every npm install or pip install command is legitimate.
What it does
- Dependency verification checks package names against typosquatting patterns and known popular libraries.
- Risk assessment blocks packages that are brand new, have low download counts, or contain suspicious postinstall scripts.
- Project auditing scans existing lockfiles (
package.json,pyproject.toml,Cargo.toml) for pre-existing vulnerabilities. - Standard library preference prioritizes built-in language features over adding unnecessary third-party bloat.
- Automated blocking uses a dedicated Python script to validate installation commands before execution.
How it works
- Inventory check involves auditing the current manifest files to see if the required functionality is already available.
- Command validation runs the
pkg_guard.py checkcommand on any proposed installation string. - Risk reporting identifies why a package was flagged, such as "first published N days ago" or "looks like a typosquat".
- Resolution requires the agent to find established alternatives or ask for manual user overrides via environment variables.
Frameworks & tools
The skill supports all major package managers including npm, pip, uv, poetry, cargo, gem, and go. It uses a standalone pkg_guard.py script compatible with Python 3.9+.
Why this beats prompting it yourself
Generic prompts often fail to catch subtle typos or "slopsquatted" packages that AI models frequently hallucinate. This skill uses a deterministic script to verify real-world package metadata and download counts, providing a layer of security that LLM reasoning alone cannot guarantee.
Use cases
- Prevent installing a hallucinated Python library suggested by an LLM.
- Audit a legacy repository's lockfiles for suspicious dependencies.
- Verify if a new npm package is a typosquat of a popular utility.
- Block packages that execute untrusted code during the postinstall phase.
Known limitations
Requires Python 3.9+ to run the validation script. The agent cannot bypass blocks and requires the user to manually update PKG_GUARD_ALLOW if a flagged package is genuinely required.
Requires Python 3.9+. Agent cannot bypass blocks; users must manually set PKG_GUARD_ALLOW for exceptions. Supports npm, pip, uv, poetry, cargo, gem, and go.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 21 days ago
- Free with an Agensi account
Requires
Permissions
Allowed Hosts