Nethergate — AI skill for Claude Code
An audited gate that lets AI agents (Claude Code / Codex) defend a Linux server through narrow MCP tools — no shell.
How to install Nethergate
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open kuramichi2010/nethergate and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Nethergate does
An audited gate that lets AI agents (Claude Code / Codex) defend a Linux server through narrow MCP tools — no shell. Rule + AI triage, nftables enforcer with policy guardrails, playbook & human lessons. AIエージェントにサーバー防御を安全に任せるためのゲート。
Alternatives in AI
- Unofficial Claude Code Prompt Playbook — Unofficial playbook for production-grade LLM system prompt architecture, derived from local analysis of Claude 258 ★
- Cplt — Sandbox for AI coding agents 114 ★
- Agentlint — Local guardrails for AI coding agents 38 ★
README
nethergate
**作者 / Author: Michitaka Kurahashi** · ライセンス: [MIT](LICENSE)
Claude Code や Codex のような AI エージェントに、**サーバーの防御だけを安全に任せる**ための「門」です。 AIにはシェルも生ログも渡しません。決められた狭い道具(MCPツール)だけを渡し、 AIがどう判断しても、ポリシーを超える操作は物理的にできない構造にしています。
管理用PC / 別ホスト(AIはここで動く)
┌──────────────────────────────────────────┐
│ Claude Code / Codex (サブスクリプション) │
└───────────────┬──────────────────────────┘
│ SSH(鍵は "nethergate mcp" しか起動できない)
════════════════ 防御対象サーバー ═══════════════╪═══════════════════════
▼
┌──────────────────────── ng-agent(権限なし)──────────────────────┐
│ nethergate mcp … AI用の7つのツールのみ。ログは無害化して渡す │
│ nethergate watch … ログ監視 → ルールで即ブロック / AIに調査依頼 / 通知 │
└──────────────┬─────────────────────────────────────────────────────┘
│ Unixソケット(接続元UIDを確認)
┌──────────────▼──── ng-enforcer(CAP_NET_ADMIN だけ)─────────────────┐
│ nethergate enforcer … ポリシーで検査 → nftables のセットに単一IPを時限追加 │
└───────────────────────────────────────────────────────────────────┘
すべての判断・操作 → ハッシュチェーン付きの監査ログ(改ざんは検出できる)
AIができること / できないこと
| AIに渡すツール | 内容 |
|---|---|
status |
深刻度ごとの件数、上位の送信元、現在のブロック |
list_incidents / get_incident |
送信元IPごとの攻撃の種類、狙われた入口、攻撃者の種別の推定、無害化したサンプル |
enrich_ip |
公開情報のみの照会:逆引き、ASN、RDAP(abuse連絡先)、Shodan InternetDB、Torの出口ノード一覧、AbuseIPDB |
block_ip / unblock_ip |
単一IPの一時的なブロック(期限つき)とその解除 |
save_report |
管理者向けのMarkdownレポートを保存(ファイル名はサーバーが決める) |
request_human_review |
判断に自信がないとき、ブロックせずにユーザーに相談する(Webhookで通知される) |
list_playbook / propose_rule |
記録書(プレイブック)を見る / 新しい攻撃パターンをルールとして提案する(ユーザーが承認するまでは何の効果もない) |
**できないこと**:コマンドの実行、ファイルの読み書き、IP範囲(CIDR)のブロック、許可リストやプライベートIPのブロック、 **このサーバーを攻撃していないIPのブロック**(スコアが `ai_min_score` 未満なら拒否)、TTL上限や1時間あたりの件数上限を超える操作。
攻撃してくるAIへの対策
| 脅威 | 対策 |
|---|---|
| プロンプトインジェクション(User-Agentやパスに「指示を無視して〜」を仕込む) | 制御文字やbidi文字を除去し、秘密情報をマスクし、160文字で切り詰める。untrusted_* ラベルを付け |
Related Skills
MCP Vps Toolkit
Policy-gated MCP server that lets Claude, Cursor and other AI agents inspect and operate a Linux VPS safely: r
Jevc
Compile agent policy prose into deterministic verdict programs: narrow evidence questions for the model, the v
Opus Magnum
The Great Work for Claude Code — an adaptive method for long-horizon, high-trust AI builds. Triage, elements,
AI Engineering Playbook
Practical playbook for AI-assisted engineering: rules, role separation, and guardrails for teams using Cursor/
8 Ball
A Swiss Army knife that lets AI agents get the most out of decision models, simply. Typed yes/no, choice and s
JevGuard
Semantic policy engine for AI coding agents. Reviews every agent change against your repo's plain-Markdown rul
Related Agents
Cross Platform Auditor
Audit shell scripts for macOS and Linux compatibility
Bash Scripter
Use this agent when you need to write or fix bash/shell scripts — entrypoints, setup scripts, statusline scrip
Lesson Distiller
Sole owner of superhuman's durable knowledge base. Seed mode authors a repo architecture dossier grounded in a