Enterprise AI Security & Governance
How to deploy LLM systems in regulated enterprises — governance frameworks, compliance controls, data protection, and risk management.
The Enterprise AI Risk Landscape
Enterprise LLM deployments face risks that don't exist in traditional software:
| Risk Category | Examples | Impact |
|---|---|---|
| Data Leakage | PII in training data, prompts sent to third-party APIs | Regulatory fines, reputation |
| Prompt Injection | Adversarial inputs bypassing controls | Unauthorized actions, data breach |
| Hallucination | Confident but wrong outputs in regulated contexts | Legal liability, compliance violations |
| Shadow AI | Employees using unauthorized AI tools | Data exposure, compliance gaps |
| Model Supply Chain | Compromised models, poisoned weights | System compromise |
| Bias & Fairness | Discriminatory outputs in hiring, lending, etc. | Legal action, reputation |
| Vendor Lock-in | Dependence on single model provider | Business continuity risk |
Architecture Diagram
┌──────────────────────────────────────────────────────┐
│ AI Governance Board │
│ ┌────────────┐ ┌────────────┐ ┌────────────────┐ │
│ │ Legal & │ │ InfoSec │ │ Business │ │
│ │ Compliance │ │ Team │ │ Stakeholders │ │
│ └─────┬──────┘ └─────┬──────┘ └────────┬───────┘ │
│ └────────────────┴──────────────────┘ │
└───────────────────────┬──────────────────────────────┘
│
┌─────────┴─────────┐
│ AI Policy Layer │
├───────────────────┤
│ • Approved models │
│ • Data handling │
│ • Use case tiers │
│ • Audit schedule │
└─────────┬─────────┘
│
┌───────────────┼───────────────┐
│ │ │
┌─────▼─────┐ ┌──────▼─────┐ ┌─────▼──────┐
│ Tier 1 │ │ Tier 2 │ │ Tier 3 │
│ Low Risk │ │ Medium │ │ High Risk │
├───────────┤ ├────────────┤ ├────────────┤
│ Internal │ │ Customer- │ │ Regulated │
│ tools, │ │ facing, │ │ decisions, │
│ summaries │ │ content │ │ financial │
│ │ │ generation │ │ medical │
└───────────┘ └────────────┘ └────────────┘
Use Case Risk Tiers
Tier 1 — Low Risk (Self-Service)
Teams can deploy without governance board approval:
- Internal documentation search
- Code completion tools
- Meeting summarization
- Developer productivity tools
Requirements: Standard data classification, approved model list, basic logging.
Tier 2 — Medium Risk (Review Required)
Requires architecture review and approval:
- Customer-facing chatbots
- Content generation (marketing, support)
- Data analysis and reporting
- Recommendation systems
Requirements: Red team testing, output monitoring, human review sampling, incident response plan.
Tier 3 — High Risk (Board Approval)
Full governance review, ongoing monitoring:
- Financial advice or decisions
- Medical or health guidance
- Hiring and HR decisions
- Legal document generation
- Autonomous agent actions
Requirements: Bias testing, fairness audits, explainability requirements, regulatory filing, continuous evaluation, human-in-the-loop for critical decisions.
Data Protection Controls
PII Handling
from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine
analyzer = AnalyzerEngine()
anonymizer = AnonymizerEngine()
def sanitize_for_llm(text: str) -> tuple[str, dict]:
"""Remove PII before sending to external LLM."""
# Detect PII entities
results = analyzer.analyze(
text=text,
entities=["PERSON", "EMAIL_ADDRESS", "PHONE_NUMBER",
"CREDIT_CARD", "US_SSN", "IBAN_CODE"],
language="en"
)
# Replace with placeholders
sanitized = anonymizer.anonymize(text=text, analyzer_results=results)
return sanitized.text, {
"entities_found": len(results),
"entity_types": [r.entity_type for r in results]
}
def process_with_llm(user_input: str) -> str:
"""Full pipeline with PII protection."""
sanitized_input, pii_report = sanitize_for_llm(user_input)
# Log PII detection (not the PII itself)
log_security_event("pii_detected", pii_report)
# Only sanitized text goes to LLM
response = call_llm(sanitized_input)
return response
Data Classification Enforcement
| Classification | Can Send to External LLM? | Requirements |
|---|---|---|
| Public | Yes | Standard logging |
| Internal | Yes, with sanitization | PII removal, audit log |
| Confidential | Self-hosted models only | Encryption, access control |
| Restricted | No LLM processing | Manual review only |
Compliance Mapping
| Regulation | AI-Specific Requirements | Controls |
|---|---|---|
| GDPR | Right to explanation, data minimization, consent | PII sanitization, opt-out, audit logs |
| SOC 2 | Access control, monitoring, incident response | RBAC, tracing, alerting |
| HIPAA | PHI protection, BAA with vendors | Self-hosted models, encryption |
| EU AI Act | Risk classification, transparency, human oversight | Tier system, explainability, HITL |
| ISO 27001 | Information security management | Full governance framework |
Audit & Monitoring
What to Log
Every LLM interaction in Tier 2 and Tier 3 must log:
audit_record = {
"timestamp": "2026-03-15T10:30:00Z",
"user_id": "hashed_user_id",
"use_case": "customer_support_bot",
"risk_tier": 2,
"model": "gpt-4",
"model_version": "2026-01-25",
"prompt_template_version": "v2.3",
"input_sanitized": True,
"pii_detected": False,
"output_guardrails_passed": True,
"response_time_ms": 1200,
"tokens_used": 850,
"cost_usd": 0.034,
"human_review_required": False,
"quality_score": 0.87,
}
Automated Compliance Checks
Run weekly automated audits:
- PII leak detection in stored traces
- Model version inventory (no unapproved models)
- Access control review (who can deploy agents?)
- Cost anomaly detection
- Quality score trend analysis
- Shadow AI detection (unauthorized API calls)
Implementation Roadmap
Phase 1: Foundation (Month 1-2)
- Establish AI governance board with cross-functional representation
- Define use case risk tiers and approval workflows
- Create approved model and vendor list
- Implement PII sanitization pipeline
Phase 2: Controls (Month 2-3)
- Deploy centralized audit logging for all LLM interactions
- Implement output guardrails (Guardrails AI or Lakera)
- Set up access control and RBAC for AI systems
- Create incident response playbook for AI-specific incidents
Phase 3: Monitoring (Month 3-4)
- Deploy LLM observability stack (Langfuse + dashboards)
- Implement automated compliance checks
- Set up quality evaluation pipelines
- Create executive reporting dashboard
Phase 4: Maturity (Ongoing)
- Regular red team exercises for prompt injection
- Bias and fairness audits for Tier 3 applications
- Vendor risk assessments for model providers
- Employee AI literacy training program
LLM Governance Framework Essentials
Beyond technical security controls, enterprise LLM governance requires organizational policies and accountability:
Model Lifecycle Governance
| Stage | Governance Activity | Responsible |
|---|---|---|
| Selection | Evaluate models against approved list, benchmark performance, assess vendor risk | AI Governance Board |
| Integration | Architecture review, security assessment, data flow mapping | InfoSec + Engineering |
| Deployment | Risk tier approval, guardrail configuration, monitoring setup | AI Governance Board + SRE |
| Operation | Continuous evaluation, cost monitoring, quality tracking | Platform Team |
| Retirement | Deprecation plan, data retention review, replacement validation | AI Governance Board |
Policy Templates
Essential governance policies every enterprise should define:
- Acceptable Use Policy — Which use cases and data types are approved for LLM processing
- Model Procurement Policy — Approved vendors, evaluation criteria, contract requirements
- Data Handling Policy — Classification rules for LLM inputs, PII handling, data residency
- Incident Response Policy — AI-specific incident classification, escalation, and remediation
- Quality Assurance Policy — Evaluation frequency, accuracy thresholds, human review requirements
Recommended Tools
| Category | Tool | Purpose |
|---|---|---|
| Guardrails | SlashLLM → | Enterprise LLM gateway with policy enforcement |
| Security | Lakera Guard → | Prompt injection detection and content filtering |
| Security | LLM Security Tools → | Security tooling for LLM pipelines |
| Observability | Langfuse → | Audit logging and compliance tracing |
| Comparison | Lakera vs Guardrails AI → | Security tool comparison for enterprise selection |
| Comparison | SlashLLM vs Lakera Guard → | Gateway security comparison |