プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。Google でログインするとレビューを書けます。プロトタイプ · 30分ごとに更新
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

AI Guard

作者:ai-guard-devバージョン 1.4.7i★ 19iパソコンで動く公式サイト ↗
レジストリ名io.github.ai-guard-dev/ai-guard

インストール方法

What it does

Guardrails for AI-written JS/TS: scans, weakened-test checks, package checks, verify before done.

  • Connects パソコンで動く
  • Account or key No key needed
  • Category その他

この順位の理由

一覧は利用スコア(100 点満点)で並びます。内訳は次のとおり

人気23/80GitHub スターか週間ダウンロード数。大きい方を 60、小さい方を 20 で数えます
新しさ12/1230 日以内のリリースかコード更新で満点
応答中0/8前回の確認でクラウドのエンドポイントが応答
利用スコア35/100

品質: 基本チェック 3/3 項目に合格(表示のみ、並び順には不使用) · 勢い: データなし (「急上昇」タブでのみ使用)

インストール

使っているAIアプリを選んで、設定をコピーしてください。

チェック 3/3 合格 · あなたのパソコンで動きます · ✓ コマンド確認済み 2026年11月14日

まず:どの AI を使っていますか?

使っているアプリを選ぶと、下に手順が表示されます。

Claude につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません

AI にインストールしてもらう

