Skip to content
youdede

Dependency source guard

SecurityHookv1.0.0

A deterministic Claude Code PreToolUse gate that reconstructs supported dependency manifest edits and blocks net-new Git, URL, local-path, alias, or dynamically resolved package sources while allowing ordinary registry constraints.

Runs on

Scope
$npx @youdede/toolkit add dependency-source-guard --target claude-code

What it does

Reject newly introduced dependencies that bypass an authenticated package registry.

When it fires

  • implementation
  • review
  • maintenance

How it behaves

Inspect bounded dependency manifest changes and reject net-new package sources that bypass ordinary registry resolution.

It does not install, resolve, upgrade, audit, or select dependency versions.

It does not contact a registry, Git server, archive host, or local package directory.

It does not claim that registry-resolved packages are safe, authentic, or compatible.

It does not expose an inline suppression or project-controlled source allowlist.

Configuration

targets/claude-code/dependency-source-guard.mjsnode · read-only

Version
1.0.0
Requires
node
Licence
RiskThis automatic gate rejects newly introduced dependencies that bypass an authenticated package registry; a false denial can interrupt legitimate work, but it does not execute the blocked action.
Medium
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Enforces, blocks on violation
On failure
Denies and blocks
LatencyThe entrypoint handles one intercepted event to reject newly introduced dependencies that bypass an authenticated package registry without deferred work.
Immediate
Data retentionWhether data remains after use and who manages its storage.
Not retained

Often used with

All in Security