Documentation
¶
Overview ¶
Command secretguard is an example agenthooks consumer: it scans every tool call's input for credential-shaped strings before execution. On a hit it forces the provider's confirmation prompt, so the user can accept the risk and continue — or reject and block the call. On providers/events without a confirmation prompt (Codex, Cursor's generic preToolUse, OpenCode) the call is blocked outright, because letting a detected secret through unchallenged is the one outcome this hook exists to prevent.
Install it for a project with the install package, or by hand, e.g. Claude Code .claude/settings.json:
{"hooks": {"PreToolUse": [{"matcher": "", "hooks": [
{"type": "command", "command": "secretguard agenthooks run --provider=claude-code", "timeout": 10}
]}]}}
Click to show internal directories.
Click to hide internal directories.