ai-net-guard
Health Pass
- License — License: MIT
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 16 GitHub stars
Code Fail
- rm -rf — Recursive force deletion command in build-app.sh
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
The macOS & Windows kill switch that stops AI apps from leaking direct traffic. Watches the real exit of Claude, Antigravity, Cursor and ChatGPT, freezes leaks the instant your proxy drops, and auto-resumes when it returns. Zero dependencies, no system extension.
AI NetGuard is a native macOS & Windows network guard that watches the real egress of your AI apps and stops accidental direct connections before your accounts get flagged. Zero third-party dependencies, no kernel or system extensions, ready in seconds.
- macOS: Native SwiftUI + AppKit menu bar app with Liquid Glass (
SIGSTOP/SIGCONTfreeze,lsof+utun+NWPathMonitor). - Windows 10/11: Single-binary Go + Win32 native app with System Tray + Web Console (
http://127.0.0.1:17899),NtSuspendProcess/NtResumeProcessfreeze,GetExtendedTcpTable/GetExtendedUdpTablesocket attribution, and Wintun/TUN detection.
Ordinary proxy clients handle routing, not account protection. When a proxy client restarts, a node drops, an Electron helper ignores local ports, or your Mac wakes from sleep a few seconds before your proxy reconnects, apps like Claude, Antigravity, Cursor, ChatGPT, and CLI tools silently fall back to your real ISP IP. AI NetGuard watches every process route live and freezes or stops leaking apps the instant traffic steps out of line.
Demo
https://github.com/user-attachments/assets/7f7f3adf-a135-4947-90ec-c2c5f5f0e6d0
00:00The Drop Risk — How desktop helpers fall back to direct ISP traffic during proxy restarts or node switches.00:08Live Per-App Exit — Seeing every guarded AI process, exit IP, ISP purity, and 1-RTT latency in one glance.00:14Instant Freeze & Auto-Resume — Suspending leaking processes withSIGSTOPand seamlessly thawing withSIGCONTonce your proxy recovers.00:20Health Audit & Rules — 100-point safety audit, one-click proxy rules, and native CLI + MCP 2025 agent setup.
Quick Start
AI NetGuard runs natively on macOS 14.0+ (full Liquid Glass material on macOS 26/27+) and Windows 10/11 (x64 & ARM64).
1. Install
Pick whichever fits your workflow.
1.1 Download the app
macOS: Unzip and drag
AINetGuard.appinto/Applications. Because open-source builds are ad-hoc signed without paid Apple notarization, clear the macOS quarantine attribute once in Terminal before first launch:xattr -dr com.apple.quarantine /Applications/AINetGuard.app open /Applications/AINetGuard.appWindows: Unzip and double-click
ai-netguard-tray-windows-amd64.exeto run silently in the system tray (opens the local Web Console athttp://127.0.0.1:17899), or install the CLI to PATH in PowerShell:.\ai-netguard-windows-amd64.exe install-cli
1.2 Build from source & install CLI
macOS (requires Xcode):
git clone https://github.com/Denszh/ai-net-guard.git cd ai-net-guard ./build-app.sh --install open ~/Applications/AINetGuard.app /Applications/AINetGuard.app/Contents/MacOS/AINetGuard install-cliWindows (pure Go 1.22+, zero CGO — see windows/README.md):
cd ai-net-guard/windows ./build.sh
1.3 Let your AI agent set it up
Paste this into Claude Code, Cursor, or Antigravity:
Set up AI NetGuard for me: https://github.com/Denszh/ai-net-guard
Read AGENTS.md, run `ai-netguard setup claude --dry-run` to inspect my exit IP purity first, then walk me through locking my baseline exit and proxy rules.
2. Run your first protection check
Once the app is running (or ai-netguard is installed in PATH), run a baseline setup and health audit:
ai-netguard # Open interactive terminal dashboard
ai-netguard setup claude --dry-run # Check exit ISP purity and lock plan
ai-netguard audit # Run the 7-item 100-point security audit
Everything—process inspection, route classification, socket logs, and configuration backups—stays 100% locally on your Mac with zero telemetry or analytics servers.
Supported Proxy Clients
AI NetGuard automatically detects active system proxies (scutil --proxy), common local proxy ports (1087, 7897, 7890, 6152, 1080), and active utun interfaces, and exports AI-safe domain-lock + QUIC-block rules for 7 major clients:
| Shadowrocket | Clash / Mihomo | Surge | Stash | Quantumult X | Loon | Sing-box |
Highlights of AI NetGuard
| Feature | What it does |
|---|---|
| 3-hop live route topology & true 1-RTT latency | Draws every guarded AI app through your local proxy node to its resolved exit region and IP with smooth animated paths. Click any app to highlight its full path, and view 1-RTT HTTP latency that strips cold TLS handshake overhead so numbers stay consistent with your proxy client. |
Gentle Freeze (SIGSTOP) & Auto Quit Kill Switch |
Choose Gentle Freeze to suspend leaking processes while preserving active chats and prompts—then auto-thaw via SIGCONT the moment your proxy returns—or Auto Quit (SIGTERM) to terminate immediately with zero background retries. |
| Temporary Pause Timer & Sleep/Wake Escort | Pause interception for 5, 15, or 30 minutes with an auto-resume countdown when switching nodes or running large downloads. On Mac wake or Wi-Fi changes, NWPathMonitor buffers transition seconds until the proxy settles. |
| 100-point Health Audit & WebRTC/STUN Guard | Audits 7 checks including proxy reachability, zero direct sockets, pure-Swift RFC 5389 STUN WebRTC probes, UDP/QUIC leak guards, exit baseline fencing, Claude CLI lock (~/.claude/settings.json), and macOS firewall. Each failed check ships actionable one-click fixes. |
| Native Menu Bar, Full Dashboard & Auto-Updater | Runs silently in the menu bar with monochrome globe presets, pops open into a resizable full Dashboard window for traffic trends and session logs, and includes a built-in SHA-256 verified GitHub Releases self-updater. |
| Built-in TUI, CLI & MCP 2025 Server | Same native binary provides an interactive zero-flicker terminal TUI, scriptable CLI with automatic config backups (fix undo), and 9 structured MCP tools so Claude Code, Cursor, or Antigravity can audit and configure rules directly. |
AI NetGuard vs existing setups
Most users start with a proxy client or shell env vars. The real question is what catches the 2-second gap when a proxy drops, a helper ignores ports, or an exit IP drifts inside the same country.
| Capability | AI NetGuard | Proxy client alone | System VPN only | Manual HTTP_PROXY env |
|---|---|---|---|---|
| Per-app process & child daemon route verification | Yes | — | — | — |
Instant SIGSTOP freeze on direct fallback + auto-thaw |
Yes | — | — | — |
| Same-country exit IP drift & datacenter fence alerts | Yes | — | — | — |
| Pure-Swift WebRTC / STUN UDP leak probe | Yes | — | Partial | — |
| Sleep/wake & Wi-Fi transition guard | Yes | — | Partial | — |
| Temporary 5 / 15 / 30 min pause countdown | Yes | — | — | — |
| Per-app proxy port override & 7-client rule generator | Yes | — | — | — |
| Native CLI + TUI + MCP 2025 automation | Yes | — | — | — |
| Zero third-party deps & local-only state | Yes | Varies | — | Yes |
CLI & MCP Server
Install the CLI via Settings -> CLI / MCP in the app or run /Applications/AINetGuard.app/Contents/MacOS/AINetGuard install-cli, then run:
ai-netguard # Launch fullscreen interactive TUI dashboard
ai-netguard setup claude [--dry-run] [--policy PROXY] # Check ISP purity, lock IP baseline & enable guard
ai-netguard status [--json] [--no-probe] # Print active proxy, tunnels & per-app route status
ai-netguard audit [--fix] [--json] # Run 7-item audit with reversible auto-fixes
ai-netguard fix undo [--list] # Roll back config changes from backups/
ai-netguard rules --format clash --services claude,cursor
ai-netguard dry-run [--json] # Safe Kill Switch sandbox drill
ai-netguard update [--check] [--yes] # Check & apply SHA-256 verified release updates
ai-netguard mcp install --client claude # Register MCP 2025 Server (claude | cursor | antigravity)
Exposed MCP 2025 tools: setup_claude_guard, get_network_status, run_health_audit, apply_fix, undo_last_fix, generate_proxy_rules, run_kill_switch_dry_run, get_config, get_traffic_stats.
Run the built-in self-test suite (43 unit tests) or live snapshot dump directly from the app binary:
/Applications/AINetGuard.app/Contents/MacOS/AINetGuard --self-test
/Applications/AINetGuard.app/Contents/MacOS/AINetGuard --dump-snapshot
Docs
- Interactive showcase, FAQ & live route simulator: denszh.github.io/ai-net-guard
- Windows version guide & CLI reference: windows/README.md
- Architecture & telemetry design: docs/ARCHITECTURE.md
- AI agent operating playbook: AGENTS.md
Star History
License
Released under the MIT License.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found