Guard AI-generated code
before it reaches production.
AI Guard catches security, reliability, and async problems in AI-assisted JavaScript and TypeScript code — before they become bugs.
async function processUsers(users) {
users.forEach(async (user) => {
await sendEmail(user.email)
})
}.forEach() are not awaited — errors will be silently swallowed.async function processUsers(users) {
await Promise.all(
users.map(async (user) => {
await sendEmail(user.email)
})
)
}The problem
AI writes code fast.
It also writes patterns
that look correct.
AI coding assistants are productive. They're also consistent producers of specific categories of bugs — patterns that pass a quick review but fail in production.
The solution
AI Guard adds a deterministic safety layer.
Instead of asking another LLM to review AI output, AI Guard uses ESLint and AST-based static analysis — rules that always produce the same answer for the same code. Fast, deterministic, and local.

Adoption & Reliability at Scale
View on npm registry
Total downloads till now across all published releases.
Active installs in the past month across developers & CI.
Security, reliability, and async rules with zero hallucinations.
Free forever. No paywalled rules or gated features.
Three ways to use it
One tool, every part of your workflow.
ESLint Plugin
18 focused rules for security, reliability, async behavior, and patterns common in AI-assisted codebases. Integrates natively into your existing ESLint setup.
eslint-plugin-ai-guardCLI
Run AI Guard locally, scan changed files, generate HTML reports, create suppressible baselines, and integrate into any existing workflow.
npx ai-guardGitHub Action
Scan every pull request automatically. Findings appear as GitHub Code Scanning alerts and inline PR annotations via SARIF — no extra setup needed.
ai-guard-dev/eslint-plugin-ai-guard@v118 Rules
Rules that focus on
real failure modes.
Security
6 rulesai-guard/no-hardcoded-secretDetects hardcoded credentials and API keys
ai-guard/no-eval-dynamicFlags dangerous eval() and new Function() usage
ai-guard/no-sql-string-concatCatches SQL queries built via string concatenation
ai-guard/no-unsafe-deserializeWarns on unsafe deserialization of untrusted input
ai-guard/require-auth-middlewareEnsures route handlers have authentication
ai-guard/require-authz-checkEnforces authorization checks in handlers
Reliability
4 rulesAsync
5 rulesai-guard/no-floating-promiseCatches unawaited promises that swallow errors
ai-guard/no-async-array-callbackFlags async callbacks in .forEach() and similar
ai-guard/no-await-in-loopSuggests Promise.all() instead of sequential await
ai-guard/no-async-without-awaitFinds async functions with no await expressions
ai-guard/no-redundant-awaitRemoves unnecessary await on resolved values
CLI Demo
What it looks like in practice.
Run a full scan or scope it to changed files in a PR. Findings are clear, actionable, and include file and line references.
> ai-guard run Scanning 47 files... ✖ no-floating-promise src/api/users.ts:42 Promise not awaited — errors will be silently swallowed. ✖ no-hardcoded-secret src/config.ts:8 Hardcoded credential detected. Use process.env instead. ⚠ no-async-array-callback src/workers/email.ts:17 Async callback in .forEach() — use Promise.all() with .map(). 3 issues found (2 errors, 1 warning) 1.2s
> ai-guard changed --pr Detecting changed files vs origin/main...Found 3 changed files. ✖ no-sql-string-concat src/db/queries.ts:31 SQL query built via string concatenation — injection risk. 1 issue found (1 error) 0.4s
ai-guard runScan entire projectai-guard changedScan PR diff onlyai-guard reportGenerate HTML reportai-guard initSet up configHow it works
Simple by design.
Write code with your AI assistant
Use Copilot, Cursor, Claude, or any AI tool to generate code. AI Guard works with whatever you already use.
Run AI Guard
In your terminal, in CI, or automatically via the GitHub Action — findings show up wherever you prefer.
Get deterministic findings
Static analysis, not an LLM opinion. Every finding is traceable to a specific line, rule, and pattern.
Fix before merge
Address issues in the pull request stage — before they reach production and before the incident report.
Catch problems before
the code is written.
ai-guard init-context generates project-specific guidance for your AI coding agent — helping it avoid known failure patterns before they appear in the final code.
Based on your project's configuration, dependencies, and stack, AI Guard produces rule-aware instructions that coding agents can use as system context.
Prevention layer — not a replacement for code scanning.
Generating context for
CLAUDE.mdAnthropic Claude project instructions
.cursorrulesCursor AI editor rules
GitHub CopilotCopilot workspace instructions
# AI Guard — Project context
Avoid async callbacks in .forEach().
Never hardcode credentials or API keys.
Always await Promises in route handlers.
... and 15 more project-specific rules
Open Source
Built in the open.
AI Guard is MIT-licensed and developed in public on GitHub. The rules, the CLI, and the GitHub Action are all open and auditable.
Contributions, issue reports, and rule suggestions are welcome. The project is available on npm, the GitHub Marketplace, and Product Hunt.

Ecosystem & Acceleration
AI Guard × Sarvam AI Startup Program
AI Guard has been selected for the prestigious Sarvam AI Startup Program — partnering to build production-grade safety layers and deterministic guardrails for AI-assisted software engineering.
OPEN SOURCE
Build AI Guard with us.
AI Guard is open source, and we're open to working with developers, security researchers, and teams building with AI coding tools.
Interested in contributing a rule, testing AI Guard on your codebase, exploring integrations, or discussing a partnership? We'd love to hear from you.
Rule Contributions
Author or refine AST detection rules for your stack.
Codebase Testing
Run differential benchmarks on real-world AI-assisted code.
Agent Integrations
Help bridge AST rules with Cursor, Claude Code, and Copilot.
Security Research
Share insights on recurring AI vulnerability patterns.
Get started
Add AI Guard to
your project.
Install the ESLint plugin, run the guided setup, and start catching issues in minutes. No configuration required to get started.
Step 1 — Install
npm install -D eslint-plugin-ai-guard
Step 2 — Initialize
npx ai-guard init
Step 3 — Scan
npx ai-guard run
Or add to GitHub Actions with ai-guard-dev/eslint-plugin-ai-guard@v1
Project Leadership · Core Team
Created & Maintained by
AI Guard is built and maintained in the open by developer tooling engineers passionate about software reliability, AST static analysis, and code security.

Yash Jadhav
Co-Creator & MaintainerSoftware engineer specializing in developer tooling, AST static analysis, and code reliability infrastructure.

Vaishnavi Sawant
Co-Creator & MaintainerSoftware engineer focused on AI-assisted development guardrails, TypeScript tooling, and modern web systems.