Apache 2.0 Licensed

Self-Host the AI Security Gateway

Open-source LLM proxy with PII redaction, prompt injection blocking, and secret detection. Deploy on your infrastructure with Docker Compose in 60 seconds. No account required. No telemetry.

Quickstart
git clone https://github.com/aisecuritygateway/aisecuritygateway.git
cd aisecuritygateway
cp .env.example .env          # add your provider key
docker compose up -d           # gateway + presidio

Then send requests to http://localhost:8000/v1/chat/completions

What’s Included

Everything you need to secure your AI calls

The OSS release includes the core AI firewall. No feature flags, no watermarks, no time limits. Apache 2.0 — use it however you want.

13 Entity Types

PII detection & redaction — emails, SSNs, credit cards, phone numbers, names, locations, and IP addresses via Microsoft Presidio.

Secret Detection

6 custom recognizers catch API keys, AWS credentials, GitHub tokens, private keys, and Slack webhooks before they reach any LLM.

Prompt Injection Blocking

5 core attack patterns detected — jailbreaks, instruction overrides, system prompt extraction, DAN, and developer mode exploits.

Image OCR Scanning

Multi-modal DLP scans base64-encoded images for PII hidden in screenshots, documents, and config files.

OpenAI SDK Compatible

Drop-in replacement. Point your existing OpenAI SDK at AISG and every request gets scanned automatically. Zero code changes.

Fail-Closed by Default

If the security layer is unreachable, requests are blocked — never forwarded unscanned. Security over availability.

Architecture

Two containers. One security layer.

┌──────────────┐     ┌───────────────┐     ┌──────────────┐
│  Your App    │────▶│  AISG Proxy   │────▶│  LLM Provider│
│  (OpenAI SDK)│     │  :8000        │     │  (Groq, etc) │
└──────────────┘     └──────┬────────┘     └──────────────┘
                            │ DLP scan
                     ┌──────▼────────┐
                     │  Presidio     │
                     │  :5002        │
                     └───────────────┘

The proxy intercepts every request, scans it through Presidio for PII/secrets/injection, then forwards clean requests to the upstream provider. Fail-closed: if Presidio is unreachable, requests are blocked.

OSS vs Cloud

Start self-hosted. Scale to managed.

The OSS gives you the core security proxy. When you need dashboards, multi-project management, smart routing, or team features — upgrade to Cloud.

FeatureOSSCloud
PII detection & redaction13 entity types28+ entity types
Secret leak prevention6 recognizersExtended (AWS Secret Key, crypto, MAC)
Prompt injection blocking5 core patternsExtended pattern library
Multi-provider routing (BYOK)2 providers8+ providers
DeploymentSelf-hostedManaged cloud
Multi-project management
Project-level DLP & budgets
Dashboards & analytics
Smart cost-optimization
Auto failover chains
SLA & supportCommunity

Ready to deploy?

Clone the repo, add your provider key, and run docker compose up. Your first secured request in under 60 seconds.