Skip to main content

Take back control. Intercept, audit, and route your AI traffic.

Project description

๐Ÿ›ก๏ธ AI DevSec Gateway (formerly AI Network Blocker)

Take back control. Intercept, audit, and route your AI traffic.

AI DevSec Gateway Interface

Python Version Platform Test Suite Status Security Scan Status codecov PyPI version License Latest Release

English | Espaรฑol


๐Ÿ“– What is this?

AI DevSec Gateway is a free, open-source, desktop tool that puts you back in charge of the AI tools running on your machine. Originally a simple network blocker, it has evolved into a full DevSecOps proxy.

It helps you block unauthorized data leaks, audit your running environment using OpenAI's API, and transparently route cloud AI requests to your own Local LLMs (like Llama 3 via Ollama) or your personal API keys (BYOK).

With one click it:

  1. Blocks & Redirects 38+ AI domains to 127.0.0.1 in your hosts file.
  2. Routes local traffic through a transparent API Gateway to your Local LLM.
  3. Audits your active editor processes and generates security recommendations via the OpenAI API.

๐Ÿค” Why does this exist?

AI coding assistants have deep, unrestricted access to your files, your clipboard, and your terminal. Even when you stop using them, their processes keep running in the background, silently maintaining open connections to remote servers. That means:

  • Code you wrote hours ago could still be transmitted.
  • Prompts containing proprietary logic could be cached or logged on third-party servers.
  • You have no visibility into what data is being sent, or when.

AI Network Blocker gives you a hard, deterministic kill switch. No ambiguity. No trust required. The hosts file is a system-level override โ€” if a domain resolves to 127.0.0.1, nothing gets through. Period.


โœจ Features

Feature Description
๐Ÿ”€ Local API Router Intercept Copilot/Cursor traffic and route it to your own Local LLM (Ollama/LM Studio).
๐Ÿ›ก๏ธ AI DevSec Auditor Live analysis of your running processes to detect data leak risks, powered by OpenAI. API keys are read at runtime and are not saved to disk.
๐Ÿ”’ One-click Kill Switch Block or unblock all AI services instantly via the system hosts file.
๐ŸŒ Multilingual support 10 languages supported with automatic system detection.
๐ŸŽจ Premium dark UI Modern Catppuccin Mocha theme with color-coded status and tabs.
๐Ÿ”‘ Smart elevation Auto UAC on Windows, clear sudo instructions on Unix.
๐Ÿ‘๏ธ Live process detection Continuously polls and shows which AI editors are currently running.
๐Ÿ“ฆ Portable Single-file executable builds available without heavy dependencies.

๐ŸŽฏ Blocked Providers & Domains

The default blocklist targets 38+ domains across 10 categories:

Provider # Domains Key domains
๐ŸŸข OpenAI 9 api.openai.com ยท chatgpt.com ยท platform.openai.com
๐ŸŸ  Anthropic 4 claude.ai ยท api.anthropic.com ยท anthropic.com
๐Ÿ™ GitHub Copilot 4 copilot.github.com ยท api.githubcopilot.com
๐Ÿ”ต Google AI 4 gemini.google.com ยท aistudio.google.com
๐ŸŸฆ Microsoft Copilot 3 copilot.microsoft.com ยท bing.com
๐Ÿ”ท Meta AI 2 meta.ai ยท ai.meta.com
๐ŸŒŠ Mistral AI 2 mistral.ai ยท api.mistral.ai
๐Ÿ”ฎ DeepSeek 2 deepseek.com ยท api.deepseek.com
๐Ÿค– xAI 3 x.ai ยท api.x.ai ยท grok.x.ai
๐Ÿ“ฆ Others 3 perplexity.ai ยท app.wordware.ai

Want to add or remove domains? Edit the BLOCKLIST dictionary inside ai_blocker/constants.py. It's a simple Python dict โ€” no recompilation needed if you run from source.


๐Ÿ—๏ธ Architecture & Flow

AI DevSec Gateway works as a local interceptor and routing engine. It overrides public AI hostnames at the OS resolver level and runs a local proxy server to capture requests.

