AI Guard
Checks JS/TS written by AI for risky patterns, fake npm packages and weakened tests
- Pricing
- Open source
- Platforms
- CLI, vscode, self-hosted
- Runs
- Locally
- Version
- 1.4.7
- Listing updated
- 1 day ago
About AI Guard
AI Guard is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
AI Guard is a deterministic ESLint plugin, CLI and set of agent hooks for JavaScript and TypeScript. Its 27 rules target patterns coding assistants often leave behind: swallowed errors, floating promises, leaked secrets, invented imports and placeholder code. Nothing in the loop is a model, so identical code gives identical results, and it does not try to guess whether a person or an AI wrote it.
Beyond linting, it compares a change against its base to spot skipped or removed tests, new eslint-disable comments, lowered config and hidden text in agent config files. A package check looks names up on the public npm registry and blocks ones that do not exist, were replaced by npm with a security placeholder or look like known typosquats. The site reports that 34 of 36 names from the 2017 crossenv campaign were blocked and none of 1,361 real dependencies were.
Hooks for Claude Code, Codex and Cursor feed findings back after each edit and check once before the agent finishes. It also runs as a pre-commit gate, a GitHub Action with SARIF output, and a local STDIO MCP server with nine tools. It needs Node 20 or later and ESLint 8 or later, under an MIT licence.
Install
Run in a terminal
claude mcp add ai-guard -- npx -y eslint-plugin-ai-guardAdd to claude_desktop_config.json
{
"mcpServers": {
"ai-guard": {
"command": "npx",
"args": [
"-y",
"eslint-plugin-ai-guard"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"ai-guard": {
"command": "npx",
"args": [
"-y",
"eslint-plugin-ai-guard"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"ai-guard": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"eslint-plugin-ai-guard"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"ai-guard": {
"command": "npx",
"args": [
"-y",
"eslint-plugin-ai-guard"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"ai-guard": {
"command": "npx",
"args": [
"-y",
"eslint-plugin-ai-guard"
]
}
}
}Tools this server provides (1)
Taken from the project documentation; the running server may differ.
- ai_guard_check_package
- Checks whether an npm package name is safe to install.
What it does
- 27 lint rules
- Rules cover secrets, swallowed errors, floating promises, invented imports and placeholder code.
- Weakened-check detection
- Flags skipped tests, new suppressions and lowered config in a change.
- Pre-install package checks
- Blocks npm names that do not exist, removed malware and look-alikes.
- Agent hooks
- Claude Code, Codex and Cursor get feedback after edits and a check before finishing.
- CI and code scanning
- A GitHub Action writes annotations and SARIF for Code Scanning.
- Oxlint parity
- All 27 rules give the same results in ESLint and Oxlint.
Good for
- Stop an AI agent from installing a package that does not exist
- Block commits that quietly skip or delete tests
- Annotate pull requests with AI-typical risks
- Scan CLAUDE.md, skills and MCP config for hidden text
- Add guardrails to a Cursor or Codex workflow
Pricing
Open source
MIT licensed
Prices change. Check getaiguard.dev before you buy.
AI Guard FAQ
Does it detect AI-written code?
No. It reports risky patterns wherever they came from.
Does it send data anywhere?
Package checks are opt-in and only query the public npm registry; private-registry packages are skipped.
What does it need?
Node.js 20 or later and ESLint 8 or later.
Which licence?
MIT.
Is AI Guard free?
Yes. AI Guard is open source, so you can use and self-host it for free.
How do I add AI Guard to Claude Code?
Run this command in your terminal: claude mcp add ai-guard -- npx -y eslint-plugin-ai-guard
What are the best alternatives to AI Guard?
The closest alternatives to AI Guard are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to AI Guard

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools