Bandit
termKept in this browser · My desk
An open-source static analysis tool that looks for common security issues in Python code by building each file's syntax tree and running test plugins against it.
Its tests are numbered by family, from B1xx (miscellaneous) to B7xx (cross-site scripting): B602 flags subprocess calls with shell=True, B506 yaml.load, B301 pickle, B501 Requests calls with verify=False and B507 Paramiko's AutoAddPolicy. A reviewed exception is marked on its line with a nosec comment that names the test, such as nosec B603, and settings can live in a .bandit file or a tool.bandit table in pyproject.toml. It reads patterns, not intent.
Also known as: bandit (Python), PyCQA Bandit, nosec
Sources
- Bandit documentation (read 2026-10-27): a tool designed to find common security issues in Python code; builds an AST per file and runs plugins against it
- Bandit documentation, test plugins (read 2026-10-27): ID groupings B1xx to B7xx and the complete listing
- Bandit documentation, configuration (read 2026-10-27): the .bandit file, the tool.bandit table in pyproject.toml, nosec with test IDs