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 FabienSallesv0.2.2MITIn 1 marketplace
Blocks Bash commands with prompt-injection payloads and refuses reads of credential files such as .env and id_rsa. Its CLAUDE.md scanner runs at session start and needs jq installed.
Trending plugins
7-day copy clicks
You run one by typing its /name in Claude Code.
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
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Runtime security hooks for Claude Code: defends against CLAUDE.md injection and Bash prompt-injection attempts that the model could otherwise be tricked into executing.
Complements audit (codebase audit overlay) and netresearch/security-audit-skill (on-demand audit). Where those scan code on demand, this plugin runs every session and every Bash call.
| Hook | Event | What it does |
|---|---|---|
claudemd-scanner.sh | SessionStart | Scans ~/.claude/CLAUDE.md, ./CLAUDE.md, ./.claude/CLAUDE.md for prompt-injection patterns (role overrides, system tags, exfiltration hints, zero-width chars). Reports its findings to you and to Claude as SessionStart JSON on stdout. Non-blocking. |
prompt-injection-detector.sh | PreToolUse (Bash) | Inspects the Bash command string for AI-instruction overrides (ignore previous instructions, <|im_start|>system, [INST], etc.). Blocks (exit 2) on match. |
secret-file-guard.sh | PreToolUse (Read, Grep, Bash) | Refuses to open credential files: .env.local, .env.*.local, auth.json, credentials.json, *.pem, id_rsa, id_ed25519, .npmrc, .pgpass, .netrc, anything under .ssh/. Blocks (exit 2) on match. |
claudemd-scanner catches injection in config files loaded into the system prompt. Claude Code does not natively sanitize CLAUDE.md.prompt-injection-detector catches injection in commands the model is asked to run. Claude Code's native command blocklist is static (blocks curl, wget by default); it does not scan for dynamic injection payloads.secret-file-guard stops a credential from entering the transcript in the first place.secret-file-guard, and why it existsThis README previously argued that secret scanning was unnecessary, on the grounds that the model already flags secrets it encounters via the ~/.claude/CLAUDE.md § Secrets awareness rule. That reasoning was wrong, and it failed in practice: a session looking for APP_ENV opened .env.local (where it was not defined) and printed a Keycloak client secret into the transcript before flagging it.
The CLAUDE.md rule governs what the model does after reading. By then the credential is already in the context window, the transcript on disk, and any uploaded session. Flagging is remediation, not prevention. The only useful guarantee is at the tool boundary, which is what this hook enforces.
The matching is deliberately coarse: any mention of a credential path is refused, not just a read. A shell command line cannot be parsed with a regex, so narrowing to cat/head/sed would leak through every construct not enumerated. A false positive costs one rephrased command (grep APP_ENV .env still works); a miss costs a credential.
permissions.deny/security-runtime:setup
Hooks alone are enough to block. /setup additionally writes Read(...) deny rules into ~/.claude/settings.json, enforced by the harness before hooks run (so they survive disableAllHooks), and merged into sandbox.filesystem.denyRead if the sandbox is ever enabled. Idempotent, backs the file up first.
From the marketplace root (the suites source the harness of the sibling shell-test plugin, so they run from a checkout, not from an installed copy, and they need jq):
bash plugins/security-runtime/tests/test_prompt-injection-detector.sh
bash plugins/security-runtime/tests/test_claudemd-scanner.sh
bash plugins/security-runtime/tests/test_secret-file-guard.sh
npm run verify -- shell-suites # every hook and shell suite of the marketplace
bash (POSIX features only)jq (for parsing the stdin JSON payload from Claude Code)security-runtime/
├── .claude-plugin/plugin.json
├── commands/
│ └── setup.md
├── hooks/
│ ├── hooks.json
│ └── scripts/
│ ├── claudemd-scanner.sh
│ ├── prompt-injection-detector.sh
│ └── secret-file-guard.sh
└── tests/
├── test_claudemd-scanner.sh
├── test_prompt-injection-detector.sh
└── test_secret-file-guard.sh
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.
npx claudepluginhub fabiensalles/claude-marketplace --plugin security-runtimePlugins from other owners that cover similar ground