Open Source·ESLint·GitHub Action

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.

npm12,922+downloads18 rulesTypeScriptESLintGitHub ActionsSARIF
processUsers.ts
Before — AI-generated code
async function processUsers(users) {
  users.forEach(async (user) => {
    await sendEmail(user.email)
  })
}
AI Guard
no-async-array-callback
Async callbacks passed to .forEach() are not awaited — errors will be silently swallowed.
After — Corrected
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.

floating promisesunsafe error handlinghardcoded secretsdynamic evalSQL string concatenationunnecessary awaitsunhandled async patternsdead branchesduplicated logic
1
AI-generated code
Fast, but sometimes unreliable
2
AI Guard
AST-based ESLint rules
3
Deterministic findings
No hallucinations. No false positives from LLMs.
4
Developer fixes
Before merge, not after incident
5
Safer code
Shipped with confidence

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.

AI Guard adds a deterministic safety layer workflow
AST Static AnalysisDeterministic · Zero Hallucinations
By the numbers·
Official npm stats

Adoption & Reliability at Scale

npmView on npm registry
Total Downloadsnpm
12,922

Total downloads till now across all published releases.

Last 30 Days
3,727+

Active installs in the past month across developers & CI.

RulesAST
18

Security, reliability, and async rules with zero hallucinations.

Open SourceMIT
100%

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-guard

CLI

Run AI Guard locally, scan changed files, generate HTML reports, create suppressible baselines, and integrate into any existing workflow.

GitHub 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@v1

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.

Full scan
terminal
$npx ai-guard run
> 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
Changed files only
terminal
$npx ai-guard changed --pr
> 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 project
ai-guard changedScan PR diff only
ai-guard reportGenerate HTML report
ai-guard initSet up config

How it works

Simple by design.

01

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.

02

Run AI Guard

In your terminal, in CI, or automatically via the GitHub Action — findings show up wherever you prefer.

03

Get deterministic findings

Static analysis, not an LLM opinion. Every finding is traceable to a specific line, rule, and pattern.

04

Fix before merge

Address issues in the pull request stage — before they reach production and before the incident report.

Experimental

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.

$ npx ai-guard init-context

Generating context for

📄
CLAUDE.md

Anthropic Claude project instructions

Generated
📄
.cursorrules

Cursor AI editor rules

Generated
📄
GitHub Copilot

Copilot workspace instructions

Generated

# 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.

AI Guard and Sarvam AI Startup Program Collaboration
Official Selection CohortSarvam AI Developer Ecosystem

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.

Collaboration AreasOpen Source & Community

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

Yash Jadhav

Co-Creator & Maintainer

Software engineer specializing in developer tooling, AST static analysis, and code reliability infrastructure.

Vaishnavi Sawant

Vaishnavi Sawant

Co-Creator & Maintainer

Software engineer focused on AI-assisted development guardrails, TypeScript tooling, and modern web systems.