What is AI Guard?
AI Guard (eslint-plugin-ai-guard) is an open-source ESLint plugin, CLI and set of agent hooks that catches risky patterns AI coding tools often produce in JavaScript and TypeScript and checks npm packages before they are installed. It is free, MIT licensed, and runs locally: the same code gives the same result, with no model in the loop.
By the AI Guard maintainers · Last updated · Applies to v1.4.7
What it does
- Lint rules. 27 rules in 4 presets for patterns such as hardcoded or client-exposed secrets, empty catch blocks, floating promises, imports of packages that are not declared, placeholder code, and tests that cannot fail. They run in ESLint, in Oxlint, or through the zero-config
ai-guardCLI. See the rule catalog. - Checks on an agent's change.
ai-guard verifygives one verdict for a change and counts only what the change introduced;ai-guard integrityreports changes that weaken checks, such as a skipped test or a neweslint-disable. See Checks on the agent's change. - Package checks.
ai-guard verify-depslooks packages up on npm before they are installed and blocks names that don't exist, removed malware and suspicious look-alikes. See Package checks. - Agent hooks. One command,
npx ai-guard init-hooks, sets up feedback and a finish gate in Claude Code, Codex and Cursor. See guardrails for AI coding agents. - Pre-commit gate, CI and MCP. A Git hook, a GitHub Action with Code Scanning output, and an MCP server with 9 tools.
Who it is for
Teams and individual developers who write JavaScript or TypeScript with AI coding assistants or agents and want deterministic checks at each point code passes through: the editor, the agent's own loop, the commit, and the pull request.
What it is not
- AI Guard does not detect AI-written code. It reports risky patterns that AI tools often produce, wherever they came from.
- It is not a replacement for type-aware linting, CodeQL, Semgrep, a secret scanner,
npm auditor code review. It is meant to sit beside them. See AI Guard and ESLint and AI Guard and npm audit. - Lint rules see one file at a time and do not follow data across modules. A security finding means "look here", not "this is exploitable".
Key facts
| Package | eslint-plugin-ai-guard on npm |
| Current version | 1.4.7 (published 13 November 2026) |
| Licence | MIT |
| Requirements | Node.js 20 or later; ESLint 8 or later (flat config and legacy config) |
| Rules and presets | 27 rules, 4 presets |
| MCP server | ai-guard-mcp, 9 tools, MCP Registry id io.github.ai-guard-dev/ai-guard |
| Machine-readable facts | /facts.json, /llms.txt |
Who maintains it
AI Guard is developed in the open at github.com/ai-guard-dev/eslint-plugin-ai-guard by Yash Jadhav and Vaishnavi Sawant. Issues and pull requests are welcome.
npm install --save-dev eslint-plugin-ai-guardpnpm add -D eslint-plugin-ai-guardyarn add -D eslint-plugin-ai-guardbun add -d eslint-plugin-ai-guard