Bandit
$ bandit Foundation Low Riskbandit walks Python ASTs to flag common security flaws (eval, pickle, shell=True, weak hashes, hardcoded passwords). It runs offline and read-only, with -f json -q and -ll severity flags keeping agent security checks fast and structured.
brew install bandit Python AST security checks finish in milliseconds locally via bandit -f json without any MCP server.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports -f json, -q, -ll/-ii severity/confidence filters, and --exit-zero.
- Native
-f jsonand-qnon-interactive flags
Purely read-only offline Python AST analyzer; never executes target code or makes network calls.
- Zero code execution, zero writes, zero network activity
Easy across brew, pip, and uvx, requiring only a Python runtime.
- Standard PyPI/Homebrew availability
Fast, focused Python security check, though single-language and narrower than semgrep or ruff S-rules.
- Python-only AST security rules
Official PyCQA (Python Code Quality Authority) foundation project under Apache-2.0.
- PyCQA stewardship
Clear ReadTheDocs manual covering every Bxxx test ID and pyproject.toml config.
- Official docs at bandit.readthedocs.io
Security, Auth & Guardrails
None required; analyzes local Python source ASTs offline.
100% free, offline, and open-source (Apache-2.0).
# Bandit Agent Rules - Always pass `-f json -q` (and `-ll` to filter out noisy low-severity info findings). - Use `-x tests/` or `pyproject.toml` `[tool.bandit]` exclusions so `assert` warnings in `pytest` files do not pollute results.
Agent-Ready Command Recipes
Safe Read-Only Queries
bandit -r src/ -f json -ll -q
Reports medium/high severity findings (-ll) in JSON with progress bars suppressed (-q).
Strengths for Agents
- + 100% offline, strictly read-only Python AST security scanner with
-f json -q. - + Granular
-ll/-iiseverity and confidence thresholds trim false positives.
Caveats & Pitfalls
- ! Python-only; scanning test directories without
-x tests/triggers noisyB101(assert) warnings.