Prompt Secret Guard
A deterministic Claude Code UserPromptSubmit gate that suppresses the original prompt when it detects a bounded set of high-confidence private keys and live credential formats.
Runs on
What it does
Block prompts containing high-confidence credential formats before model processing.
When it fires
- implementation
- operations
How it behaves
Reject submitted prompts that contain high-confidence credential formats without echoing their contents.
It does not reveal, store, transmit, rotate, or revoke a detected credential.
It does not inspect attachments, referenced files, prior turns, or model output.
It does not claim that its bounded high-confidence patterns replace a secret scanning service.
It does not provide a prompt-controlled allowlist or inline bypass marker.
Configuration
targets/claude-code/prompt-secret-guard.mjs
- Version
- 1.0.0
- Requires
- node
- Licence
- RiskThis automatic gate blocks prompts containing high-confidence credential formats before model processing; 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 block prompts containing high-confidence credential formats before model processing without deferred work.
- Immediate
- Data retentionWhether data remains after use and who manages its storage.
- Not retained
Often used with
All in Security