Skip to content

Releases

v2.0.1 - Universal AI Agent Dependency Guardrails, OSV Intelligence & CI Gate

Choose a tag to compare

@om-tajne om-tajne released this 31 Oct 16:01

What's in PkgDiet v2.0.1

PkgDiet 2.0.1 is a local-first dependency policy gate and MCP server designed to stop AI coding agents from proposing, hallucinating, or installing risky, deprecated, abandoned, or vulnerable npm packages.


🛡️ Real Agent Enforcement (Pre-Execution Guardrails)

Most AI guardrails are just advisory text. PkgDiet v2.0.1 introduces active install interception using each agent's native hook APIs:

  • Codex (OpenAI): Native PreToolUse Node.js hook (.codex/hooks/) intercepts shell commands and returns structured permissionDecision: "deny" before npm commands run.
  • Claude Code: Native PreToolUse install guard (.claude/hooks/) and full Claude Code Plugin support (.claude-plugin/, .mcp.json, skills, and /pkgdiet:check & /pkgdiet:audit slash commands).
  • Cursor: Always-applied .cursor/rules/pkgdiet.mdc rule for Cursor 0.47+ enforcing pre-check before any install command is generated.
  • Windsurf, Cline & GitHub Copilot: Direct MCP integration providing check_dependency tools at runtime.

🔍 Deep Supply-Chain Intelligence (100% Local & Free)

  • OSV.dev Vulnerability Detection: Direct integration with OSV advisory databases. Includes explicit osvChecked verification tracking and configurable securityMode: "fail-closed" or "fail-open".
  • Typosquat Detection: Levenshtein-distance analysis against popular npm packages to catch deceptive names before installation.
  • npm Provenance Verification: Inspects dist.attestations.provenance to verify cryptographically signed build origins.
  • Dependency Confusion Protection: Blocks internalNamePrefixes from being pulled from public registries.
  • Exact Version Pinning: Forbids bare npm install and unpinned ranges in agent sessions and CI.

🚀 Official GitHub Actions Marketplace Gate

Includes official action.yml for pull request dependency gating:

  • Diffs PR packages against the base commit.
  • Applies repository policy (ALLOW / WARN / BLOCK).
  • Generates native SARIF reports for GitHub Code Scanning.
- uses: om-tajne/pkgdiet@v2.0.1
  with:
    environment: ci
    fail-on: BLOCK

⚡ Model Context Protocol (MCP)

Bundled MCP server via stdio supporting:

  • check_dependency: Deep inspection of a candidate package.
  • check_dependencies: Batch checking with bounded concurrency (up to 50 packages).
  • suggest_alternative: Recommends verified, maintained alternatives when a package fails policy.
  • get_policy: Surfaces active repo constraints to the LLM.

🧪 Live Verification & One-Command Setup

Test PkgDiet in 5 seconds without configuring anything:

# Live enforcement demonstration
npx -y pkgdiet@2.0.1 demo

# Automated one-command setup for your repo & all agents
npx -y pkgdiet@2.0.1 init

v2.0.0 — The MCP Release

Choose a tag to compare

@om-tajne om-tajne released this 21 Sep 21:25

Welcome to the biggest update to PkgDiet yet! This release transforms PkgDiet from a standalone CLI into a fully integrated AI guardrail via the Model Context Protocol (MCP).

🚀 Major Features

  • Native MCP Server: PkgDiet now runs as a standard MCP server (npx pkgdiet mcp), exposing tools like check_dependency and suggest_alternative to compatible AI agents.
  • Universal Agent Compatibility: Works out-of-the-box with Claude Desktop, Claude Code, Cursor, Windsurf, Cline, CrewAI, and the Microsoft Agent Framework.
  • Zero-Config Integrations: New setup and agent-setup commands automatically detect your environment and configure agent files for you.
  • Enhanced Policy Engine: Stricter enforcement against legacy, bloated, and deprecated packages to prevent AI hallucination loops.
  • CI/CD Hardening: Updated GitHub Action workflows for evaluating PR lockfile drift against your .pkgdietrc.json policy.

📦 Installation

# Evaluate a package
npx -y pkgdiet@2.0.0 check moment

# Run the MCP server
npx -y pkgdiet@2.0.0 mcp

v1.2.0

Choose a tag to compare

@om-tajne om-tajne released this 01 Sep 19:27

Full Changelog: v1.1.0...v1.2.0

PkgDiet v1.1.0 🥗 — 3x Faster Concurrency, --prod Flag & Accuracy Fixes

Choose a tag to compare

@om-tajne om-tajne released this 17 Aug 10:57

What's New in v1.1.0 🥗

Performance & Scale
-3x Concurrency Boost: Increased parallel registry analysis to 15 concurrent workers (verified against 478 live packages with 0 rate limits).

  • Interactive Progress: Real-time progress updates during health checks.

🛡️ Accuracy & Cleanliness

  • Detection Accuracy Fix**: Fixed nested glob filtering (/node_modules/) to prevent false-negative "used" dependency flags from internal node_modules require calls.
  • --prod / --exclude-dev Flag: Skip devDependencies when auditing production bundles (all dependencies scanned by default).
  • Upgraded glob: Eliminated upstream deprecation warnings.