Bandit by PyCQA

September 30, 2025 ยท View on GitHub

The official Bandit Action developed by the PyCQA.

Usage

Here is a minimal complete example workflow to create a Code Scanning action using Bandit.

name: Bandit

on:
  workflow_dispatch:

jobs:
  analyze:
    runs-on: ubuntu-latest
    permissions:
      # required for all workflows
      security-events: write
      # only required for workflows in private repositories
      actions: read
      contents: read
    steps:
      - name: Perform Bandit Analysis
        uses: PyCQA/bandit-action@v1

Inputs

NameDescriptionRequiredDefault Value
python-versionVersion of Python to useFalse"3.9"
configfileConfig file to use for selecting plugins and overriding defaultsFalse"DEFAULT"
profileProfile to use (defaults to executing all tests)False"DEFAULT"
testsComma-separated list of test IDs to runFalse"DEFAULT"
skipsComma-separated list of test IDs to skipFalse"DEFAULT"
severityReport only issues of a given severity level or higher. "all" and "low" are likely to produce the same results, but it is possible for rules to be undefined which will not be listed in "low". Options include: {all, high, medium, low}False"DEFAULT"
confidenceReport only issues of a given confidence level or higher. "all" and "low" are likely to produce the same results, but it is possible for rules to be undefined which will not be listed in "low". Options include: {all, high, medium, low}False"DEFAULT"
excludeComma-separated list of paths (glob patterns supported) to exclude from scan (note that these are in addition to the excluded paths provided in the config file)False".svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg"
baselinePath of a baseline report to compare against (only JSON-formatted files are accepted)False"DEFAULT"
iniPath to a .bandit file that supplies command line argumentsFalse"DEFAULT"
targetsSource file(s) or directory(s) to be testedFalse"."