AI Guard
Deterministic AST safety layer and CI guardrails for AI-assisted JavaScript and TypeScript code.
Website •
npm Package •
GitHub Repository •
Rules Catalog •
Benchmarks •
Claude Code •
Documentation
What is AI Guard?
AI Guard (eslint-plugin-ai-guard) provides:
- ESLint plugin with 33 deterministic rules and 4 presets (
recommended, strict, security, agent)
- CLI (
ai-guard) for terminal, changed-file, and CI scanning
- GitHub Action with native SARIF 2.1.0 output for GitHub Code Scanning
- Check integrity (
ai-guard integrity) — detects changes that weaken checks: new suppressions, skipped or removed tests, lowered ESLint/TypeScript/coverage settings, removed CI steps
- Agent safety:
ai-guard verify (one verdict for a change), ai-guard scan-agent-config (hidden text and prompt injection in CLAUDE.md, skills and MCP config), and changed --test-integrity (weakened tests)
- Hooks for Claude Code, Cursor and Codex (
ai-guard init-hooks): findings go back to the agent as it works, and it is stopped once before finishing on weakened checks or problems it introduced
- A pre-commit gate (
ai-guard init-git-hook) that checks every commit, whichever agent or person wrote it
- Works with Oxlint as a JS plugin, with identical results checked in CI (
ai-guard init-oxlint)
- Package checks (
ai-guard verify-deps, an opt-in pre-install hook, and the ai_guard_check_package MCP tool): names that do not exist on npm, typosquats and npm security placeholders are blocked; install scripts, deprecations and releases from the last day are flagged
- MCP server (
ai-guard-mcp, 9 tools) for local AI-agent workflows over STDIO
Results on real projects
Measured on 12 November 2026 with 1.4.6. Methods, raw numbers and the commands to reproduce them: docs/evidence.md.
- 0 of 1,361 real dependencies blocked (763 from 15 large open-source projects, 598 from 9 apps)
- 34 of 36 names from the 2017 crossenv malware campaign blocked
- 3.0% of the 5,000 most-downloaded packages had a latest release under a day old, the window the fresh-release check covers
- 33 of 33 rules give identical results in ESLint and Oxlint, checked in CI
It is engineered to detect reliability bugs, async hazards, security vulnerabilities, and code-scaffolding defects frequently introduced during AI-assisted development (GitHub Copilot, Cursor, Claude Code, Gemini Code Assist, etc.).
AI Guard analyzes Abstract Syntax Trees (AST) using ESLint's native engine. It runs locally in your editor, in your terminal via the zero-config CLI, and in your CI/CD pipelines via native SARIF 2.1.0 integration with GitHub Code Scanning.
What AI Guard is NOT