← all rules

code/ai-bare-except-pass

Swallowed exception (bare except: pass)

mediumAI-generated codeai-generatedCWE-703python

What it detects

A bare `except:`/`except Exception:` that only `pass`es hides every error — including auth failures, integrity-check failures, and security-relevant exceptions — letting the code continue in an unexpected state. Catch the specific exception and handle (or re-raise) it.

How it runs

Applied line-by-line across source files, INCLUDING comments (the disclaimers and TODO markers are the signal). Matches placeholder credential literals, deferred-security TODO/FIXME comments, "not for production" disclaimers, and swallowed exceptions. The detector's own rule prose is skipped so the scanner doesn't flag itself.

Found a false positive or want this rule tuned? File an issue. You can also suppress per-repo via a .repoguardignore line.