l-mb/python-refactoring-skills/py-security
Claude Code and agent skill by l-mb/python-refactoring-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Security vulnerability detection and remediation for Python codebases. Identifies SQL injection, hardcoded secrets, weak cryptography, and other OWASP vulnerabilities.
Install
npx vskill@latest install l-mb/python-refactoring-skills/py-securitySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Python Security Analysis and Remediation
Find and fix security vulnerabilities in Python code following Engineering Charter security principles.
Objectives
- Detect security vulnerabilities using automated scanners
- Identify SQL injection risks
- Find hardcoded secrets and credentials
- Detect weak cryptographic practices
- Fix vulnerabilities following secure coding patterns
- Prevent secrets from being committed to git
Required Tools
Add to `[dependency-groups]` dev: "bandit", "ruff"
- bandit: AST-based security scanner
- ruff --select S: Built-in Bandit rules (faster alternative)
Permissions: Run py-quality-setup first to configure .claude/settings.local.json with all needed tool permissions.
Discovery Phase
Run Security Scanners
Common Vulnerability Categories
High severity (fix immediately):
- S608: SQL injection via string formatting
- S105, S106, S107: Hardcoded passwords, secrets, keys
- S501, S506: Weak SSL/TLS configuration
- S324: Insecure hash functions (MD5, SHA1)
- S602, S603, S604, S605, S606, S607: Shell injection risks
Medium severity:
- S311: Insecure random number generation
- S301, S302, S303: Insecure deserialization (pickle)
- S701, S702: Jinja2 autoescape issues
Low severity (consider context):
- S101: Use of assert (disabled in production)
- S104: Binding to all interfaces (0.0.0.0)
Remediation Patterns
SQL Injection Prevention
Hardcoded Secrets Removal
Secure Random Number Generation
Secure Cryptography
Shell Command Injection Prevention
Git Hooks Integration
Add secret detection to git hooks (complement to py-git-hooks):
Verification Checklist
- [ ]
ruff check . --select Sreports no security issues - [ ]
bandit -r . -llreports no medium/high severity issues - [ ] No hardcoded secrets in codebase (grep for password, secret, api_key, token)
- [ ] Secrets loaded from environment variables or .env file
- [ ] .env file is in .gitignore
- [ ] All SQL queries use parametrized queries
- [ ] All tests pass after security fixes
Examples
Example: Security audit workflow
Related Skills
- Prerequisites: py-quality-setup (configure ruff for security checks)
- Enforcement: py-git-hooks (add security scanning to pre-commit)
- See also: py-code-health (cleanup after security fixes)
Security
- Security scanPassed, 85 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/py-security/SKILL.md
Popularity
- Repository stars
- 9
- 7-day trend score
- 12
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 Mar 2026, 8 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/l-mb/python-refactoring-skills/py-security)