Nox-Lumen MfgNox-Lumen Mfg

Python static analysis

Python L1 coordinates four skills across safety, ergonomics, types, and deep SAST.

SkillAxisOne-liner
banditSecurityInjection / hard-coded secrets / unsafe APIs
ruffStyle + compositesUltrafast lint (Rust core, 900+ rules) replacing Flake8/Pylint/isort/Black
mypyTypingPEP 484 semantics
semgrepSASTCustom YAML semantics, multi-language engine

bandit

Role: Python-specific security scanning.

ClassExamples
SQL injectionString-built SQL
Command injectionsubprocess(shell=True)
Hard-coded secretsapi_key = "sk-..."
Dangerous builtinsUnsafe pickle, eval, naked yaml.load
Weak cryptoMD5/SHA1 for passwords

Triggers: “Python security sweep”, “bandit run”, “SQLi risk?”

ruff

Role: Fastest lint in the ecosystem (Rust-backed), consolidating Flake8 + Pylint + isort + Black.

  • 900+ rules
  • Seconds on large repos
  • Rule families: E / W / F / I / N, …
  • Can format like black

Triggers: “Python lint”, “style gate”, “run ruff”

mypy

Role: Static typing per PEP 484.

IssueExample
Type mismatchdef f(x: int) -> str: return x
Missing annotationsParams / returns untyped
Bad assignmentsa: list[int] = ["x"]
Optional mishandlingSkipping None checks

Triggers: “type check CI”, “mypy failures”, “Optional misuse”

semgrep

Role: Semantic SAST spanning many languages via YAML rules.

ClassDetail
Injection classesCommon OWASP patterns
Secret leakageHard-coded creds
Taint trackingUntrusted input → dangerous sinks
Custom rulesOrg-specific policies

vs bandit: bandit = Python AST heuristics; semgrep = programmable semantic engine for Python/JS/Java/Go/Ruby/…

Triggers: “SAST pass”, “author custom rule”, “polyglot security sweep”

ruff      → baseline lint
mypy      → typing gate
bandit    → security gate
semgrep   → custom / polyglot extras

Emit CodeEvidence → hand to code-review.

On this page