このメッセージを Claude のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Claude に MCP server AI Guard を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "ai-guard": { "command": "npx", "args": [ "-y", "eslint-plugin-ai-guard", "ai-guard-mcp" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、AI Guard のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. パソコン版 Claude アプリの設定ファイルを開く

    SettingsDeveloperEdit Config

  3. この設定を貼り付けて保存

    {
      "mcpServers": {
        "ai-guard": {
          "command": "npx",
          "args": [
            "-y",
            "eslint-plugin-ai-guard",
            "ai-guard-mcp"
          ]
        }
      }
    }
  4. Claude を終了してもう一度開く

  5. 試してみる

    AI Guard を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude が AI Guard を使っていると言うか、回答に AI Guard のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

ChatGPT はまだ AI Guard につなげません

AI Guard はパソコンに入れて使うものですが、ChatGPT は Web 上で動くサーバーにしかつなげません

代わりにできること

A · AI Guard につなげるアプリを使う

  • 先にパソコンへ Node.js を入れてください(1 回だけ) · パソコン版 Claude アプリ(Windows または Mac)のみ。Web やスマホでは使えません
  • 先にパソコンへ Node.js を入れてください(1 回だけ)
  • 先にパソコンへ Node.js を入れてください(1 回だけ)
  • 先にパソコンへ Node.js を入れてください(1 回だけ)

B · その他 の中で ChatGPT につなげる別のサーバー

同じカテゴリでよく使われているものから、キーなしでアドレスだけでつなげるものを選びました

Claude Code につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを Claude Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Claude Code に MCP server AI Guard を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):claude mcp add --scope user ai-guard -- npx -y eslint-plugin-ai-guard ai-guard-mcp 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、AI Guard のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. ターミナルを開く

    Mac:Command+スペースで Terminal と入力 · Windows:PowerShell を開く

  3. このコマンドを貼り付けて Enter

    claude mcp add --scope user ai-guard -- npx -y eslint-plugin-ai-guard ai-guard-mcp
  4. Claude Code で /mcp と入力

    AI Guard が一覧にあり、接続済みと表示されれば OK です

  5. 試してみる

    AI Guard を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Claude Code が AI Guard を使っていると言うか、回答に AI Guard のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Anthropic のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Cursor につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを Cursor のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの Cursor に MCP server AI Guard を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "mcpServers": { "ai-guard": { "command": "npx", "args": [ "-y", "eslint-plugin-ai-guard", "ai-guard-mcp" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、AI Guard のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. このボタンで Cursor を開く

    Cursor で開く

    Cursor がインストールの確認をするので Install を押します

  3. Cursor の AI チャットを Agent モードで開く

  4. 試してみる

    AI Guard を使って、私に何ができるか教えて、1 つやってみせて

    ✓ Cursor が AI Guard を使っていると言うか、回答に AI Guard のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に Cursor のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

VS Code につなげますが、先に準備が必要です

先にパソコンへ Node.js を入れてください(1 回だけ)

AI にインストールしてもらう

このメッセージを VS Code のチャットに貼り付けます。AI がパソコンを確認し、変更するファイルを伝え、毎回あなたの了承を待ちます。

このパソコンの VS Code に MCP server AI Guard を入れてください。順番に:1) node -v で Node.js があるか確認。なければ https://nodejs.org/en/download から入れるよう私に伝え、自分では入れない。2) この設定だけを使う(PopNx MCP の確認済み):{ "servers": { "ai-guard": { "type": "stdio", "command": "npx", "args": [ "-y", "eslint-plugin-ai-guard", "ai-guard-mcp" ] } } } 3) 変更するファイルのフルパスか実行するコマンドを伝えて、私の了承を待つ。4) キーは不要。5) 了承した内容を実行し、AI Guard のツールが本当に表示されるか確認する。

このメッセージにあなたのキーは含まれません。キーが必要な場合は、AI がファイルやアプリの入力欄にご自身で貼るよう案内します。

  1. Node.js を入れる(まだなければ)

    もう入っていますか?先に確認 · ターミナルを開き、このコマンドを入力して Enter

    node -v
    • バージョン番号(例 v26.13.1)が出る = 入っています。この手順は飛ばせます
    • "command not found"(Windows では "is not recognized")が出る = まだ入っていないか、入れた直後でターミナルを開き直す必要があります
    ターミナルの開き方

    Mac:⌘ + Space を押し、Terminal と入力して Enter

    Windows:スタートメニューを開き、Windows PowerShell と入力して「開く」

    まだ入っていない場合: 公式ダウンロードページで LTS 版と、クリックで進むインストーラーを選びます:Mac は .pkg、Windows は .msi。ダブルクリックして最後まで進めるだけで、curl コマンドは不要です

    Node.js のダウンロードページを開く ↗

    入れ終わったらターミナルを閉じて開き直し、同じコマンドをもう一度実行します。バージョン番号が出れば完了です: node -v

    一度入れれば、Node.js を使うすべてのツールで使えます

  2. このボタンで VS Code を開く

    VS Code で開く

    VS Code がインストールの確認をするので Install を押します

  3. VS Code の AI チャットを Agent モードで開く

  4. 試してみる

    AI Guard を使って、私に何ができるか教えて、1 つやってみせて

    ✓ VS Code が AI Guard を使っていると言うか、回答に AI Guard のツール名が出れば接続成功です

メニュー名は 2026年11月11日 に VS Code のヘルプページで確認 · アプリのバージョンにより画面が少し違うことがあります

Windsurf、Zed、Gemini CLI など MCP を使える他のアプリは追加方法がそれぞれ違います。アプリ一覧で確認してください

MCP を使えるアプリをすべて見る →

JSON 設定は下の「開発者向け」にあります

つまずいたら?AI Guard を使っている人に聞いてみましょう💬 ディスカッション →
開発者向け:ターミナルのコマンドと JSON 設定

パソコンにインストール

Claude Code

claude mcp add --scope user ai-guard -- npx -y eslint-plugin-ai-guard ai-guard-mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "ai-guard": {
      "command": "npx",
      "args": [
        "-y",
        "eslint-plugin-ai-guard",
        "ai-guard-mcp"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "ai-guard": {
      "command": "npx",
      "args": [
        "-y",
        "eslint-plugin-ai-guard",
        "ai-guard-mcp"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "ai-guard": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "eslint-plugin-ai-guard",
        "ai-guard-mcp"
      ]
    }
  }
}

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

ひと目でわかる

週あたりのダウンロードi
567/週
接続方法
パソコンで動く
最新バージョンi
1.4.7
カテゴリi
その他
レジストリ公開日i
2026年11月14日
コードの最終更新i
2026年11月14日
作者
ai-guard-dev
パッケージ
npm: eslint-plugin-ai-guard
ウェブサイト
getaiguard.dev
レジストリでの状態
有効

使えるアプリ

このサーバーのつなぎ方と、各アプリの公式ドキュメントに基づきます。2026年11月10日に確認。

パソコン上で動かせるアプリ

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

すべてのアプリと長所・短所 →

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月16日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント ai-guard-dev で確認済みです

  • ✓ 合格

    今もメンテナンスされている

    コードの最終更新:一昨日

  • ✓ 合格

    ライセンスがある

    MITを使用

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

公開済みの脆弱性(OSV.dev)

OSV.dev に eslint-plugin-ai-guard@1.4.7 の登録はありません

このバージョンのパッケージ本体のみ確認。すべての依存関係ではありません · 確認日 2026年11月15日

確認していること → · JSON

作者の方へ:再確認の依頼・情報の誤りの報告
作者向け:README にバッジを付ける

作者の方は、このコードを README に貼れます。バッジはこのページにリンクします。

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/ai-guard-dev-ai-guard.svg)](https://mcp.popnx.com/en/servers/ai-guard-dev-ai-guard)

話し合い

質問、コツの共有、使えないことの報告ができます。「役に立った」の多い順です。

まだ投稿はありません。最初の質問や共有をどうぞ。

ここの投稿は利用者によるもので、PopNx チームのものではありません。

ログインして投稿

ユーザーレビュー

まだレビューはありません

ログインしてレビューを書く

その他のほかのサーバーとの比較i

  • このカテゴリのほかの20134件のうち97%よりスターが多い
  • このカテゴリのほかの20134件のうち94%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの20134件のうち100%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

AI Guardは安全ですか?

当てはまる基本チェック3項目のうち3項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は一昨日、最新バージョン(1.4.7)がレジストリに届いたのは一昨日です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにNode.jsも必要です。

代わりに使えるものは?

同じカテゴリには:World Monitor, openstatus, Oh My Posh Validator, Strata, Jitsu

似た働きのほかの候補

同じカテゴリでほかの作者のもの。コマンドは確認済み。公式を先に、次にスター順。

カードの見方:↓ 週あたりのダウンロードi★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

World Monitor

Real-time global intelligence on conflict, markets, energy, trade, shipping and cyber. 100 tools.

作者:koala73広く使われている★ 9.1万今日更新

クラウドで動く✓ 提供元 · worldmonitor.app

openstatus

Manage monitors, status pages, incidents and maintenances in your openstatus workspace.

作者:openstatusHQ広く使われている★ 92692 か月前更新

クラウドで動く✓ 提供元 · openstatus.dev

Oh My Posh Validator

Validate oh-my-posh configurations and segment snippets against the official schema.

作者:JanDeDobbeleer広く使われている★ 2.4万 リポジトリ全体のスター27 日前更新

クラウドで動く✓ 提供元 · ohmyposh.dev

Strata

MCP server for progressive tool usage at any scale (see https://klavis.ai)

作者:Klavis-AI成長中★ 582714 か月前更新

クラウドで動くリポジトリはアーカイブ済み✓ klavis.ai

Jitsu

Manage Jitsu data pipelines: destinations, streams, connections, functions, live events.

作者:jitsucom広く使われている★ 51354 か月前更新

クラウドで動く✓ 提供元 · jitsu.com
似たものと比べる
これ
AI Guard
World MonitoropenstatusOh My Posh ValidatorStrataJitsu
動く場所パソコンにインストールが必要クラウドで動き、インストール不要クラウドで動き、インストール不要クラウドで動き、インストール不要クラウドで動き、インストール不要クラウドで動き、インストール不要
キーが必要いいえいいえいいえいいえいいえいいえ
Claude で + から追加いいえいいえいいえいいえいいえいいえ
基本チェック3/34/44/44/41/44/4
ライセンスMITAGPL-3.0AGPL-3.0MITApache-2.0MIT
料金登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし登録情報に費用の記載なし

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

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 27 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
  • 27 of 27 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

[!IMPORTANT]

- AI Guard is NOT an AI detector. It does not attempt to predict whether code was authored by an LLM or a human.

- AI Guard detects dangerous or fragile code patterns that LLMs repeatedly introduce due to incomplete context, hallucinated patterns, or probabilistic generation.

- AI Guard does NOT replace ESLint. It extends ESLint with 27 specialized, high-impact rules that core ESLint and standard configurations omit.


Why AI Guard?

AI coding assistants write code at remarkable velocity, but generated code repeatedly suffers from predictable reliability and security anti-patterns that conventional linters miss:

PatternWhy AI Assistants Generate ItReal-World Impact
Floating PromisesOmits await, return, or .catch() on async callsUnhandled promise rejections, silent failures in background jobs
Async Array IterationPasses async callbacks into array.map() or .filter()Returns unawaited Promise[] instead of resolved values
Sequential Awaits in LoopsLoops over items with sequential awaitSignificant latency bottlenecks; blocks event loop execution
Empty Catch BlocksInserts generic try { ... } catch (e) {} blocksSwallows production exceptions silently without telemetry
Hardcoded SecretsInjects placeholder or real API keys/tokensCredential leakage in version control and deployment bundles
Dynamic `eval()`Generates dynamic function compilationArbitrary code execution and code injection
Raw SQL ConcatenationConcatenates query strings with variablesSevere SQL injection vulnerabilities
Unsafe DeserializationCalls JSON.parse(req.body) directly without schema checksDenial of service and unhandled runtime crashes
Missing Route Auth & AuthzEmits boilerplate endpoints without auth middlewareUnprotected API endpoints and IDOR privilege escalations
Dead Branches & ScaffoldingLeaves if (true) or conflicting conditions from prompt iterationsBloated bundles and dead code paths

AI Guard provides an instantaneous, deterministic feedback loop that catches these issues before they reach pull requests or production.


Architecture & Workflow

flowchart TD

subgraph Dev["1. Development & Prompt Phase"] A["Developer + AI Coding Assistant\n(Copilot, Cursor, Claude Code)"] --> B["JavaScript / TypeScript Code"] end

subgraph ShiftLeft["Shift Left — Context Injection"] SL["npx ai-guard init-context"] -.-> CTX["CLAUDE.md\n.cursorrules\ncopilot-instructions.md"] CTX -.-> A end

subgraph Analysis["2. Deterministic AST Analysis"] B --> C["ESLint Parser\n(espree / @typescript-eslint/parser)"] C --> D["AST Representation"] D --> E["AI Guard Rules Engine\n(27 Deterministic Rules)"] end

subgraph Tiers["3. Classification & Presets"] E --> F{"Active Preset\n(recommended | strict | security | agent)"} F --> G["Confidence Tiering & AST Filtering"] end

subgraph Outputs["4. Output & Remediation"] G --> H["Local CLI Scanning\n(ai-guard run / changed)"] G --> I["Autofix Remediation\n(eslint --fix)"] G --> J["HTML Dashboard\n(ai-guard report)"] G --> K["SARIF 2.1.0 Artifact\n(ai-guard --sarif)"] end

subgraph CI["5. GitHub Pull Request & CI/CD"] K --> L["GitHub Action\nai-guard-dev/eslint-plugin-ai-guard@v1"] L --> M["GitHub Code Scanning Alerts"] L --> N["Inline PR Code Annotations"] L --> O["PR Status Check (Blocks Merge)"] end


Rules Catalog

AI Guard includes 27 deterministic rules divided into four specialized categories. Every rule is engineered with low false-positive heuristics and validated against real-world production codebases:

🔴 Security (10 Rules)
RuleRecommendedWhat It CatchesFixable?
no-hardcoded-secret`error`API keys, bearer tokens, passwords, and private keys committed directly in source code.Yes (process.env.*)
no-eval-dynamic`error`eval(), new Function(), and setTimeout/setInterval with dynamic/non-literal string expressions.No
no-sql-string-concatwarnSQL queries constructed by string concatenation or raw template literals — SQL injection risks.No
no-unsafe-deserializewarnUnchecked JSON.parse() called directly on HTTP request inputs (req.body, req.query, req.params).No
require-auth-middlewarewarnExpress and Fastify route definitions exposed without authentication middleware.No
require-authz-checkwarnEndpoints accessing sensitive resources or user IDs without tenant/ownership authorization checks.No
no-client-exposed-secret`error`Server secrets that reach the browser: NEXT_PUBLIC_/VITE_/EXPO_PUBLIC_ prefixes on secret keys, server secrets in "use client" files, dangerouslyAllowBrowser with the app's own key.No
no-invisible-unicode`error`Trojan Source bidi overrides, zero-width and Hangul-filler characters, and Unicode tag characters that hide instructions for AI tools (decoded in the message).Yes (escapes in strings, removal in comments)
no-unsanitized-htmlwarnDynamic values in innerHTML, insertAdjacentHTML, document.write and dangerouslySetInnerHTML, with sharper messages for URL input, LLM output, markdown and JSON-LD.No
no-undeclared-importwarnImports of packages missing from package.json: hallucinated names (slopsquatting) and phantom dependencies. Offline and monorepo-aware.No
🟠 Reliability (5 Rules)
RuleRecommendedWhat It CatchesFixable?
no-empty-catch`error`Empty catch (e) {} blocks that silently swallow exceptions without logging or rethrowing.No (editor suggestion: rethrow)
no-broad-exceptionwarnCatching broad exception types like catch (e: any) that mask system faults and typing.No
no-catch-log-rethrowoff*Catch blocks that only log to console and rethrow without adding context or diagnostic info.No
no-catch-without-useoff*Caught error variables that are declared in catch parameters but never referenced.No
no-silent-fallbackwarnSecret env vars with hardcoded fallbacks (`process.env.JWT_SECRET \\'secret') and catch { return [] }` around awaited I/O.No
🟡 Async Stability (5 Rules)

| Rule | Recommended | What It Catches | Fixa

冒頭だけを表示しています。続きはリポジトリで読めます