{
  "lastUpdated": "2026-11-14",
  "name": "AI Guard",
  "packageName": "eslint-plugin-ai-guard",
  "version": "1.4.7",
  "published": "2026-11-13",
  "license": "MIT",
  "description": "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.",
  "shortDescription": "Open-source ESLint plugin, CLI and agent hooks that catch risky patterns AI coding tools often produce and check npm packages before install.",
  "whatItIsNot": "AI Guard does not detect AI-written code. It reports risky patterns that AI tools often produce, wherever they came from.",
  "requirements": {
    "node": "Node.js 20 or later",
    "eslint": "ESLint 8 or later (flat config and legacy config)",
    "typescript": "Optional: @typescript-eslint/parser for TypeScript files"
  },
  "install": {
    "npm": "npm install --save-dev eslint-plugin-ai-guard",
    "pnpm": "pnpm add -D eslint-plugin-ai-guard",
    "yarn": "yarn add -D eslint-plugin-ai-guard",
    "bun": "bun add -d eslint-plugin-ai-guard"
  },
  "firstCommands": [
    {
      "command": "npx ai-guard run",
      "description": "Zero-config scan of the whole project"
    },
    {
      "command": "npx ai-guard init-hooks",
      "description": "Hooks for Claude Code, Cursor and Codex"
    },
    {
      "command": "npx ai-guard verify-deps --all",
      "description": "Check every dependency on npm"
    }
  ],
  "binaries": [
    {
      "name": "ai-guard",
      "description": "The CLI"
    },
    {
      "name": "ai-guard-mcp",
      "description": "The MCP server (local STDIO)"
    },
    {
      "name": "ai-guard-hook",
      "description": "Fast entry point for agent hooks"
    }
  ],
  "rules": {
    "count": 27,
    "automaticFixCount": 3,
    "editorSuggestionCount": 3,
    "defaultLevelsFrom": "recommended preset",
    "categories": [
      {
        "name": "Security",
        "count": 10,
        "rules": [
          {
            "name": "no-client-exposed-secret",
            "id": "ai-guard/no-client-exposed-secret",
            "level": "error",
            "summary": "Flags server secrets that end up readable in the browser: public bundler prefixes, secrets in \"use client\" files, and LLM SDKs with dangerouslyAllowBrowser",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-client-exposed-secret"
          },
          {
            "name": "no-eval-dynamic",
            "id": "ai-guard/no-eval-dynamic",
            "level": "error",
            "summary": "Flags eval() and new Function() called with non-literal arguments",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-eval-dynamic"
          },
          {
            "name": "no-hardcoded-secret",
            "id": "ai-guard/no-hardcoded-secret",
            "level": "error",
            "summary": "Flags API keys, passwords, tokens, and other secret-like literals in source code",
            "automaticFix": true,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-hardcoded-secret"
          },
          {
            "name": "no-invisible-unicode",
            "id": "ai-guard/no-invisible-unicode",
            "level": "error",
            "summary": "Flags invisible Unicode that changes what code does or what an AI reads: bidi controls, zero-width characters, tag characters",
            "automaticFix": true,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-invisible-unicode"
          },
          {
            "name": "no-sql-string-concat",
            "id": "ai-guard/no-sql-string-concat",
            "level": "warn",
            "summary": "Flags SQL passed to query methods when it is built with concatenation or template interpolation",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-sql-string-concat"
          },
          {
            "name": "no-undeclared-import",
            "id": "ai-guard/no-undeclared-import",
            "level": "warn",
            "summary": "Flags imports of packages missing from package.json, separating likely-invented packages from phantom dependencies",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-undeclared-import"
          },
          {
            "name": "no-unsafe-deserialize",
            "id": "ai-guard/no-unsafe-deserialize",
            "level": "warn",
            "summary": "Flags JSON.parse() on likely untrusted input, such as request data, without visible validation",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-unsafe-deserialize"
          },
          {
            "name": "no-unsanitized-html",
            "id": "ai-guard/no-unsanitized-html",
            "level": "warn",
            "summary": "Flags dynamic values written to innerHTML, insertAdjacentHTML, document.write and dangerouslySetInnerHTML without sanitizing",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-unsanitized-html"
          },
          {
            "name": "require-auth-middleware",
            "id": "ai-guard/require-auth-middleware",
            "level": "warn",
            "summary": "Flags Express and Fastify routes that have no recognisable authentication middleware",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/require-auth-middleware"
          },
          {
            "name": "require-authz-check",
            "id": "ai-guard/require-authz-check",
            "level": "warn",
            "summary": "Flags handlers that use resource identifiers like req.params.id without a visible authorization check",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/require-authz-check"
          }
        ]
      },
      {
        "name": "Reliability",
        "count": 5,
        "rules": [
          {
            "name": "no-broad-exception",
            "id": "ai-guard/no-broad-exception",
            "level": "warn",
            "summary": "Flags catch clauses typed as any or unknown that use the error without narrowing it",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-broad-exception"
          },
          {
            "name": "no-catch-log-rethrow",
            "id": "ai-guard/no-catch-log-rethrow",
            "level": "off",
            "summary": "Flags catch blocks that only log the error and rethrow it unchanged",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-catch-log-rethrow"
          },
          {
            "name": "no-catch-without-use",
            "id": "ai-guard/no-catch-without-use",
            "level": "off",
            "summary": "Flags catch parameters that are declared but never used",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-catch-without-use"
          },
          {
            "name": "no-empty-catch",
            "id": "ai-guard/no-empty-catch",
            "level": "error",
            "summary": "Flags empty catch blocks that silently swallow errors",
            "automaticFix": false,
            "editorSuggestion": true,
            "url": "https://getaiguard.dev/rules/no-empty-catch"
          },
          {
            "name": "no-silent-fallback",
            "id": "ai-guard/no-silent-fallback",
            "level": "warn",
            "summary": "Flags hardcoded fallbacks for secret env vars and catch blocks that turn a failed awaited call into empty data",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-silent-fallback"
          }
        ]
      },
      {
        "name": "Async",
        "count": 5,
        "rules": [
          {
            "name": "no-async-array-callback",
            "id": "ai-guard/no-async-array-callback",
            "level": "warn",
            "summary": "Flags async callbacks passed to array methods such as map, forEach, filter, and reduce, which return Promises instead of values",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-async-array-callback"
          },
          {
            "name": "no-async-without-await",
            "id": "ai-guard/no-async-without-await",
            "level": "warn",
            "summary": "Flags async functions that never await, excluding common framework conventions such as Next.js route handlers",
            "automaticFix": false,
            "editorSuggestion": true,
            "url": "https://getaiguard.dev/rules/no-async-without-await"
          },
          {
            "name": "no-await-in-loop",
            "id": "ai-guard/no-await-in-loop",
            "level": "warn",
            "summary": "Flags independent awaits inside loops that could run concurrently, while allowing retry, fallback, and sequential intent",
            "automaticFix": true,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-await-in-loop"
          },
          {
            "name": "no-floating-promise",
            "id": "ai-guard/no-floating-promise",
            "level": "error",
            "summary": "Flags async calls that are not awaited, returned, or handled with .catch()",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-floating-promise"
          },
          {
            "name": "no-redundant-await",
            "id": "ai-guard/no-redundant-await",
            "level": "off",
            "summary": "Flags return await outside try/catch/finally, where the await adds nothing",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-redundant-await"
          }
        ]
      },
      {
        "name": "AI Patterns",
        "count": 7,
        "rules": [
          {
            "name": "no-assertionless-test",
            "id": "ai-guard/no-assertionless-test",
            "level": "warn",
            "summary": "Flags test cases that contain no assertion and pass whatever the code does",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-assertionless-test"
          },
          {
            "name": "no-console-in-handler",
            "id": "ai-guard/no-console-in-handler",
            "level": "off",
            "summary": "Flags console.log and console.debug inside route handlers; structured loggers and console.warn/error are allowed",
            "automaticFix": false,
            "editorSuggestion": true,
            "url": "https://getaiguard.dev/rules/no-console-in-handler"
          },
          {
            "name": "no-dead-branch",
            "id": "ai-guard/no-dead-branch",
            "level": "warn",
            "summary": "Flags conditions that are statically always true or always false, such as if (true) or x && !x",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-dead-branch"
          },
          {
            "name": "no-duplicate-logic-block",
            "id": "ai-guard/no-duplicate-logic-block",
            "level": "off",
            "summary": "Flags consecutive statements or blocks that repeat the same logic",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-duplicate-logic-block"
          },
          {
            "name": "no-placeholder-implementation",
            "id": "ai-guard/no-placeholder-implementation",
            "level": "warn",
            "summary": "Flags code left unfinished: elision comments, TODO-only stubs, not-implemented throws, and mock data served from production code",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-placeholder-implementation"
          },
          {
            "name": "no-tautological-assertion",
            "id": "ai-guard/no-tautological-assertion",
            "level": "warn",
            "summary": "Flags assertions that pass no matter what the code does, such as expect(true).toBe(true)",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-tautological-assertion"
          },
          {
            "name": "no-test-env-branch",
            "id": "ai-guard/no-test-env-branch",
            "level": "warn",
            "summary": "Flags production functions that return a hard-coded result when they detect a test runner",
            "automaticFix": false,
            "editorSuggestion": false,
            "url": "https://getaiguard.dev/rules/no-test-env-branch"
          }
        ]
      }
    ]
  },
  "presets": {
    "count": 4,
    "items": [
      {
        "name": "recommended",
        "default": true,
        "enabled": 22,
        "error": 6,
        "warn": 16,
        "off": 5,
        "summary": "The default. High-confidence rules at error, rules that need project context at warn, noisy rules off."
      },
      {
        "name": "strict",
        "default": false,
        "enabled": 27,
        "error": 27,
        "warn": 0,
        "off": 0,
        "summary": "Every rule at error. Expect to tune exceptions locally."
      },
      {
        "name": "security",
        "default": false,
        "enabled": 11,
        "error": 6,
        "warn": 5,
        "off": 16,
        "summary": "Security and supply-chain rules only. Secrets, eval, SQL, exposed keys, invisible Unicode and HTML sinks at error; the rest at warn."
      },
      {
        "name": "agent",
        "default": false,
        "enabled": 8,
        "error": 8,
        "warn": 0,
        "off": 19,
        "summary": "High-signal rules at error, each one an agent can fix on the spot. Used by the agent hooks and the MCP server.",
        "rules": [
          "no-hardcoded-secret",
          "no-eval-dynamic",
          "no-empty-catch",
          "no-sql-string-concat",
          "no-floating-promise",
          "no-client-exposed-secret",
          "no-invisible-unicode",
          "no-undeclared-import"
        ]
      }
    ]
  },
  "cli": [
    {
      "command": "ai-guard run",
      "description": "Scan a directory or file with the bundled rules (no ESLint config needed)"
    },
    {
      "command": "ai-guard changed",
      "description": "Scan only files changed in Git; --test-integrity adds a test comparison"
    },
    {
      "command": "ai-guard verify",
      "description": "One verdict for a change: introduced lint findings, weakened tests, agent-config issues"
    },
    {
      "command": "ai-guard integrity",
      "description": "Changes that weaken checks: suppressions, skipped tests, lowered configs, removed CI steps"
    },
    {
      "command": "ai-guard verify-deps",
      "description": "Check npm packages before they are installed (uses the npm registry)"
    },
    {
      "command": "ai-guard scan-agent-config",
      "description": "Hidden text, prompt injection, unpinned MCP servers and inline secrets in agent files"
    },
    {
      "command": "ai-guard init-hooks",
      "description": "Hooks for Claude Code, Cursor and Codex"
    },
    {
      "command": "ai-guard init-claude",
      "description": "Claude Code hooks only"
    },
    {
      "command": "ai-guard init-git-hook",
      "description": "Pre-commit gate running verify --staged"
    },
    {
      "command": "ai-guard init-oxlint",
      "description": "Add the rules to .oxlintrc.json"
    },
    {
      "command": "ai-guard init",
      "description": "Add the plugin to your ESLint config"
    },
    {
      "command": "ai-guard init-context",
      "description": "Write instruction files for AI coding assistants"
    },
    {
      "command": "ai-guard baseline",
      "description": "Save current findings and report only new ones"
    },
    {
      "command": "ai-guard report",
      "description": "Write a standalone HTML report"
    },
    {
      "command": "ai-guard doctor",
      "description": "Diagnose the ESLint, parser and plugin setup"
    },
    {
      "command": "ai-guard preset",
      "description": "Switch the preset in your ESLint config interactively"
    },
    {
      "command": "ai-guard ignore",
      "description": "Add common build-output ignore paths to your config"
    }
  ],
  "mcp": {
    "binary": "ai-guard-mcp",
    "transport": "stdio",
    "registryId": "io.github.ai-guard-dev/ai-guard",
    "registryCommand": "npx -y -p @typescript-eslint/parser -p eslint-plugin-ai-guard ai-guard-mcp",
    "toolCount": 9,
    "tools": [
      {
        "name": "ai_guard_scan_file",
        "description": "Lint one JS/TS file right after it is created or edited"
      },
      {
        "name": "ai_guard_scan_diff",
        "description": "Lint staged, unstaged and untracked changes, or everything since a base ref; includes test-integrity results"
      },
      {
        "name": "ai_guard_scan_project",
        "description": "A bounded directory scan, including outside Git"
      },
      {
        "name": "ai_guard_check_integrity",
        "description": "Checks the change weakened: new suppressions, skipped or removed tests, lowered configs, removed CI steps"
      },
      {
        "name": "ai_guard_rules",
        "description": "List rules and presets, or look up specific rules with remediation and a docs link"
      },
      {
        "name": "ai_guard_verify_change",
        "description": "One verdict before calling work done"
      },
      {
        "name": "ai_guard_scan_agent_config",
        "description": "Check CLAUDE.md, AGENTS.md, skills and MCP config before trusting them"
      },
      {
        "name": "ai_guard_fix",
        "description": "Automatic fixes for one file; returns a diff, and writes only with apply: true"
      },
      {
        "name": "ai_guard_check_package",
        "description": "Check npm packages before installing them; returns a verdict per package and safeToInstall"
      }
    ],
    "network": "Only ai_guard_check_package uses the network (registry.npmjs.org and api.npmjs.org).",
    "writes": "No file edits unless ai_guard_fix is called with apply: true. No telemetry."
  },
  "agents": {
    "supported": [
      "Claude Code",
      "Codex",
      "Cursor"
    ],
    "setup": "npx ai-guard init-hooks",
    "capabilities": [
      {
        "capability": "Lint and weakened checks fed back after each edit",
        "Claude Code": "Yes",
        "Codex": "Yes (apply_patch)",
        "Cursor": "At the finish gate instead"
      },
      {
        "capability": "Finish gate: problems the session introduced, raised once",
        "Claude Code": "Yes",
        "Codex": "Yes",
        "Cursor": "Yes (follow-up message)"
      },
      {
        "capability": "Session-start snapshot, so earlier work is not blamed on the agent",
        "Claude Code": "Yes",
        "Codex": "Yes",
        "Cursor": "Yes"
      },
      {
        "capability": "Guard on git commit --no-verify and HUSKY=0",
        "Claude Code": "Asks you",
        "Codex": "Denied; the agent is told to ask you",
        "Cursor": "Asks you"
      },
      {
        "capability": "Package check before installs (opt-in)",
        "Claude Code": "Deny or ask",
        "Codex": "Deny",
        "Cursor": "Deny or ask"
      }
    ],
    "verification": "Run against real installs in Claude Code and the Codex CLI. Cursor support follows Cursor’s documented hook format and has not been tested in the editor."
  },
  "results": {
    "measuredOn": "2026-11-12",
    "measuredOnLabel": "12 November 2026",
    "measuredWith": "1.4.6",
    "note": "1.4.7 did not change the package checks.",
    "source": "https://github.com/ai-guard-dev/eslint-plugin-ai-guard/blob/main/docs/evidence.md",
    "headline": [
      {
        "value": "0 of 1,361",
        "label": "real dependencies blocked",
        "detail": "763 from 15 large open-source projects and 598 from 9 open-source apps."
      },
      {
        "value": "34 of 36",
        "label": "names from the 2017 crossenv malware campaign blocked",
        "detail": "The other two are still published by their original 2017 account, so there is no fact to block on."
      },
      {
        "value": "27 of 27",
        "label": "rules give identical results in ESLint and Oxlint",
        "detail": "49 findings in each linter, on the same fixture set."
      }
    ],
    "latestReleaseYoungerThan": [
      {
        "window": "6 hours",
        "percentOfTop5000": 0.22,
        "default": false
      },
      {
        "window": "24 hours",
        "percentOfTop5000": 3.02,
        "default": true
      },
      {
        "window": "48 hours",
        "percentOfTop5000": 6.44,
        "default": false
      },
      {
        "window": "72 hours",
        "percentOfTop5000": 9.2,
        "default": false
      },
      {
        "window": "7 days",
        "percentOfTop5000": 13.79,
        "default": false
      }
    ],
    "limits": [
      "These are one day's numbers, taken on a busy release day (12 November 2026), so fresh-release counts on a quiet day will be lower.",
      "Cursor was not tested in the editor. Its hooks follow Cursor’s documented hook format.",
      "Lint-rule precision on application code is not covered by these numbers. They are about the package checks.",
      "Blocking only on facts means some malicious packages pass with a warning. For example, expresss (registered 2016, about 755 downloads a week) installs with a look-alike warning."
    ]
  },
  "releases": [
    {
      "version": "1.4.7",
      "date": "13 Nov 2026",
      "changes": [
        "No automatic fix that can hide an empty catch or a floating promise; editors offer suggestions instead.",
        "ai-guard doctor treats a missing CI workflow as a suggestion, not a failure.",
        "Results page with the package-check measurements."
      ]
    },
    {
      "version": "1.4.6",
      "date": "12 Nov 2026",
      "changes": [
        "Fresh-release check, aware of package-manager cooldowns."
      ]
    },
    {
      "version": "1.4.5",
      "date": "12 Nov 2026",
      "changes": [
        "Package checks: verify-deps, an opt-in pre-install hook, and the ai_guard_check_package MCP tool.",
        "Hooks for Cursor and Codex, pre-commit gate, Oxlint support, and an official MCP Registry listing."
      ]
    },
    {
      "version": "1.4.4",
      "date": "8 Nov 2026",
      "changes": [
        "Agent safety: verify, scan-agent-config, test-integrity checks, new rules (27 total), and an expanded agent preset."
      ]
    }
  ],
  "links": {
    "site": "https://getaiguard.dev",
    "docs": "https://getaiguard.dev/docs",
    "repository": "https://github.com/ai-guard-dev/eslint-plugin-ai-guard",
    "npm": "https://www.npmjs.com/package/eslint-plugin-ai-guard",
    "changelog": "https://github.com/ai-guard-dev/eslint-plugin-ai-guard/blob/main/CHANGELOG.md",
    "evidence": "https://github.com/ai-guard-dev/eslint-plugin-ai-guard/blob/main/docs/evidence.md",
    "mcpRegistry": "io.github.ai-guard-dev/ai-guard",
    "mcpRegistryApi": "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.ai-guard-dev/ai-guard",
    "githubAction": "ai-guard-dev/eslint-plugin-ai-guard@v1",
    "llmsTxt": "https://getaiguard.dev/llms.txt",
    "llmsFullTxt": "https://getaiguard.dev/llms-full.txt"
  },
  "otherVersionsOnSite": {
    "measuredWith": "1.4.6",
    "benchmarks": "1.2.8",
    "changelog": [
      "1.4.6",
      "1.4.5",
      "1.4.4"
    ]
  }
}
