18 Active Rules

AI Guard Rules Catalog

Every rule is purpose-built to catch patterns that AI coding assistants (Copilot, Claude, Cursor) consistently get wrong. Zero noise, 100% deterministic AST analysis.

Async

ai-guard/no-async-array-callback

Prevents passing async callbacks to array methods like map/forEach expecting sync functions

View rule docs & examples
Async
fix

ai-guard/no-async-without-await

Identifies async functions lacking await expressions, eliminating unnecessary promise wrappers

View rule docs & examples
Async
fix

ai-guard/no-await-in-loop

Warns on serial await inside loops that degrade throughput instead of Promise.all

View rule docs & examples
Reliability

ai-guard/no-broad-exception

Prevents catching generic exceptions or any-typed errors without type narrowing

View rule docs & examples
Reliability

ai-guard/no-catch-log-rethrow

Flags catch blocks that log the error and immediately rethrow without handling it

View rule docs & examples
Reliability

ai-guard/no-catch-without-use

Detects caught error variables that are declared but never inspected or logged

View rule docs & examples
AI Patterns

ai-guard/no-console-in-handler

Discourages console.log statements inside HTTP request handlers in favor of structured logging

View rule docs & examples
AI Patterns

ai-guard/no-dead-branch

Finds unreachable conditional branches and dead code left behind by AI scaffolding

View rule docs & examples
AI Patterns

ai-guard/no-duplicate-logic-block

Identifies repeated blocks of identical logic across branches or functions

View rule docs & examples
Reliability
recommendedfix

ai-guard/no-empty-catch

Disallows empty catch blocks that silently swallow exceptions and hide production failures

View rule docs & examples
Security
recommended

ai-guard/no-eval-dynamic

Blocks dynamic code execution via eval() or new Function() with unsanitized inputs

View rule docs & examples
Async
recommendedfix

ai-guard/no-floating-promise

Catches unawaited promises and fire-and-forget calls that silently swallow errors

View rule docs & examples
Security
recommendedfix

ai-guard/no-hardcoded-secret

Flags hardcoded API keys, JWT tokens, and sensitive credentials in source code

View rule docs & examples
Async

ai-guard/no-redundant-await

Detects redundant return await expressions outside try/catch blocks

View rule docs & examples
Security

ai-guard/no-sql-string-concat

Prevents SQL injection vulnerabilities caused by raw string concatenation in queries

View rule docs & examples
Security

ai-guard/no-unsafe-deserialize

Enforces validation before parsing untrusted request bodies and raw JSON input

View rule docs & examples
Security

ai-guard/require-auth-middleware

Ensures public API endpoints and route handlers include authentication middleware

View rule docs & examples
Security

ai-guard/require-authz-check

Verifies user ownership or authorization before executing resource-level operations

View rule docs & examples

Ready to guard your repository?

Install the plugin or run a zero-config scan in seconds.