A security linter for Python code
open sourceApache-2.0free
Bandit finds common security issues in Python code: it builds an abstract syntax tree from each file, runs plugins against its nodes (hard-coded passwords, shell injection, insecure use of pickle, yaml.load, weak cryptography, SQL built from strings and more) and writes a report with each issue's severity and confidence. It runs from the command line, in pre-commit and in CI, can be configured to skip tests or files, and outputs text, JSON, SARIF and other formats. It began in the OpenStack Security Project and is now maintained by PyCQA.
Problems it solves
- find security issues in my Python code before it ships
- flag hard-coded passwords and shell injection in a Python codebase
- add a Python security scan to CI
- a free static analysis tool for Python security
Features
- AST-based security checks for Python
- severity and confidence for each issue
- plugins for common issue types
- configurable tests, skips and baselines
- runs in pre-commit and CI
- text, JSON, SARIF and other report formats
Capabilities
| Has a command line tool | plan not known |
|---|---|
| Takes plugins | plan not known |
Alternatives
The same job
These do what Bandit does.
- Semgrep Code security: SAST, supply chain and secrets scanning with rules that look like code
- CodeQL GitHub's semantic code analysis engine for finding vulnerabilities
- SonarQube Code confidence for the agentic software factory
- DeepSource AI code review platform that combines static analysis with AI review agents
- Bearer CLI Code security scanning tool (SAST) to discover, filter and prioritize security and privacy risks
- Codacy Code Quality & Security for AI-Assisted Engineering
