extract-python-environment-variables

Pass

Audited by Gen Agent Trust Hub on Oct 17, 2026

Risk Level: SAFE
Full Analysis
  • Automated Refactoring: The skill modifies Python source code and configuration files. It uses the ast module to programmatically analyze and transform the code, which is more reliable than text-based replacement. It includes safety checks, such as re-parsing the modified code to ensure syntax validity before writing changes to disk.
  • Safe File Management: File writes are performed atomically using temporary files. This ensures that the original file remains intact if an error occurs during the writing process, preventing partial writes or file corruption.
  • Configuration Best Practices: By identifying hardcoded configuration (such as model names) and environment variable defaults, the skill helps developers move sensitive or configurable data into environment variables, reducing the risk of hardcoding secrets in source control.
  • Directory Scoping: The scanning logic specifically skips non-source directories like virtual environments (.venv), version control folders (.git), and test suites. This prevents the tool from unintendedly modifying third-party dependencies or test infrastructure.
  • Indirect Prompt Injection Surface: The skill processes external Python source files as input and has the capability to modify them. While this constitutes an attack surface, the risk is mitigated by the use of structured AST parsing and round-trip validation, and the tool is intended for use by developers on their own codebases.
Audit Metadata
Risk Level
SAFE
Analyzed
Oct 17, 2026, 06:18 PM