/security-guardrails:hook-safety-reviewfrom security-guardrails
Reviews a single hook definition for command injection, data exfiltration, and silent failure before enabling it. Use when activating or modifying any hook recipe, lifecycle hook, or git hook.
Ships in security-guardrails. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Review a hook definition before it is enabled so command injection, data exfiltration, and silent failure cannot ride in on automation. Hooks run automatically with the agent's privileges; a malicious or sloppy hook executes without any further review once it is on.
Do not use for broad agent-config audits — that is the agent-config-security-audit skill. This skill is the enablement gate for one hook at a time.
Inventory the trigger surface. Identify the event (pre-tool, post-tool, session start, commit), the matcher pattern, and how often it fires. A catch-all matcher on a high-frequency event deserves the strictest review.
Scan for command injection. Any user- or model-controlled value interpolated into a shell string is a P0 until proven bounded:
rg -n '\$\{?[A-Za-z_]+\}?|\$\(|`' <hook-file> # interpolation and substitution
rg -n 'eval|sh -c|bash -c|Invoke-Expression' <hook-file>
Scan for outbound network. Hooks should not phone home:
rg -n 'curl|wget|nc |Invoke-WebRequest|Invoke-RestMethod' <hook-file>
Any hit needs a documented justification and explicit user approval.
Scan for silent failure. Error suppression hides both bugs and attacks:
rg -n '\|\| true|2>/dev/null|2>\$null|exit 0' <hook-file>
A hook that swallows its own failures cannot be trusted to gate anything.
Check scope and privilege. Does the body read or write outside the repo? Does it touch credentials, dotfiles, or agent config? Flag absolute paths and home-directory access.
Classify and report. Use the same levels as the security-audit command: P0 direct risk (injection, exfiltration, secret access) — do not enable; P1 weakened controls (suppression, over-broad matcher) — fix before enabling; Note — best-practice gap, log it.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub yeaight7/agent-powerups --plugin security-guardrails6 skills in this plugin
/agent-config-security-auditUse when modifying agent config files, committing configuration changes, onboarding a repository with existing agent configs, or running a periodic config hygiene check./filesystem-mcp-guardrailsUse when designing or reviewing filesystem MCP access, path boundaries, allowed roots, method allowlists, and safe local file operations./mcp-risk-reviewUse when an MCP server is about to be enabled, added to agent config, or upgraded -- a staged server config is a candidate for activation, a third-party server is proposed from a registry, or an existing entry changes transport, credentials, or tool surface./red-team-eval-authoringUse when creating or reviewing red-team eval plugins, attack templates, grader rubrics, safety fixtures, or model-risk test metadata./secret-leak-preflightUse when about to commit, push, or publish -- staged changes touch config or environment files, generated artifacts (relay sessions, logs, build output) are being added, or the session handled credentials even indirectly.Other plugins' skills for the same job