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, anddeletion-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.pyvia thebuild_reference_poolfunction. - 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_htmlfunction inscripts/render_cleanup_report.pydirectly interpolates evidence snippets into HTML list items using f-strings without escaping HTML-sensitive characters. - [COMMAND_EXECUTION]: The script
scripts/analyze_cleanup_candidates.pyusessubprocess.runto executegit ls-filesand its variants. This is used legitimately to efficiently identify project files while respecting.gitignorerules. The usage is scoped to standard project analysis tasks. - [DYNAMIC_EXECUTION]: The workflow in
SKILL.mdinstructs 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.gitandnode_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