graph TD
    subgraph Client ["Developer Machine"]
        IDE[IDE / Editor <br> Cursor, VS Code, etc.]
        App[AI DevSec Gateway GUI]
        Proxy[Transparent Local Gateway <br> HTTP Server: 127.0.0.1]
        Hosts[OS Hosts File]
    end

    subgraph External ["Public Cloud & API"]
        Ollama[Local LLM <br> Ollama / LM Studio]
        OpenAI[OpenAI / Anthropic Cloud]
    end

    IDE -->|1. Resolve domain| Hosts
    Hosts -->|2. Loopback redirection| IDE
    IDE -->|3. Route requests| Proxy
    
    Proxy -->|If Blocked| Loopback[127.0.0.1: Connection Refused]
    Proxy -->|4. If Route active| Ollama
    Proxy -.->|Audit telemetry| OpenAI

Key Components:

  • DNS Overrider (Hosts Engine): Inserts custom comments (# AI-Block) to route domains like api.openai.com to loopback.
  • Local API Gateway: Spin up an HTTP server locally to capture network requests from IDEs and proxy them transparently.
  • Active Connection Auditor: Performs runtime socket verification to determine blocking status and alert developers immediately.

๐Ÿ“ Project Structure

Since v1.2.1, the project has been modularized for improved maintainability:

ai_blocker/
โ”œโ”€โ”€ __init__.py         # Package entry and versioning
โ”œโ”€โ”€ __main__.py         # Run entry point (single instance & elevation check)
โ”œโ”€โ”€ constants.py        # Blocklist domains and Catppuccin color codes
โ”œโ”€โ”€ config.py           # User preferences and autostart registration
โ”œโ”€โ”€ i18n.py             # Language translations loader
โ”œโ”€โ”€ system_utils.py     # OS operations (admin checking, DNS flushing)
โ”œโ”€โ”€ block_actions.py    # Process closing and hosts file editing
โ”œโ”€โ”€ gateway.py          # HTTP transparent proxy server
โ”œโ”€โ”€ tray.py             # Native Windows system tray integration
โ””โ”€โ”€ ui.py               # Tkinter application interfaces and themes

๐Ÿ”’ Security Model

Zero-Persistence BYOK

API keys used for the DevSec Auditor are never stored on disk or cached in configuration files. They are:

  • Provided via runtime environment variables (OPENAI_API_KEY), or
  • Entered in memory in the UI and cleared immediately upon application exit.

Minimal hosts file modification

Our engine uses standard system calls to edit hosts. It isolates modifications strictly within lines containing the # AI-Block tag, ensuring that your system's existing mappings are completely untouched.


๐Ÿค Project Governance & Community

This project is built and maintained following open-source best practices:


๐Ÿš€ Quick Start

Option A โ€” Download the ready-to-use executable

  1. Go to the Releases page.
  2. Download the binary for your operating system.
  3. Run the executable.
    • Windows: Double-click AI-Router-Blocker-AiO.exe. Click Yes on the UAC prompt.
    • Linux / macOS: Open a terminal and run sudo ./AI-Router-Blocker-AiO (root privileges required to modify /etc/hosts).
  4. Click the big button to toggle the block on or off. That's it.

The binaries are self-contained and portable. No installation, no dependencies, no Python required.

Option B โ€” Run from source code

# 1. Clone the repository
git clone https://github.com/Akunimal/AI-Router-Blocker-AiO.git

# 2. Run the script (Python 3.x required)
# On Windows (auto-elevates via UAC):
python ai_blocker.py

# On Linux / macOS (requires sudo):
sudo python3 ai_blocker.py

Option C โ€” Install via pip

pip install ai-devsec-gateway
python -m ai_devsec_gateway

DevSec Auditor API keys

The DevSec Auditor asks for an OpenAI API key only when you run an audit. The key is kept in memory for that run and is not written to config.json. If you prefer not to paste it into the UI each time, set OPENAI_API_KEY in your environment before launching the app.


๐Ÿ”จ Building the .exe yourself

If you want to compile the executable from source (to verify it, modify it, or just learn how), follow these steps:

Prerequisites

  • Python 3.x installed and available in your PATH
  • PyInstaller (the packaging tool):
pip install pyinstaller

Method 1 โ€” Using the included build scripts

# On Windows, run the batch file:
build.bat

# On Linux / macOS, run the bash script:
./build.sh

The script will:

  1. Clean any previous build artifacts (build/, dist/, *.spec)
  2. Compile ai_blocker.py into a single binary (with admin manifest on Windows)
  3. Copy the final executable to the project root

Method 2 โ€” Manual command

Windows:

pyinstaller --onefile --windowed --uac-admin --name "AI-Router-Blocker-AiO" --clean ai_blocker.py

| Privileges | Administrator / root (Windows auto-requests UAC; Linux/macOS run via sudo) | | Python | 3.10+ (3.10, 3.11, 3.12, 3.13) โ€” only needed if running from source | | Dependencies | None. Uses only Python standard library (tkinter, ctypes, subprocess) | | Disk space | ~12 MB for the binary, ~15 KB for the .py source |


โš ๏ธ Disclaimer

This tool modifies your system's hosts file located at:

  • Windows: C:\Windows\System32\drivers\etc\hosts
  • Linux/macOS: /etc/hosts

It only adds or removes lines that contain the marker comment # AI-Block. It will never touch other entries in your hosts file.

That said:

  • Always keep a backup of your hosts file before using any tool that modifies it.
  • Use this software at your own risk.
  • The authors are not responsible for any unintended consequences.

๐Ÿ—บ๏ธ Roadmap & Future Vision

We are actively developing AI DevSec Gateway to become the ultimate privacy proxy. Our upcoming features include:

  • Deep Packet Inspection (DPI): Intercept HTTPS to block specific API routes (e.g., /completions).
  • Token Cost Dashboard: Track spending when proxying requests to cloud APIs.
  • Multi-Provider Auditors: Support Anthropic and Mistral for the DevSec security audits.

Check out our complete ROADMAP.md to see where the project is heading and how you can contribute!


๐Ÿ“œ License โ€” Free as in Freedom

This project is released under the MIT License โ€” see LICENSE for the full text.

In plain language: you are free to use, copy, modify, merge, publish, distribute, sublicense, and even sell copies of this software. There is no restriction whatsoever. This project was made without any commercial intent and is offered to the community as a public good.

Do whatever you want with it. Fork it, rebrand it, translate it, embed it in your own tools โ€” no attribution required (though it's always appreciated). The only condition is that the license text stays included if you redistribute it.

This is a non-profit, community-driven project. No ads. No telemetry. No tracking. No monetization. Ever.


๐Ÿค Contributing

Contributions are welcome! If you want to:

  • Add new AI domains or providers to the blocklist
  • Improve the UI or add features
  • Translate the interface to another language

Just open a Pull Request or an Issue. All contributions, big or small, are valued.


๐Ÿ’ก Why open source?

Trust is everything when a tool touches your system files. AI DevSec Gateway is:

  • Auditable โ€” readable, well-commented Python source with a comprehensive test suite
  • Commented โ€” every function contains detailed explanations in both English and Spanish
  • Transparent โ€” no obfuscation, no compiled binary blobs in source, and no telemetry. Network access is limited to user-visible features such as the router, auditor, and connectivity checks.
  • Deterministic โ€” it either edits the hosts file or it doesn't. Nothing else.

You own your machine. You set the rules.


Reclaim your sovereignty.
One click. Total control.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_devsec_gateway-1.2.1.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_devsec_gateway-1.2.1-py3-none-any.whl (30.9 kB view details)

Uploaded Python 3

File details

Details for the file ai_devsec_gateway-1.2.1.tar.gz.

File metadata

  • Download URL: ai_devsec_gateway-1.2.1.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ai_devsec_gateway-1.2.1.tar.gz
Algorithm Hash digest
SHA256 188bf01eb456c84f82e86e806e709704443bbca96ebf4b4e7a0e5fb109f9b77b
MD5 0e16c220e026c1660a603bd86203e362
BLAKE2b-256 4ded13f736ea8a3ff06f8037dc27269e8f3b3c9df5f6373cb7839f38b82ae9c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_devsec_gateway-1.2.1.tar.gz:

Publisher: publish.yml on Akunimal/AI-Router-Blocker-AiO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ai_devsec_gateway-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_devsec_gateway-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2092f24d52e0bc3e87a21abdf9f00fe9cbab5e0867bcbc1194201c8272894857
MD5 57acc17a86f6975c3356e93734f463a5
BLAKE2b-256 9b1e744253e2ba1a6e723d124d46bdb5140cbf51d99ee29a8d292cfab1ac1104

See more details on using hashes here.

Provenance

The following attestation bundles were made for ai_devsec_gateway-1.2.1-py3-none-any.whl:

Publisher: publish.yml on Akunimal/AI-Router-Blocker-AiO

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page