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.
ai-guard/no-async-array-callback
Prevents passing async callbacks to array methods like map/forEach expecting sync functions
ai-guard/no-async-without-await
Identifies async functions lacking await expressions, eliminating unnecessary promise wrappers
ai-guard/no-await-in-loop
Warns on serial await inside loops that degrade throughput instead of Promise.all
ai-guard/no-broad-exception
Prevents catching generic exceptions or any-typed errors without type narrowing
ai-guard/no-catch-log-rethrow
Flags catch blocks that log the error and immediately rethrow without handling it
ai-guard/no-catch-without-use
Detects caught error variables that are declared but never inspected or logged
ai-guard/no-console-in-handler
Discourages console.log statements inside HTTP request handlers in favor of structured logging
ai-guard/no-dead-branch
Finds unreachable conditional branches and dead code left behind by AI scaffolding
ai-guard/no-duplicate-logic-block
Identifies repeated blocks of identical logic across branches or functions
ai-guard/no-empty-catch
Disallows empty catch blocks that silently swallow exceptions and hide production failures
ai-guard/no-eval-dynamic
Blocks dynamic code execution via eval() or new Function() with unsanitized inputs
ai-guard/no-floating-promise
Catches unawaited promises and fire-and-forget calls that silently swallow errors
ai-guard/no-hardcoded-secret
Flags hardcoded API keys, JWT tokens, and sensitive credentials in source code
ai-guard/no-redundant-await
Detects redundant return await expressions outside try/catch blocks
ai-guard/no-sql-string-concat
Prevents SQL injection vulnerabilities caused by raw string concatenation in queries
ai-guard/no-unsafe-deserialize
Enforces validation before parsing untrusted request bodies and raw JSON input
ai-guard/require-auth-middleware
Ensures public API endpoints and route handlers include authentication middleware
ai-guard/require-authz-check
Verifies user ownership or authorization before executing resource-level operations
Ready to guard your repository?
Install the plugin or run a zero-config scan in seconds.