---
title: "Bandit Python SAST"
description: "Runs Bandit over Python sources (static analysis only, the code is never imported or executed). Skipped when the workspace has no .py files."
url: https://openaudit.se/auditors/code.bandit/
---

# Bandit Python SAST

`code.bandit`

Runs Bandit over Python sources (static analysis only, the code is never imported or executed). Skipped when the workspace has no .py files.

- **Engine:** Wrapped scanner
- **Wraps:** `bandit`
- **Targets:** Codebase
- **Areas:** Security
- **Runs:** By default, when the target applies
- **Network:** Only the target itself

## Run only this auditor

```sh
bunx @openaudit/cli . --only code.bandit
```

Wraps bandit. When it isn't installed, the auditor is skipped with an install hint and the rest of the audit runs.

## More security auditors

- [Secrets in source](https://openaudit.se/auditors/code.secrets/) (`code.secrets`)
- [Static security analysis](https://openaudit.se/auditors/code.security/) (`code.security`)
- [Hidden Unicode](https://openaudit.se/auditors/code.unicode/) (`code.unicode`)
- [API definition and server configuration](https://openaudit.se/auditors/code.api/) (`code.api`)
- [AI agent configuration](https://openaudit.se/auditors/code.agent-config/) (`code.agent-config`)
- [gitleaks secret scan](https://openaudit.se/auditors/code.gitleaks/) (`code.gitleaks`)
- [Semgrep SAST](https://openaudit.se/auditors/code.semgrep/) (`code.semgrep`)
- [Trivy filesystem scan](https://openaudit.se/auditors/code.trivy-fs/) (`code.trivy-fs`)
