Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By ArchitektApxv0.2.0MITIn 1 marketplace
Credential leak protection for Claude Code sessions. A PreToolUse hook blocks known secret-printing commands before they run, and a PostToolUse hook scans every tool output with betterleaks and redacts secrets before they reach the model.
Claude loads one when your task matches it, or you run it by name.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
secrets, credentials, leak-prevention, betterleaks, hooks, redaction
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Executables (bin/) — files in this plugin's bin/ directory are added to the Bash tool's PATH while the plugin is enabled.
Credential leak protection for Claude Code. Auth Guard keeps secrets out of your session transcripts with layered prevention, and finds the ones that got there anyway.
Two hooks
secret-guard.sh (PreToolUse, Bash): blocks or questions commands whose purpose is to print credentials (git credential fill, gh auth token, security find-generic-password, vault/password-manager reads, credential file access), with whitespace/quote normalization so trivial respellings do not slip past. Low-confidence matches ask instead of deny, so you stay in the loop.

output-guard.sh (PostToolUse, Bash/Read/Grep/WebFetch): scans every tool output with betterleaks and rewrites it before the model sees it, replacing each finding with [REDACTED:<rule-id>]. This is the layer that catches the unanticipated route: secrets inside API responses, config dumps, logs, or files that no denylist modeled. Fails closed (output withheld) on scanner errors; fails open with a visible warning only when betterleaks is not installed at all.
![A Claude Code session: a local CLI prints a GitHub token, and the tool output reaches the model as token=[REDACTED:github-pat]](https://raw.githubusercontent.com/architektapx/auth-guard/master/docs/assets/redact.gif)
Three skills
| Skill | What it does |
|---|---|
/auth-guard:doctor | Verifies every layer: dependencies, hook presence and registration, sandbox and deny-rule settings, plus live self-tests of both hooks with a synthetic token. |
/auth-guard:global-settings | Merges the bundled deny rules (config/deny-rules.json) into your ~/.claude/settings.json. Additive and idempotent: dry-run first, timestamped backup, never removes or reorders your entries. |
/auth-guard:audit-transcripts | Scans all stored session transcripts with betterleaks (regex fallback without it) and reports file paths and rule ids, never the matched text. |
A deny-rule baseline (config/deny-rules.json): Read()/Bash() permission denies plus sandbox.credentials.files entries for common credential stores (SSH, AWS, Azure, gcloud-style caches, gh, docker, kube, gnupg, browser profiles, shell history, and more). Some entries are opinionated; denying ~/.azure breaks az inside sessions, for example. Delete what does not fit after applying.
/plugin marketplace add ArchitektApx/Auth-Guard
/plugin install auth-guard@auth-guard
The hooks need jq and betterleaks on the PATH. Without betterleaks the output scan is skipped with a warning and the audit falls back to regex patterns.
macOS (Homebrew):
brew install jq betterleaks
Debian / Ubuntu:
sudo apt install jq golang
go install github.com/betterleaks/betterleaks@latest
Fedora:
sudo dnf install jq betterleaks
Arch:
sudo pacman -S jq go
go install github.com/betterleaks/betterleaks@latest
The hooks run with the environment of the Claude Code process, which (especially when launched from a GUI) may not carry your shell's PATH. They therefore search the standard install locations themselves: /opt/homebrew/bin, /usr/local/bin, ~/go/bin, and ~/.local/bin. If betterleaks lives somewhere else, symlink it into one of those. A docker pull ghcr.io/betterleaks/betterleaks install does not work for the hooks, since they expect a native betterleaks binary, not a container wrapper.
After installing, run /auth-guard:doctor in a fresh session, then /auth-guard:global-settings to apply the settings-side layers.
The built-in PreToolUse checks are curated here and cannot know your secret stores, your internal CLIs or your company-specific credential paths. Add your own in a JSON file:
mkdir -p ~/.config/auth-guard
# start from the shipped template: config/custom-checks.example.json
$EDITOR ~/.config/auth-guard/custom-checks.json
A deny always beats an ask, whichever side defined it, so a custom check can harden shipped coverage but never weaken it. Any error in the file fails closed and /auth-guard:doctor tells you which check is wrong.
The schema, the resolution order, the AUTH_GUARD_CUSTOM_CHECKS override and the failure semantics are documented in docs/custom-checks.md.
Claude Code has three separate enforcement domains, and a rule in one does nothing in the others:
npx claudepluginhub architektapx/auth-guard --plugin auth-guardPlugins from other owners that cover similar ground
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.