Hook Development
Pass
Audited by Gen Agent Trust Hub on Nov 23, 2026
Risk Level: SAFECOMMAND_EXECUTIONDATA_EXFILTRATIONINDIRECT_PROMPT_INJECTIONPERSISTENCE
Full Analysis
- [INDIRECT_PROMPT_INJECTION]: The skill processes untrusted tool inputs and user prompts as part of its hook logic, creating a surface for indirect prompt injection.
- Ingestion points: Hook scripts (e.g.,
examples/validate-write.shandexamples/validate-bash.sh) receive JSON payloads via stdin containingtool_input,tool_result, anduser_prompt. - Boundary markers: The documentation suggests using LLM-driven prompt hooks to evaluate these inputs using natural language reasoning and provides templates for security-focused prompts.
- Capability inventory: Hooks have the capability to execute shell commands, access the filesystem, and modify session environment variables via the
$CLAUDE_ENV_FILE. - Sanitization: The skill demonstrates best practices for sanitization, including explicit checks for path traversal (
".."), restricted system directories (/etc,/sys), and regex-based secret pattern detection. - [COMMAND_EXECUTION]: The skill provides tools and guidance for executing local bash scripts triggered by agent events.
scripts/test-hook.shexecutes a user-specified script to verify its behavior before deployment.- The skill documents the "Command Hook" type which enables automated local script execution tied to the agent's lifecycle.
- [DATA_EXFILTRATION]: Documentation provides patterns for sending session information to external systems for logging and monitoring purposes.
references/advanced.mdincludes implementation examples for sending data to Slack viacurland logging session data to external PostgreSQL databases.- [PERSISTENCE]: The skill illustrates how to maintain local logs of agent interactions across sessions.
- Documentation shows a pattern for appending audit data and tool execution history to
~/.claude/audit.log.
Audit Metadata