Lockfile origin guard
A deterministic Claude Code PreToolUse gate for git commit that reads bounded staged lockfiles and blocks insecure transport, credential-bearing origins, missing integrity metadata, or local and Git package resolutions.
Runs on
What it does
Inspect staged lockfile origins before commit and reject insecure or unverifiable package sources.
When it fires
- pre-commit
- review
- maintenance
How it behaves
Inspect bounded staged lockfile metadata before commit and reject high-confidence unsafe dependency origins.
It does not regenerate, normalize, sign, install, or verify the full dependency graph.
It does not send package origins, credentials, integrity values, or repository content anywhere.
It does not claim that an accepted lockfile is reproducible, authentic, or vulnerability-free.
It does not allow command flags or repository files to disable a detected origin violation.
Configuration
targets/claude-code/lockfile-origin-guard.mjs
- Version
- 1.0.0
- Requires
- Shell command guard
- Licence
- RiskThis automatic gate inspects staged lockfile origins before commit and reject insecure or unverifiable package sources; 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
- LatencyTo inspect staged lockfile origins before commit and reject insecure or unverifiable package sources, the entrypoint may run a bounded local subprocess before returning.
- Bounded
- Data retentionWhether data remains after use and who manages its storage.
- Not retained
Often used with
All in Security