creating-tools

Warn

Audited by Gen Agent Trust Hub on Sep 29, 2026

Risk Level: MEDIUMCOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTIONDYNAMIC_EXECUTION
Full Analysis
  • [COMMAND_EXECUTION]: The script scripts/record-run.mjs executes arbitrary commands using node:child_process.spawnSync. The command and its arguments are passed directly from user/agent input, allowing for the execution of any binary available on the system.
  • Evidence: scripts/record-run.mjs (lines 90-95): result = spawnSync(command[0], command.slice(1), { stdio: ["inherit", logFd, logFd], env: { ...process.env, RUN_OUTPUT_DIR: absOut } });
  • [COMMAND_EXECUTION]: The scripts scripts/record-run.mjs and scripts/scaffold-tool.mjs use the --docs-dir argument to construct file system paths without sanitization or validation. This could allow an attacker to specify paths that lead to directory traversal, causing the scripts to create directories or write files outside the intended docs/tools/ hierarchy.
  • Evidence: scripts/scaffold-tool.mjs (lines 89-91): const toolDir = join(docsDir, slug); mkdirSync(join(toolDir, "runs"), { recursive: true });
  • Evidence: scripts/record-run.mjs (lines 80-84): const toolDir = join(docsDir, slug); if (!existsSync(toolDir) || !statSync(toolDir).isDirectory()) { ... }
  • [DYNAMIC_EXECUTION]: The skill implements a pattern where scaffold-tool.mjs generates a directory structure and record-run.mjs executes code within that structure. This runtime execution of dynamically identified tools constitutes dynamic execution.
  • Evidence: scripts/record-run.mjs (lines 90-95) executes the command provided at runtime.
  • [INDIRECT_PROMPT_INJECTION]: The scaffold-tool.mjs script performs unsanitized string interpolation of user-provided inputs (slug, type, repo, path) into a README.md file using a template. These files are intended to be read by the agent in future interactions, creating an attack surface for indirect prompt injection if the inputs contain malicious instructions.
  • Ingestion points: Command-line arguments slug, --type, --repo, and --path in scripts/scaffold-tool.mjs entering the agent context via the generated README files.
  • Boundary markers: Absent in the generated README.md files.
  • Capability inventory: The agent has the capability to execute commands via record-run.mjs and write files via scaffold-tool.mjs and record-run.mjs across the scripts/ directory.
  • Sanitization: Absent; the script uses replaceAll to directly insert values into the markdown content.
  • Evidence: scripts/scaffold-tool.mjs (lines 102-108): const rendered = readFileSync(template, "utf8").replaceAll("{{SLUG}}", slug).replaceAll("{{TYPE}}", type).replaceAll("{{MODEL}}", model).replaceAll("{{REPO}}", repo || "self-contained").replaceAll("{{PATH}}", relpath || "./").replaceAll("{{DATE}}", today);
Audit Metadata
Risk Level
MEDIUM
Analyzed
Sep 29, 2026, 01:36 PM