Local firewall for AI coding tools — intercept, detect, block.
A free local proxy that sits between your editor and the AI model, catching secrets and sensitive data before they leave your machine.
HTTPS MITM proxy · 571 regex patterns + Char CNN-BiLSTM (v15) · Monitor & Block modes · 100.0/100 evasion resistance · Zero telemetry by default · IOC pull · Lens signal correlation
Found Rampart useful? Star the repo ⭐ and tell a colleague — it helps other devs discover AI security tooling.
Quick Start · Operating Modes · Detection · IDE Integration · Privacy · Releases
We follow GitHub's recommended security practices for open source projects. CodeQL scanning · Secret scanning with push protection · Dependabot alerts & security updates · Protected branches · RFC 9116 security policy · Sigstore keyless signing · Report a vulnerability →
🛡️ Using AegisGate at work? AegisGate Platform is our server-side gateway — 820 detection patterns (303 canonical + 517 detector adapter), MCP/A2A/ACP protection, 30+ compliance frameworks, and cryptographic attestation. For individual developers, Rampart runs locally on your machine. Explore Platform →
🔐 AegisGate MCP — Building MCP servers? AegisGate MCP is a standalone secure MCP server framework with 23 security layers and 132 regex patterns built in. Zero dependencies, Apache 2.0. Explore MCP →
Rampart is a local security tool for developers who use AI coding assistants like GitHub Copilot, Cursor, or local LLMs (Ollama, LM Studio). It sits between your editor and the AI model, scanning everything you send — and everything the AI sends back — for sensitive data and security risks.
Think of it as a firewall for AI coding tools. It catches the moment you're about to send a database password to Copilot, or when the AI generates code that contains an API key, and stops it before it's too late.
- In-transit interception. Unlike Lens (browser-level) or Platform (gateway-level), Rampart operates at the network proxy layer — it sees every request and response.
- 571 regex patterns + ML. Same detection engine as AegisGate Platform (full parity). Regex catches known patterns; Char CNN-BiLSTM (v15) catches adversarial paraphrasing.
- Monitor or Block. Log-only mode for visibility. Block mode for enforcement with configurable thresholds and categories.
- Zero telemetry by default. Air-gap mode when
--platform-urlis not set. No network calls. All detection is local. - IOC pull (optional). Fetch indicators of compromise from Platform's telemetry endpoint with ETag caching. Air-gap compatible — no-op when
--platform-urlis not set. - Lens signal correlation (optional). Receives threat signals from the Lens browser extension via the Lens→Rampart bridge for cross-layer correlation.
- Free. Forever. Apache 2.0, single binary, no external dependencies.
If you use AI chat in a browser (ChatGPT, Claude, etc.): You need Lens — it's a free browser extension that protects you in the browser. Rampart is not for this use case.
If you use AI coding tools (Copilot, Cursor, local LLMs, API calls): You need Rampart. It protects the places Lens can't reach — your IDE, your terminal, your API calls.
| Your setup | What to use |
|---|---|
| ChatGPT or Claude in a browser | Lens (free browser extension) |
| GitHub Copilot in VS Code | Rampart (IDE plugin) |
| Cursor AI editor | Rampart (IDE plugin) |
| Local LLMs (Ollama, LM Studio) | Rampart (local proxy) |
| API calls to OpenAI/Anthropic from your code | Rampart (local proxy) |
| Both browser chat AND coding tools | Lens + Rampart (both are free) |
| Risk | Examples |
|---|---|
| Secrets | API keys (AWS, GitHub, OpenAI, Stripe), database passwords, SSH private keys, JWT tokens, OAuth tokens |
| Personal info (PII) | SSN, email, phone, credit card, passport, bank routing numbers |
| Prompt injection | Adversarial prompts designed to make the AI ignore safety rules, leak system prompts, or execute unauthorized actions |
| Compliance violations | Text that violates HIPAA, GDPR, PCI-DSS, EU AI Act |
| Malicious code (XSS) | Script injection, event handlers, encoded payloads, SVG vectors |
| Response risks | PII leaked in AI responses, hallucinated secrets, injected content in model output |
VS Code / Cursor:
- Open the Extensions panel (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "AegisGate Rampart"
- Click Install, then Reload
- Detection runs automatically as you type — results appear as inline warnings
JetBrains (IntelliJ, PyCharm, WebStorm, etc.):
- Open Settings → Plugins → Marketplace
- Search for "AegisGate Rampart"
- Click Install, then Restart
- Detection results appear in the Problems tool window
Neovim / any LSP editor:
# Download the Rampart LSP binary
curl -L https://github.com/aegisgatesecurity/aegisgate-rampart/releases/latest/download/rampart-lsp-linux-amd64 -o /usr/local/bin/rampart-lsp
chmod +x /usr/local/bin/rampart-lsp
# Add to your LSP config (Neovim example)
# lspconfig.rampart_lsp.setup({})# Build
CGO_ENABLED=0 go build -o bin/rampart ./cmd/rampart
# Monitor mode (default) — log only
./bin/rampart
# Block mode — actively block PII, secrets, XSS
./bin/rampart --block
# Install CA cert (required for HTTPS interception)
./bin/rampart --trust
# Custom port + block mode + rate limiting
./bin/rampart --port 9090 --block --rate-limit=10000docker run -d \
-p 8443:8443 \
-p 9090:9090 \
ghcr.io/aegisgatesecurity/aegisgate-rampart:v0.11.1⚙️ Additional CLI Options
rampart # Monitor mode (default)
rampart --block # Block mode (actively block threats)
rampart --mode=monitor # Explicit monitor mode
rampart --mode=block # Explicit block mode
rampart --port 9090 # Custom port (default: 8080)
rampart --rate-limit 10000 # Rate limit (requests/second)
rampart --trust # Install CA cert into OS trust store
rampart --autostart # Configure auto-start on boot
rampart --no-autostart # Remove auto-start
rampart --status # Show daemon PID, trust, autostart status
rampart --daemon # Daemon mode (tray + notifications)
rampart --platform-url URL # Opt-in Platform telemetry
rampart --platform-api-key KEY # API key for Platform authentication
rampart version # Print version
rampart -v # Verbose outputYour Machine AI APIs
┌─────────────────────────────────────────────────────────────────┐
│ Claude Desktop ─┐ │
│ ChatGPT App ────┤ ┌──────────────────────┐ │
│ VS Code + Ext ──┼────▶│ RAMPART │──────▶ api.openai.com
│ CLI (curl) ─────┤ │ :8080 proxy │──────▶ api.anthropic.com
│ Docker ─────────┘ │ │──────▶ api.deepseek.com
│ │ 571 regex patterns │──────▶ ...24 more
│ │ Char CNN-BiLSTM │
│ │ PII / Secrets / │
│ │ XSS / Compliance │
│ │ │
│ │ ┌── MONITOR ──┐ │
│ │ │ Log + Alert │ │
│ │ └─────────────┘ │
│ │ ┌── BLOCK ────┐ │
│ │ │ 403 + JSON │ │
│ │ └─────────────┘ │
│ └──────────────────────┘
│ │
│ ┌─────▼─────┐
│ │ Audit Log 📄│
│ │ Platform 📡 │ (opt-in)
│ └───────────┘
└─────────────────────────────────────────────────────────────────┘
| Mode | Flag | Behavior | Use Case |
|---|---|---|---|
| Monitor | (default) | Log & alert, allow all traffic | Developer visibility |
| Block | --block |
Log, alert, actively block threats | Security enforcement |
When a request is blocked, Rampart returns a structured JSON response:
{
"direction": "request",
"host": "api.openai.com",
"path": "/v1/chat/completions",
"blocked": true,
"reason": "pii: ssn detected in response",
"severity": "critical",
"message": "Request blocked by AegisGate Rampart",
"results": [
{"category": "pii", "severity": "critical", "rule": "pii_ssn", "text": "123-45-6789"}
]
}⚙️ Block Mode Configuration
{
"mode": "block",
"block": {
"threshold": "high",
"categories": [],
"status_code": 403,
"include_detections": true,
"message": "Request blocked by AegisGate Rampart",
"block_response": "both"
}
}| Field | Default | Description |
|---|---|---|
threshold |
"high" |
Minimum severity to block: "low", "medium", "high", "critical" |
categories |
[] (all) |
Categories to block: "pii", "secrets", "xss", "toxicity", "ml_threat" |
status_code |
403 |
HTTP status code for blocked responses |
include_detections |
true |
Include detection details in block response |
message |
"Request blocked by AegisGate Rampart" |
Custom block message |
block_response |
"both" |
Block direction: "request", "response", or "both" |
| Category | Patterns | Detects |
|---|---|---|
| Secrets | 45 | AWS keys, GitHub tokens, OAuth, JWT, database URLs |
| PII (US Core) | 26 | SSN, email, phone, DOB, name, CPT/HCPCS |
| PII (US Extended) | 13 | Driver license, passport, medical record |
| PII (Financial) | 12 | Credit card (Luhn validated), bank account, SWIFT/BIC |
| PII (International) | 24 | National IDs for 15 countries |
| XSS | 12 | Script injection, event handlers, data URIs |
| Compliance | 35 | GDPR, HIPAA, PCI-DSS, SOX identifiers |
| OT/ICS Protocols | 9 | Modbus, DNP3, OPC-UA |
| ML (Neural) | 1 model | Char CNN-BiLSTM adversarial prompt detection |
| Editor | Plugin | Type | Status |
|---|---|---|---|
| JetBrains (IntelliJ, PyCharm, etc.) | aegisgate-rampart-jetbrains | Native plugin | ✅ v0.4.0 (IDE plugin — Rampart core is v0.9.0) |
| VS Code | aegisgate-rampart-ext | Extension | ✅ v0.4.0 (IDE plugin — Rampart core is v0.9.0) |
| Any editor | LSP server (rampart-lsp) |
Language Server Protocol | ✅ v0.9.0 (Rampart core) |
| Platform | Config Directory | Auto-Start | Notifications | CA Trust | System Tray |
|---|---|---|---|---|---|
| Linux | ~/.config/aegisgate-rampart/ |
systemd | notify-send | update-ca-certificates | fyne/systray (CGO) |
| macOS | ~/Library/Application Support/aegisgate-rampart/ |
launchd | osascript | security add-trusted-cert | fyne/systray (CGO) |
| Windows | %AppData%\AegisGate Rampart\ |
Registry Run key | beeep (Win32 toast) | certutil -addstore | fyne/systray |
Build requirements: Linux and Windows build with CGO_ENABLED=0. macOS requires CGO_ENABLED=1 (systray uses Objective-C).
IDE extensions call these endpoints — no ML model bundled in extensions:
| Method | Path | Purpose |
|---|---|---|
POST |
/detect |
Scan text: {"text": "..."} → detection results |
GET |
/stats |
Proxy statistics: requests, detections, blocked, mode |
curl -s -X POST http://localhost:8080/detect \
-H "Content-Type: application/json" \
-d '{"text": "My SSN is 123-45-6789"}'
# HTTP 200 — detection results, traffic still flows
{"total_detections": 3, "blocked": false, "results": [...]}curl -s -X POST http://localhost:8080/detect \
-H "Content-Type: application/json" \
-d '{"text": "My SSN is 123-45-6789"}'
# HTTP 403 — request blocked
{"blocked": true, "reason": "pii: ssn detected in response",
"severity": "critical", "results": [...]}Rampart enforces the same 12 privacy rules as Lens and Platform:
- No prompt text stored or sent
- No URLs logged
- No page content stored
- No PII stored
- No credentials stored
- No fingerprinting
- No cross-site tracking
- No provider metadata collected
- No keystroke logging
- No mouse tracking
- No session IDs stored
- No IP addresses logged
Air-gap mode: When --platform-url is not set, Rampart makes zero network calls. All detection is local. When set, Rampart can optionally pull IOCs from Platform and receive Lens signal correlations — both are outbound, opt-in, and config-driven.
🔐 Enhanced Privacy Features (v0.5.1+)
Audit Log Encryption:
- Encrypt audit logs at rest with ChaCha20-Poly1305 authenticated encryption
- Key derived from passphrase via PBKDF2-SHA256 (100K iterations)
- Key is NEVER stored - decryption requires original passphrase
- Protects against disk theft and forensic analysis
# Generate secure passphrase
rampart generate-passphrase
# Enable encrypted audit logging
rampart --audit-key-passphrase="your-passphrase"
# Decrypt logs later
rampart decrypt-audit --audit-key-passphrase="your-passphrase" audit.log.enc output.logAnonymized Metrics:
- Opt-in only - disabled by default
- Domain hashed with SHA-256 → 16 hex chars (cannot reverse)
- Timestamps rounded to hour (cannot correlate events)
- Only false positives sent (user-confirmed)
- No identifiers, no content, no PII
# Enable privacy-preserving telemetry
rampart --anonymized-metricsSee PRIVACY.md for complete privacy documentation.
| Product | Surface | Approach | Detection | Block Mode |
|---|---|---|---|---|
| Lens | Browser | DOM blocking (before send) | 155 regex + JS ML | ✅ Block in browser |
| Rampart | Desktop, CLI, IDE | HTTPS proxy (in transit) | 571 regex + Go ML | ✅ Block at proxy |
| Platform | Server | API gateway | 256 regex + Go ML | ✅ Block at gateway |
Lens blocks before send. Rampart blocks in transit. Platform blocks at the gateway. Together = full-spectrum coverage.
📦 What's New in v0.9.0
- 📡 IOC Pull — Fetch indicators of compromise from Platform's telemetry endpoint (
GET /api/v1/iocs/latest) with ETag caching. Pulled IOCs merge into Rampart's local IOC store for real-time blocking decisions. Air-gap compatible — no-op when--platform-urlis not set. - 🔗 Lens Signal Correlation — Receives threat signals from the Lens browser extension via the Lens→Rampart bridge. Signals are correlated with Rampart's local detection context for enhanced threat scoring.
- 38 new tests (20 IOC pull + 18 Lens correlation). All existing packages continue to pass.
📦 What's New in v0.8.0
- 🧠 Detection Parity with Platform — v15 ONNX model, full text normalization (NormalizeAllVariants in production), threshold fix (0.7→0.5), config-sourced detector init. Evasion resistance: 100.0/100 (4,050 adversarial tests, up from 12.8/100).
- 🔒 26 Synced Regex Patterns — 11 secret patterns (Slack, Azure, Cloudflare, Docker, GCP, Kubernetes, etc.) + 13 compliance patterns (SSTI, eval/atob, model theft, data exfil, safety bypass). Pattern count: 297→571.
- 🐳 CGO Docker Build — Dockerfile rewritten for CGO + ONNX Runtime v1.29.0. ML model shipped in container. Debian bookworm-slim base (glibc for onnxruntime).
- 🧪 Conformance Infrastructure — Normalization conformance test suite + adversarial evasion suite (4,050 tests) tracked in CI.
- 🧪 Test coverage — 95 test files, 29 packages, 1,412 test functions, 81.3% filtered coverage, all passing with
-race.
📦 What's New in v0.7.1
- 🔒 23 New SOC Detection Patterns — SWIFT/BIC banking codes (3 patterns), CPT/HCPCS medical billing codes (11 patterns), and OT/ICS protocol patterns (9 patterns: Modbus, DNP3, OPC-UA). Parity with Platform v4.1.0 and Lens v0.3.1.
- 🔧 Go 1.26.6 — Runtime bump from Go 1.25.0, fixes 5 stdlib vulnerabilities.
- 🧪 Test coverage — 95 test files, 29 packages, all passing with
-race.
📦 What's New in v0.6.0
- 🛡️ Block Mode — Actively block threats at the proxy level. Returns HTTP 403 with structured JSON response. Configurable threshold, categories, and block direction (request, response, or both).
- 🧠 ML Adversarial Detection — Char CNN-BiLSTM with Attention model detects adversarial prompt injections (instruction override, roleplay injection, obfuscated commands) in real time.
- 🔐 Encrypted Audit Logs — ChaCha20-Poly1305 authenticated encryption with PBKDF2-SHA256 key derivation. Key is never stored — decryption requires original passphrase.
- 📊 Anonymized Metrics — Opt-in privacy-preserving telemetry. Domain hashed with SHA-256, timestamps rounded to hour, only false positives reported.
- 🔔 Webhook Notifications — Configurable webhook integration for detection alerts. Custom headers, multiple endpoints.
- 📦 Enterprise Features — Config hash verification, cosign signing support, self-hosted LLM configuration, batch scanning.
- ✅ 81.3% test coverage (95 test files, 29 packages, 7 k6 load tests, 0.0000% crash rate at 2,000+ concurrent users).
| Metric | Value |
|---|---|
| Test files | 95 |
| Packages tested | 29 |
| Filtered coverage | 81.3% |
| Load test scenarios | 7 (k6) |
| Crash rate | 0.0000% |
| Peak concurrent users | 2,000+ |
🧪 Load Testing Details
v0.6.0 Results: 235 RPS throughput, p95=201ms latency, 0.0000% crash rate across 7 test scenarios.
cd tests/load/k6
# Run individual tests
k6 run stress-test.js # Baseline (100 VUs)
k6 run break-test.js # Find ceiling (1,000 VUs)
k6 run crush-test.js # Survival test (2,000 VUs)
k6 run malformed-input-test.js # Adversarial input
k6 run connection-flood-test.js # Connection storms
k6 run endurance-test.js # 5-min sustained load
k6 run rate-limit-test.js # Rate limiter verification
# Run all tests
./run-all.sh| Test | Peak VUs | Requests | Crash Rate | Key Result |
|---|---|---|---|---|
| Stress | 100 | 21K | 0% | p95=210ms |
| Break | 1,000 | 56K | 0% | Survived 1K VUs |
| Crush | 2,000 | 465K | 0% | Survived 2K VUs |
| Malformed | 500 | 25K | 0% | No crash on garbage |
| Connection Flood | 500 | 506K | 0% | Connection storms OK |
| Endurance | 70 | 91K | 0% | 5-min stable |
| Rate Limit | 100 | 27K | 0% | 429s enforced |
Covers all 10 AI providers:
| Provider | API Endpoints | Web Endpoints |
|---|---|---|
| OpenAI/ChatGPT | api.openai.com | chat.openai.com, chatgpt.com |
| Anthropic/Claude | api.anthropic.com | claude.ai |
| Gemini | generativelanguage.googleapis.com | gemini.google.com |
| Copilot | api.copilot.microsoft.com | copilot.microsoft.com |
| Perplexity | api.perplexity.ai | perplexity.ai |
| Grok | api.x.ai | grok.com |
| Mistral | api.mistral.ai, codestral.mistral.ai | chat.mistral.ai |
| DeepSeek | api.deepseek.com | chat.deepseek.com |
| Duck.ai | api.duck.ai | duck.ai |
| Meta AI | — | meta.ai |
# Build
CGO_ENABLED=0 go build -o bin/rampart ./cmd/rampart/
# Run all tests with race detector
go test ./... -race -count=1
# Run block mode tests
go test ./pkg/proxy/ -race -run "TestBlock|TestShouldBlock|TestMITMBlock" -v
# Run platform forwarder tests
go test ./internal/platformforward/ -race -v
# Lint
golangci-lint run ./...🏗️ Project Structure
aegisgate-rampart/
├── cmd/
│ ├── rampart/ # CLI entry point + daemon lifecycle
│ └── rampart-lsp/ # LSP server for any-editor coverage
├── pkg/
│ ├── config/ # Configuration (block mode, 27 endpoints, 12 privacy rules)
│ ├── detector/ # Detection engine wiring
│ ├── proxy/ # HTTPS MITM proxy + /detect + /stats + block mode
│ └── telemetry/ # Platform telemetry (no-op when air-gap)
├── internal/
│ ├── autostart/ # Auto-start (systemd, launchd, Registry)
│ ├── auditlog/ # Audit logging (metadata only, encrypted at rest)
│ ├── catrust/ # CA trust setup (Linux, macOS, Windows)
│ ├── certificate/ # ECDSA P-256 CA generation
│ ├── certinit/ # First-run certificate setup
│ ├── detectors/ # 571 regex patterns (from Platform v5.2.0)
│ ├── enterprise/ # Enterprise features (config hash, verify, gate)
│ ├── iocpull/ # IOC pull client (Platform telemetry, optional)
│ ├── lenscorrelation/ # Lens signal correlation receiver
│ ├── logging/ # Minimal stderr shim
│ ├── lsp/ # Language Server Protocol server
│ ├── ml/ # Char CNN-BiLSTM (ONNX + heuristic fallback)
│ ├── notify/ # Desktop notifications (3 platforms)
│ ├── platform/ # Platform-aware paths (ConfigDir, DataDir, CacheDir)
│ ├── platformforward/ # Platform telemetry forwarding (opt-in)
│ ├── response/ # PII scanner, secret detector, guard
│ ├── scanner/ # Batch scanning
│ ├── securemem/ # Secure memory handling
│ ├── tray/ # System tray (fyne.io/systray)
│ ├── updater/ # Self-update mechanism
│ ├── verify/ # Cosign verification
│ └── webhook/ # Webhook notification manager
├── tests/load/k6/ # k6 load testing suite (7 scenarios)
├── configs/default.json # Default configuration
├── Dockerfile # Multi-stage scratch container
└── .github/workflows/ # CI/CD workflows
| Metric | Result |
|---|---|
| Attack catch rate | 248/248 (100%) |
| Benign pass rate | 240/240 (100%) |
| False positive rate | 0.0% |
| Errors | 0 |
| Metric | Result |
|---|---|
| Attack catch rate | 100% |
| Benign false positive rate | 0.5% (10/2,000) |
| SXC negative FP rate | 3.8% |
| Latency | ~6.5 min (3,157 prompts, 10 concurrent) |
- 469 regex patterns (468 unique) — full parity with Platform scanner
- Char CNN-BiLSTM ML model (v15) for adversarial paraphrasing detection
- Evasion-resistant normalization: 13-17 variants per input (l33t, ROT13, homoglyph, keyboard walk, space-removal, camelCase)
- Post-match FP filters: 6 pattern-specific benign content filters
- ML gatekeeper: Suppresses regex FPs when ML model scores content as clearly benign
- Short-text FP mitigation: Suppresses ML-driven blocks on short text (< 180 chars) when no regex pattern meets block threshold
Apache-2.0. See LICENSE for the full text.
The trained ML model weights are licensed under the Apache License 2.0, same as the source code.
See CONTRIBUTING.md.
AegisGate's core technologies are patent pending with the USPTO (Provisional App. Nos. 64/153,573–64/153,577, filed September 12, 2026; 64/174,824, filed October 12, 2026; and 64/180,722, filed October 20, 2026; and 64/184,057, filed October 26, 2026). Source code is © 2025-2026 AegisGate Security, LLC. Licensed under Apache 2.0. Trained ML model weights are licensed under the Apache License 2.0.
🌐 AegisGate Security · 💬 Discord · ✉️ [email protected] · 𝕏 @aegisgate · 📱 Telegram · 🐘 @[email protected]
Made with 🖤 by AegisGate Security developers to secure the AI attack surface.