code-cleanup-skill

Pass

Audited by Gen Agent Trust Hub on Jul 6, 2026

Risk Level: SAFECOMMAND_EXECUTIONDATA_EXFILTRATIONPROMPT_INJECTION
Full Analysis
  • [INDIRECT_PROMPT_INJECTION]: The skill processes untrusted project files (JS, TS, Python, etc.) to detect unused modules. It extracts snippets and symbol names from these files and includes them as "evidence" in the generated reports (cleanup-report.html, cleanup-report.md, and deletion-candidates.json). These reports are intended for review by the AI agent and the user. The lack of sanitization during the generation of these reports creates a surface for indirect prompt injection, where malicious instructions hidden in a project's source code could influence the agent's actions during the cleanup process.
  • Ingestion points: Project files are read into the analysis pool in scripts/analyze_cleanup_candidates.py via the build_reference_pool function.
  • Boundary markers: No specific delimiters or warnings to ignore embedded instructions are present in the report output.
  • Capability inventory: The agent is instructed to perform file deletions and execute shell commands (python3, git) as part of the defined workflow.
  • Sanitization: The render_report_html function in scripts/render_cleanup_report.py directly interpolates evidence snippets into HTML list items using f-strings without escaping HTML-sensitive characters.
  • [COMMAND_EXECUTION]: The script scripts/analyze_cleanup_candidates.py uses subprocess.run to execute git ls-files and its variants. This is used legitimately to efficiently identify project files while respecting .gitignore rules. The usage is scoped to standard project analysis tasks.
  • [DYNAMIC_EXECUTION]: The workflow in SKILL.md instructs the agent to execute a Python one-liner (python3 -c "import pathlib; ...") to recursively remove empty directories after files have been deleted. While this command includes guards to avoid sensitive directories like .git and node_modules, it constitutes the runtime generation and execution of code, which is a common pattern for conditional attacks or persistence if exploited, though here it aligns with the skill's primary purpose.
Audit Metadata
Risk Level
SAFE
Analyzed
Jul 6, 2026, 11:48 AM
Security Audit — agent-trust-hub — code-cleanup-skill