hook-authoring
Pass
Audited by Gen Agent Trust Hub on Mar 11, 2026
Risk Level: SAFEPROMPT_INJECTIONCOMMAND_EXECUTION
Full Analysis
- [PROMPT_INJECTION]: The skill provides patterns for implementing hooks that process external, untrusted data, creating an attack surface for indirect prompt injection.
- Ingestion points: The
on_post_tool_usecallback processes potentially attacker-controlledtool_output, andon_user_prompt_submitprocesses the user'smessage(documented in SKILL.md and modules/sdk-callbacks.md). - Boundary markers: Documentation examples demonstrate simple string interpolation for context injection (e.g.,
f"{context}\n\n{message}") without mandatory use of delimiters or 'ignore' instructions for the agent. - Capability inventory: Hooks can execute shell commands via the Bash tool, modify files via the Edit tool, and perform network requests using
aiohttporrequestsas shown in the performance guidelines. - Sanitization: The skill correctly provides defensive patterns, such as the
SecureLoggingHooksregex implementation used to redact credentials from tool outputs before logging. - [COMMAND_EXECUTION]: The skill documents and provides patterns for executing arbitrary shell commands through the agent's runtime environment.
- SKILL.md describes the use of declarative JSON hooks with
"type": "command"to run shell scripts likevalidate-command.shorformat-on-save.sh. - The
scripts/README.mddocumentation recommends integrating validation scripts into Gitpre-commithooks and CI/CD pipelines.
Audit Metadata