python-cli-patterns
Warn
Audited by Gen Agent Trust Hub on Jul 13, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONCREDENTIALS_UNSAFE
Full Analysis
- [COMMAND_EXECUTION]: The documentation file
references/typer-patterns.md(lines 177-184) includes a pattern for executing raw SQL queries passed directly from command-line arguments:result = ctx.obj.db.execute(sql). This pattern facilitates SQL injection vulnerabilities if implemented in tools that process untrusted input. - [CREDENTIALS_UNSAFE]: The file
assets/cli-template.py(lines 208-214) provides aconfig showcommand that reads the application's configuration file (~/.config/myapp/config.toml) and prints its entire contents to the console. This operation can expose secrets, API keys, or database credentials stored within the configuration file. - [CREDENTIALS_UNSAFE]: The documentation in
references/configuration.mdprovides code examples for handling sensitive environment variables such asDB_PASSWORD,DATABASE_PASSWORD, andapi_key. While presented as patterns, these illustrate the handling of high-value secrets within the CLI environment.
Audit Metadata