Why MCP Matters For AI Security
How Model Context Protocol changes enterprise AI integration and how to secure MCP in production.
SafeLLM is the only security plugin built for Apache APISIX.
No proxy rewrites. No cloud calls. No GPU. Just plug it in.
The problem
These aren't hypotheticals. They're happening right now to companies running unprotected LLM endpoints.
LLMs hallucinate and regurgitate training data. Without output scanning (DLP), PII leaks directly to end users.
Regulators require proof of AI governance. No logs, no PII controls, no audit trail = non-compliant.
Attackers use obfuscation to bypass filters. SafeLLM normalizes text (NFKC, skeleton matching, leetspeak reversal) before matching.
Output Guard (DLP)
Your LLM can leak PII, credentials, and training data in its responses. DLP scans every output before it reaches the user.
Full response buffered and scanned. PII detected? Response blocked entirely. Maximum security for regulated industries.
PII replaced with [REDACTED:TYPE] placeholders. Response still useful, but PII never reaches the user.
Response streams to user instantly. Background scan logs any PII detection. Zero latency impact. Perfect for pilot phase.
Token-by-token scanning with sliding window. Redacts PII mid-stream without breaking SSE. No partial leaks.
Compliance & Monitoring
Regulators don't care about your architecture diagram. They want logs, evidence, and controls. SafeLLM provides all three.
blocked_totalscan_durationcache_hitsdlp_pii_detected
Visual rule management, attack simulation, blocked request inspection, and audit log export.

Pre-built dashboards for threat analytics. Audit logs to Loki/S3 for long-term compliance archiving.

