convez.ai
HookSegurançaAvançado
KSEGIT

Version Sentinel

KSEGIT/Version-Sentinel

Bloqueia edições de dependência sem verificação de registro prévia

Ver no GitHub
BomPluginScore · de 0 a 100

Hook de segurança para Claude Code que bloqueia adições, atualizações e downgrades de dependências até que uma verificação de versão fresca seja registrada com fonte. Suporta npm, pip, Poetry, uv, Cargo e NuGet, impedindo versões alucinadas e instabilações silenciosas.

Instalação

$npx convez-ai KSEGIT/Version-Sentinel

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
6
Forks
0
Acompanhando
0
Saúde
71%
Último commit
há 1 dia
Versão
version-sentinel-v0.6.1
Issues abertas
6
Contribuidores
5

Casos de uso

  • Prevenir instalação de versões de pacotes que nunca existiram ou foram alucinadas por LLM
  • Auditar e registrar por que versões específicas foram escolhidas em projetos
  • Proteger contra downgrades acidentais para versões vulneráveis durante assistência de IA
  • Garantir que nenhuma versão comprometida ou yanked seja instalada sem verificação prévia

Veredito

Ferramenta sofisticada que resolve um gap real em supply-chain security ao rodar como PreToolUse hook — bloqueia operações inseguras antes da execução, não depois. Excelente para equipes que usam Claude Code em produção e precisam de garantias explícitas sobre versões de dependências.

README

A tradução para o português deste README ainda está na fila.

If Claude tries to add "lodash": "^4.17.21" without looking up the latest version first, the tool call is rejected with exit 2. Claude must run WebSearch, then /vs-record, then retry. Five ecosystems supported in v0.1.

Keywords: Claude Code, Anthropic, AI coding guardrails, LLM supply-chain security, dependency management, hallucinated package versions, npm, PyPI, Cargo, NuGet, PreToolUse hook.

Why

LLM-assisted coding silently ships whatever version the model remembers from its training data. For packages with frequent releases or known compromised versions, that's unacceptable. version-sentinel inserts a mandatory "check the registry" step — without stopping you from pinning an old version on purpose.

What it prevents

  • Hallucinated versions — LLM picks a version that never existed or never shipped.
  • Stale defaults — model reaches for a 2-year-old pin because training data froze there.
  • Compromised-release installs — no guard against yanked / malicious versions without a fresh registry lookup.
  • Silent downgrades — Claude "fixes" a CI error by reverting a package to an older vulnerable build.
  • Supply-chain drift — no audit trail of why a specific version was chosen.

How it compares

ToolScopeEnforcement
version-sentinelClaude Code PreToolUse hook — blocks the tool call before the edit landsHard-fail exit 2
Generic dependency-audit skillsPost-hoc scan of package.json / requirements.txtAdvisory
Dependabot / RenovateScheduled PR bot against remote registriesAsync PR

Unlike post-hoc auditors, version-sentinel runs inside the agent loop — the agent cannot merge a bad version by accident because the write itself is refused until the check is cited.

Supported ecosystems (v0.1)

FileEcosystemRegistry
package.jsonnpm/pnpm/yarn/bunregistry.npmjs.org
requirements*.txt, constraints*.txtpippypi.org
pyproject.tomlPEP 621 + Poetry + uvpypi.org
Cargo.tomlRustcrates.io
*.csproj, *.fsproj, *.vbproj.NETapi.nuget.org

Covers Edit, Write, MultiEdit, and Bash install commands (npm install, pip install, poetry add, uv add, cargo add, dotnet add package).

Install

/plugin marketplace add https://github.com/KSEGIT/Version-Sentinel.git
/plugin install version-sentinel@version-sentinel-marketplace

The owner/repo shorthand (KSEGIT/Version-Sentinel) resolves to an SSH clone URL and requires GitHub SSH keys. Use the full HTTPS URL above to clone anonymously.

Prerequisites

  • bash, jq, curl, python3 (3.11+, for tomllib) on PATH
  • Windows: Git Bash bundles bash/jq/curl; install Python 3.13 separately.

How it works

  1. Claude tries to add/bump a dep (Edit package.json, npm install X@Y, ...)
  2. PreToolUse hook fires, exits 2 with stderr:
    BLOCKED: version-sentinel.
    Package: lodash (npm). Version: 4.17.21.
    No fresh version check on record.
    
  3. Claude runs WebSearch "lodash latest version site:npmjs.com"
  4. Claude invokes /vs-record npm lodash 4.17.21 https://www.npmjs.com/package/lodash
  5. Claude retries — hook finds fresh entry, lets the call through.

Commands

  • /vs-record <ecosystem> <pkg> <version> <source> — record a version check
  • /check-versions — audit manifests against upstream registries

Escape hatches

CaseHow
Deliberate old-version pin/vs-record npm pkg 1.0.0 "intentional: CVE fix deferred"
Throwaway sessionexport VS_DISABLE=1
Private/forked packageAdd ecosystem:pkg to .version-sentinel/ignore
No WebSearch (non-US)Use WebFetch URL or intentional: no-websearch-region

Sidecar file

State: <project-root>/.version-sentinel/checks.json. Auto-gitignored on first write.

Uninstall

/plugin uninstall version-sentinel@version-sentinel-marketplace
/plugin marketplace remove version-sentinel-marketplace

FAQ

Does this work with Claude Desktop or just Claude Code? Claude Code only — relies on the PreToolUse hook API exposed by the CLI.

Does it slow Claude down? First touch of a package: adds one WebSearch + one /vs-record call (~5–10s). Subsequent edits to the same pin hit the cached sidecar — zero overhead.

Can I use this for private / internal registries? Yes — add the ecosystem:pkg entry to .version-sentinel/ignore, or record with a justification string.

Why not just run npm audit / pip-audit? Those are post-hoc. version-sentinel refuses the write in the first place, so the vulnerable version never enters the repo.

Does it support Go modules, Gradle, Maven, composer, gems? Not in v0.1. See docs/roadmap.md.

Related

License

MIT — see LICENSE.

Ver o original no GitHub

Bom para

Relacionados