Lesson 5 of 6·10 min read

Enterprise Security Architecture

Individual protective measures aren't enough — enterprise AI security requires a comprehensive architecture covering every aspect from API gateway to incident response.

API Gateway Security

The AI API Gateway as Security Layer

Every LLM request passes through the API gateway — the ideal point for centralized security controls:

  • Authentication: API keys, OAuth 2.0, JWT tokens — every request identified
  • Authorization: Role-based access to models and features (admin, developer, user)
  • Request validation: Schema validation, input sanitization, size limits
  • Traffic management: Load balancing, circuit breaking, retry logic

Gateway Architecture

Client → API Gateway → Auth Service
                     → Rate Limiter
                     → Input Validator
                     → Prompt Injection Detector
                     → LLM Router → Model A / Model B
                     → Output Validator
                     → PII Filter → Client

Rate Limiting & Abuse Prevention

Multi-Level Rate Limiting

LevelLimitPurpose
Per API key100 requests/minProtection against single compromised key
Per user50 requests/minFair usage per user
Per IP200 requests/minDDoS protection
Per model1,000 requests/minProtect model capacity
Token budget100K tokens/hourCost control

Anomaly Detection

  • Burst detection: Sudden spike in requests from one user
  • Pattern detection: Repetitive requests (model extraction attempt)
  • Cost anomalies: Unusually high token consumption
  • Geographic anomalies: Login from Germany, API calls from Nigeria

DLP Integration

Data Loss Prevention for AI

Traditional DLP systems (Symantec, Microsoft Purview, Zscaler) need to be extended with AI-specific rules:

  • Prompt monitoring: DLP scans prompts for sensitive data before they reach the model
  • Response monitoring: DLP scans responses for data leaks
  • RAG monitoring: DLP monitors which documents are loaded into context
  • Shadow AI detection: Detect unauthorized AI tool usage (ChatGPT via personal accounts)

SIEM Integration

Security Information and Event Management

Integrate AI events into your existing SIEM (Splunk, Sentinel, Elastic):

Events to log:

  • Prompt injection attempts (blocked and passed through)
  • PII detections in input and output
  • Rate limit violations
  • Authentication failures
  • Unusual model responses (toxicity, jailbreak indicators)
  • Token consumption per user, team, and department

Correlation rules:

  • 5+ prompt injection attempts from one user → alert + account lock
  • PII in output + unusual download activity → data breach alert
  • Rate limit + geographic anomaly → compromised account alert

Incident Response for AI

AI-Specific Incident Response Plan

Severity 1 — Data Breach:

  1. Take model offline immediately
  2. Identify affected sessions
  3. Assess extent of data exposure
  4. Check GDPR notification obligation (72-hour deadline)
  5. Forensic analysis of prompt logs

Severity 2 — Jailbreak/Prompt Injection:

  1. Document attack pattern
  2. Update input filters
  3. Harden system prompt
  4. Notify affected users (if data was exposed)
  5. Post-mortem and lessons learned

Severity 3 — Hallucination with Business Impact:

  1. Identify and correct false information
  2. Inform affected users/customers
  3. Tighten guardrails for affected area
  4. Update RAG knowledge base

Enterprise reality: AI security is not a project but a continuous process. Build a dedicated AI security team — or extend your existing security team with AI expertise.