Stop yourself from pasting a private key into Claude Code with a UserPromptSubmit hook
Deny rules and write guards protect files on disk. They do nothing if you paste a private key, seed phrase, or API token into the prompt itself. A UserPromptSubmit hook can catch that shape before the model ever sees it. The hook Save this as .claude/hooks/block-secret-prompts.sh and make it execut…
Read the full story at DEV Community — AI ↗
Timeline · 1 report
- 2026-11-18 00:54 · DEV Community — AI
Stop yourself from pasting a private key into Claude Code with a UserPromptSubmit hook