How It Works
Waterfall design: the first layer to detect a threat short-circuits. No wasted compute.
SHA-256 hash checks Redis. Cache hit = instant cached verdict. Cuts repeat-call costs to near zero.
FlashText O(1) matching with NFKC normalization, skeleton matching, and leetspeak decoding. Catches ~38% of attacks before AI is touched.
Regex: email, cards, SSN, IBAN, PESEL, crypto wallets. Enterprise: GLiNER AI with 25+ entity types and custom patterns.
ONNX neural network: safe / jailbreak / indirect_injection. 1,200+ RPS sustained on standard CPU.
What's different
There's no other APISIX AI security plugin. But even beyond that:
The only security solution designed for APISIX. Lua serverless-pre-function reads the body and POSTs it to SafeLLM. No proxy rewrites, no sidecar mesh. Install, configure, done.
Zero external network calls. All models (ONNX, GLiNER, regex) run locally. Your prompts and responses never leave your infrastructure. Literally works on air-gapped networks.
Professional Indemnity + Cyber Liability up to €1M. Every customer gets 2–8 hour onboarding. We help write your custom regex. No ticket queues, no chatbots.
Cache, keyword guard, regex PII, shadow mode, DLP audit, Prometheus — all Apache-2.0. Enterprise adds AI models, streaming DLP, dashboard, and SLA.
Defense-in-Depth
Dangerous requests are stopped at the cheapest layer possible. Safe requests pass through all layers with minimal overhead.
Redis SHA-256 cache with NFKC normalization (prevents homograph bypass). Cache hit = instant verdict. Standalone (OSS) or Sentinel HA (Enterprise).
FlashText O(1) + skeleton matching + NFKC + leetspeak reversal. Catches obfuscated attacks like j@1lbr3@k and i.g.n.o.r.e. ~38% recall in <0.01ms.
Input scanning. Regex: email, cards, SSN, IBAN, PESEL, crypto (1–2ms). Enterprise GLiNER: 25+ types including Polish PESEL/NIP/REGON (20–25ms). Custom patterns supported.
ONNX model: safe / jailbreak / indirect_injection. Semantic analysis catches what keywords can't. 1,200 RPS on CPU, P95: 13.5ms. Enterprise only.
Scans LLM responses for leaked PII, credentials, and secrets. Three modes: block, anonymize ([REDACTED:IBAN]), or audit (log-only). Streaming DLP in beta.
Day-0 safe deployment: all layers log what they would block but allow traffic through. Tune thresholds on production data before going live. Then flip one env var.
Trust & Compliance
SafeLLM never sees your data. No DPA required — because we're not a data processor.
SafeLLM is on-premise/VPC software. We are not a data processor under GDPR. No DPA required — zero data is transmitted to our systems. Ever.
No call-home. No usage analytics. No prompt fragments sent anywhere. SafeLLM has no telemetry mechanisms. Verifiable in source code.
You own 100% of your logs, encryption keys, and security policies. SafeLLM provides the tools — your data never leaves your infrastructure.
On-premise architecture = GDPR compliance by design. No cross-border transfers. No sub-processors. EU AI Act transparency requirements covered.
Ready-made compliance assessment for CISOs and DPOs: data flow, encryption, access control, audit trails.
Lloyd's of London coverage. EU-registered company. We put our money where our architecture is.
Pricing
The OSS core covers most use cases. Enterprise adds AI precision, streaming DLP, and compliance tooling.
| Capability | OSS | Enterprise |
|---|---|---|
| Smart Cache (Redis) | ||
| Keyword Guard + Skeleton Matching | ||
| PII Shield (Regex) | ||
| PII Shield (GLiNER AI, 25+ types) | ||
| Neural Guard (ONNX) | ||
| DLP Audit Mode | ||
| DLP Block / Redact / Streaming | ||
| MCP Server (stdio tools) | ||
| Shadow Mode | ||
| Prometheus Metrics | ||
| Redis Sentinel HA | ||
| Security Dashboard | ||
| Audit Logs (Loki/S3) | ||
| Support | Community | SLA + Onboarding |
Technical answers based on our actual documentation
SafeLLM uses APISIX's serverless-pre-function plugin with Lua. The script reads the full request body from Nginx memory and POSTs it to SafeLLM's /auth endpoint. If the sidecar returns 200 — APISIX proxies to upstream. If 403 — APISIX blocks. No Base64 encoding, no header size limits. We can't use forward-auth because it only forwards headers, not body. The Lua integration is pre-configured in config/apisix.yaml.
Configurable via FAIL_OPEN. If true: all traffic passes through (graceful degradation). If false: all traffic blocked (fail-closed). The cache layer has a built-in circuit breaker — if Redis connection fails, it opens the circuit and bypasses cache without crashing the pipeline. Recovery is automatic when Redis comes back.
Three modes: Block (Enterprise) buffers the full response, scans, then delivers — increases TTFT but maximum security. Audit (OSS) streams to user instantly while scanning a copy in the background — zero latency impact. Streaming DLP (Enterprise beta) uses a sliding window to scan tokens as they stream via SSE and can redact PII mid-flight. Memory is capped by DLP_MAX_OUTPUT_LENGTH (default 500K chars).
Yes. The regex engine includes aggressive patterns for obfuscation detection — credit cards with spaces between digits (4 5 3 2 0 1 5 1...), SSNs with unusual separators. Credit card matches are validated with Luhn checksum and SSNs with SSA area/group/serial rules to minimize false positives. For IBAN, we restrict to 68 known country code prefixes. Enterprise adds GLiNER AI for context-aware detection (25+ entity types).
Prometheus metrics (/metrics): blocked requests by layer, scan latency histograms, cache hit rates, DLP detections. Enterprise adds tamper-resistant audit logs sent asynchronously via Redis queue to Loki/S3. Logs contain request ID, SHA256 prompt hash, verdict, layer, reason, and latency — but never the raw prompt (privacy by design). This covers EU AI Act documentation requirements, GDPR data minimization evidence, and SOC2 audit trails.
No GPU required. All ONNX models are optimized for CPU inference: L2 Neural Guard runs at 1,200+ RPS with P95 of 13.5ms on a standard AMD Ryzen 5 PRO. Models are shared via Copy-on-Write between workers (4 workers use ~500MB total). Enterprise optionally supports GPU for guard-class models (Llama, Gemma, Qwen) when you need maximum accuracy.
Set SHADOW_MODE=true (the default). Every layer runs its full detection pipeline but instead of returning 403, it logs the would-be block and returns 200. You deploy to production, observe what gets flagged via Prometheus/logs, tune thresholds and keyword lists, then set SHADOW_MODE=false when confident. One env var change to go from observe to enforce.
Yes. Set CUSTOM_FAST_PII_PATTERNS as a JSON dict: {"ACME_ID": "ACME-[0-9]{4}", "PROJ_CODE": "PRJ-[A-Z]{3}"}. Safety limits: max 50 patterns, max 256 chars per pattern, and patterns are skipped for texts longer than 20K chars (configurable) to prevent ReDoS. Enterprise adds GLiNER-based custom entity training for context-aware detection.
No. SafeLLM has zero telemetry mechanisms. No call-home, no usage analytics, no prompt fragments or statistics are ever sent to us or any third party. There is no outbound network connection to SafeLLM systems — the software runs entirely within your infrastructure. This is verifiable in the source code (OSS core is Apache 2.0). This zero-knowledge architecture is specifically designed for banking, government, and defense environments where any data exfiltration risk is unacceptable.
No. A DPA is not required because SafeLLM is not a data processor under GDPR. We deliver on-premise/VPC software — we never receive, store, process, or have access to your data. Your prompts, responses, logs, and encryption keys stay 100% within your infrastructure. When your legal team asks (and they will): "DPA is not applicable because SafeLLM is licensed software deployed on-premise. We are not a data processor — zero data is transmitted to our systems. Ever." This also means no sub-processor chain, no cross-border transfers, and no vendor audit obligations related to SafeLLM.
Deep dives on AI security, deployment patterns, and compliance.
How Model Context Protocol changes enterprise AI integration and how to secure MCP in production.
A pragmatic analysis of APISIX for LLM traffic, with the SafeLLM integration perspective.
A practical, end-to-end guide to launching and validating an APISIX + SafeLLM reference stack.
When your DLP flags an anomaly on a Tuesday afternoon, the clock starts. Here is exactly what to do in the first 72 hours — and what you need to have in place before it happens.
Start with OSS. Upgrade when you need AI precision, streaming DLP, or compliance tooling. EU-based · Insured (€1M Professional Indemnity + Cyber Liability) · We actually pick up the phone