jev-secret-guard
Claude Code hook that blocks known key formats locally and sends unknown high-entropy strings to Jev only in masked form.
Overview
jev-secret-guard is a Claude Code PreToolUse hook that stops an agent from writing, committing or sending secrets. Known key formats (GitHub, AWS, OpenAI, Anthropic, Stripe, Slack, Google, private keys) are blocked instantly on the machine with no API call. Unknown high-entropy strings are sent to Jev in masked form only: the first three characters, the length, the character set and up to 300 characters of the surrounding line with the value replaced, so checking for a leak never causes one.
If Jev's probability is 0.80 or more the action is blocked with a reason; between 0.30 and 0.80 the user is asked; if Jev is down, slow or there is no key, the user is asked, so the guard fails toward a human. Placeholders, commit hashes and file paths are ignored. On 12 masked unknown-format strings against real Jev, it blocked 6 of 6 secrets and 0 of 6 harmless strings, with 3 harmless strings prompting the user. Offline tests use a fake Jev. It pairs with a companion auto-approve project and is MIT-licensed.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Is this masked high-entropy string a real credential? | yes · no |
How it works
- Hook intercepts Write, Edit or Bash
- Block known key formats locally
- Mask unknown high-entropy strings and ask Jev
- Block at 0.80+, ask the user at 0.30-0.80 or on errors
- Ignore placeholders, hashes and paths
Strengths
- Never sends secret values
- Fails toward asking a human
- Known formats handled offline
- Offline test suite
Caveats
- Small calibration set (12 strings)
- Some harmless strings prompt the user
- Requires a TypeSafe key for unknown formats
Getting started
Set TYPESAFE_API_KEY, clone the repo, and add a PreToolUse hook for Write|Edit|Bash running python /path/to/jev_secret_guard.py in ~/.claude/settings.jsonAt a glance
- Type
- Hook
- Status
- beta
- Language
- Python
- Runtime
- Claude Code hook
- Has code
- yes
- Has tests
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Agent security: Claude Code PreToolUse hook that blocks known key formats locally and sends unknown high-entropy strings to Jev only in masked form for a `Noul` on whether they are real credentials, blocking at 0.80 and asking the human from 0.30 or whenever Jev is unavailable; 6 of 6 secrets and 0 of 6 benign strings were blocked in its published calibration.
yibie/awesome-jevClaude Code PreToolUse hook that stops agents writing or sending secrets: known key formats are blocked locally, unknown high-entropy strings go to Jev as a Noul only in masked form so the check never leaks the value; p ≥ 0.80 blocks, 0.30 to 0.80 or any Jev error asks the human. 6 of 6 secrets and 0 of 6 benign strings blocked in its published calibration
AnotiaWang/awesome-decision-models
Frequently asked questions
What does Jev decide?
Whether a masked, unknown-format high-entropy string is a real credential.
Is the secret sent to Jev?
No. Only a masked description and surrounding context are sent.
What if Jev is unavailable?
The hook asks you rather than allowing silently.
Related projects
Safety gate plugin for Claude Code, Codex CLI and Antigravity: local sensitive-file checks, then Jev judges blast radius.
PluginbetaTypeScriptClaude Code mod that answers auto mode's tool-call permission question with eight Jev yes/no checks behind a shell-aware blocklist.
ProjectbetaTypeScriptClaude Code hook where Jev reviews each tool call against risk, authorization and scope questions and a local policy returns allow or deny.
ProjectbetaGoTool-call firewall for Claude Code hooks and MCP servers: Jev answers seven risk questions and code maps them to allow, ask or deny.
MCP serverbetaTypeScriptRing Zero: kernel-level runtime security for AI agents, with Jev as an optional check that can only raise severity, never permit.
ServicebetaOpenCode 2 plugin that asks Jev six questions about every shell command (local or remote via FarHand) and prompts unless clearly safe.
MCP serverbetaTypeScript