python-refactor
Warn
Audited by Gen Agent Trust Hub on Aug 12, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONREMOTE_CODE_EXECUTION
Full Analysis
- [COMMAND_EXECUTION]: Multiple scripts within the skill utilize
subprocess.runto execute external command-line tools for code analysis. scripts/analyze_multi_metrics.pyexecutescomplexipyandradonto collect complexity metrics.scripts/analyze_with_flake8.pyexecutesflake8to perform linting.- These calls use string interpolation for file paths, which could be exploited for command injection if the agent is directed to process maliciously named files.
- [REMOTE_CODE_EXECUTION]: The script
scripts/benchmark_changes.pyperforms dynamic code execution by loading local Python modules usingimportlib.util.spec_from_file_locationandspec.loader.exec_module. - This is used to load both the 'before' and 'after' versions of the code to run performance comparisons.
- This behavior results in the execution of any code contained within the files being refactored, posing a significant risk if those files contain malicious payloads.
- [INDIRECT_PROMPT_INJECTION]: The skill is designed to ingest and process untrusted data in the form of local Python source code.
- Ingestion points: Several scripts (
analyze_multi_metrics.py,benchmark_changes.py,measure_complexity.py) read and parse Python files provided by the user/agent. - Boundary markers: None. The scripts treat the file content as standard source code without special delimiters to prevent instruction injection.
- Capability inventory: The skill has access to shell command execution (
subprocess.run) and dynamic Python execution (importlib). - Sanitization: There is no evidence of sanitization for file paths passed to shell commands or for the content executed during benchmarking.
- This combination creates a surface where maliciously crafted source code could attempt to influence the agent's behavior or exploit the dynamic execution capabilities.
Audit Metadata