Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Multi-agent LLM security layer detecting prompt injection and jailbreaks.

README.md

<div align="center"> <img src="https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12-blue?logo=python&logoColor=white"> <img src="https://img.shields.io/badge/License-MIT-green"> <img src="https://img.shields.io/github/actions/workflow/status/Akhilucky/AI-firewall/ci.yml?branch=main&label=CI&logo=github"> <img src="https://img.shields.io/pypi/v/ai-firewall-mcp?label=PyPI&logo=pypi"> <img src="https://img.shields.io/docker/v/akhilucky/ai-firewall-mcp/latest?label=Docker%20Hub&logo=docker"> <img src="https://img.shields.io/badge/MCP-Registry-8A2BE2"> <br> <a href="https://github.com/Akhilucky/AI-firewall"><b>GitHub</b></a> • <a href="https://pypi.org/project/ai-firewall-mcp/"><b>PyPI</b></a> • <a href="https://hub.docker.com/r/akhilucky/ai-firewall-mcp"><b>Docker Hub</b></a> </div>

<mcp-name: io.github.Akhilucky/ai-firewall-mcp>

AI Firewall — MCP Server

A multi-agent AI security layer that protects LLMs from prompt injection, jailbreaks, and policy violations. Available as an MCP server for any MCP-compatible client (Claude Desktop, Cursor, Windsurf, Cline, Roo Code, etc.).

Quick Start

pip install

pip install ai-firewall-mcp
ai-firewall-mcp

Docker

docker pull akhilucky/ai-firewall-mcp:latest
docker run -i akhilucky/ai-firewall-mcp:latest

Claude Desktop

Add to claude_desktop_config.json:

pip install: ``json { "mcpServers": { "ai-firewall": { "command": "pipx", "args": ["run", "ai-firewall-mcp"] } } } ``

Docker: ``json { "mcpServers": { "ai-firewall": { "command": "docker", "args": ["run", "-i", "akhilucky/ai-firewall-mcp:latest"] } } } ``

Cursor / Windsurf / Cline / Roo Code

Configure in your MCP settings with:

  • Type: stdio
  • Command: docker run -i akhilucky/ai-firewall-mcp:latest
  • Or use ai-firewall-mcp if installed via pip

MCP Tools

| Tool | Description | |------|-------------| | analyze_prompt | Analyze a prompt for injection, jailbreaks, exfiltration, and leakage | | get_threat_breakdown | Detailed per-signal scoring breakdown from the last analysis | | sanitize_prompt | Clean a suspicious prompt while preserving legitimate content | | get_firewall_status | Health check: vector DB size, model status, uptime | | benchmark_firewall | Run the adversarial test suite and return detection statistics |

Testing with MCP Inspector

npx @modelcontextprotocol/inspector ai-firewall-mcp

Architecture

The firewall runs three agents per prompt:

User Prompt → [Retrieval Agent] → [Guard Agent] → [Policy Agent] → LLM
                   │                    │               │
                   ▼                    ▼               ▼
              Vector DB (FAISS)    Threat Signals    Allow/Block

| Agent | Role | |-------|------| | Retrieval Agent | Semantic search against known attack patterns (FAISS + sentence-transformers) | | Guard Agent | Multi-signal classification: vector similarity, keyword match, heuristic scoring | | Policy Agent | Final decision: ALLOW / BLOCK / SANITIZE based on configurable thresholds |

Threat signals are weighted: 40% vector similarity, 25% keyword match, 20% heuristic, 15% policy weight.

Configuration

| Env Var | Default | Description | |---------|---------|-------------| | FIREWALL_MODE | strict | strict / moderate / permissive | | SIMILARITY_THRESHOLD | 0.50 | Vector match threshold (lower = stricter) | | LOG_LEVEL | INFO | Logging verbosity |

CLI / API Usage

# Interactive dashboard
python main.py

# Red-team adversarial tests
python main.py --redteam

# REST API server
python main.py --api

# Single prompt analysis
python main.py --analyze "Ignore all previous instructions"

The REST API runs at http://localhost:8000 with OpenAPI docs at /docs (requires pip install ai-firewall-mcp[api]).

Testing

pytest tests/ -v          # Full test suite (43 tests)
pytest tests/test_mcp.py  # MCP-specific tests only

Project Structure

├── src/ai_firewall/          # MCP server package (PyPI entry)
│   ├── mcp_server.py         #    5 MCP tools, stdio transport
│   ├── threat_scorer.py      #    Per-signal scoring breakdown
│   └── __init__.py
├── src/agents/               # Core firewall agents
├── tests/                    # Test suites
├── Dockerfile                # Docker image (2.04GB, CPU-only torch)
├── pyproject.toml            # Package config & metadata
└── .github/workflows/ci.yml  # CI/CD pipeline

License

MIT — see LICENSE.

---

<div align="center">Built for security. Designed for production.</div>

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use AI & ML servers.