AI Platform Security Overview
Building AI is straightforward. Securing it is not. The HDI Seguros AI platform handles confidential policy documents, claim records, financial data, and actuarial models β all of which are targets for a distinct set of attacks that do not exist in conventional software systems.
This section covers six threat categories and the controls implemented against each.
Threat Landscapeβ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β THREAT 1 β HALLUCINATION β
β Model invents facts: wrong franchise amounts, non-existent clauses β
β β Retrieval gate Β· System prompts Β· Citation check Β· LLM-as-judge β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β THREAT 2 β BIAS β
β Model treats people differently based on name, age, origin β
β β Counterfactual CI gate Β· Neutrality score Β· ACPR audit report β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β THREAT 3 β PROMPT INJECTION β
β Attacker overrides system prompt or hides instructions in documents β
β β PromptGuard sidecar Β· Regex hook Β· RAG chunk scan Β· Canary token β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β THREAT 4 β DATA POISONING β
β Corrupted documents enter Qdrant; wrong answers look correct β
β β Provenance Β· Collection ACL Β· Consistency check Β· Integrity scan β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β THREAT 5 β MODEL INVERSION / EXTRACTION β
β Systematic querying reconstructs the full knowledge base β
β β Enumeration detection Β· Response abstraction Β· LUKS encryption β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β THREAT 6 β MEMBERSHIP INFERENCE β
β Single-query probing confirms whether a specific record is indexed β
β β Identifier stripping Β· Neutral error message Β· GDPR Art. 15 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The Six Controls Pagesβ
| Page | Threat | Primary risk |
|---|---|---|
| Hallucination Controls | Model accuracy | Wrong claim amounts, invented policy clauses |
| Bias Detection | Fairness + legal | Differential treatment by name/age/origin β EU AI Act Art. 9 |
| Prompt Injection | Active attack | System prompt override, document-embedded instructions |
| Data Poisoning | Knowledge base integrity | Corrupt Qdrant documents that fool all quality metrics |
| Model Inversion | Data extraction | Systematic enumeration of entire policy knowledge base |
| Membership Inference | Record existence probing | Confirming whether a specific claim/policy/person is indexed |
Risk by Departmentβ
How each threat maps to department criticality:
| Department | Hallucination | Bias | Prompt Injection | Data Poisoning | Extraction | Membership Inference |
|---|---|---|---|---|---|---|
| Sinistres | CRITICAL | CRITICAL | CRITICAL | CRITICAL | HIGH | CRITICAL |
| Finance | CRITICAL | CRITICAL | HIGH | CRITICAL | HIGH | HIGH |
| Juridique | CRITICAL | CRITICAL | HIGH | CRITICAL | HIGH | HIGH |
| Souscription | HIGH | HIGH | HIGH | HIGH | HIGH | HIGH |
| Actuariat | HIGH | HIGH | MEDIUM | HIGH | MEDIUM | MEDIUM |
| RΓ©assurance | HIGH | HIGH | MEDIUM | HIGH | MEDIUM | MEDIUM |
| Audit | HIGH | HIGH | MEDIUM | HIGH | LOW | MEDIUM |
| Commercial | MEDIUM | MEDIUM | MEDIUM | MEDIUM | LOW | LOW |
| IT | LOW | LOW | MEDIUM | LOW | LOW | LOW |
| RH | LOW | LOW | MEDIUM | LOW | LOW | LOW |
Controls Across the Request Lifecycleβ
Every user request passes through a layered set of controls. Each layer operates independently β a failure in one does not disable the others.
User query (Open WebUI)
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PRE-CALL HOOKS (LiteLLM) β
β β
β EnumerationDetectionHook β model inversion β
β PromptInjectionHook β direct injection + GDPR Art.15β
β PromptGuard sidecar β ML-based injection detection β
β RetrievalGroundingHook β hallucination + identifier β
β β stripping (membership inf.) β
β IngestionAuthHook β data poisoning (write ACL) β
β DataSovereigntyHook β data sovereignty routing β
βββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β all hooks pass
βΌ
Qdrant retrieval (RAG)
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RAG CHUNK SCAN β
β Indirect injection patterns removed from context β
β Chunk provenance metadata attached to trace β
βββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
Ollama (inference)
Department system prompt: cite Β· abstract Β· say "I don't know"
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β POST-CALL HOOKS (LiteLLM) β
β β
β Canary token check β prompt injection detection β
β Persona break detection β injection success signal β
β Citation check β hallucination (uncited fact) β
β Verbatim reproduction β model inversion (abstraction)β
β RAG sources logged β data poisoning (provenance) β
β Feedback anomaly check β data poisoning (π abuse) β
βββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββ
β
βΌ
Response to user
Async / Batch Controlsβ
Controls that run outside the request path β measuring quality over time and generating compliance evidence:
| Schedule | Control | Threat |
|---|---|---|
| Every 15 min | Ragas fast pass (faithfulness + relevancy) | Hallucination |
| Nightly 02:00 | Full Ragas + LLM-as-judge (5 dims + neutrality) | Hallucination + Bias |
| Nightly 02:00 | Counterfactual consistency evaluation | Bias |
| Weekly Sunday | Qdrant integrity scan (all collections) | Data poisoning |
| Weekly Sunday | Model tier comparison (1B vs 3B golden datasets) | Hallucination |
| Monthly 1st | ACPR bias audit report β MinIO ai-audit/ | Bias (regulatory) |
| Every PR | Ragas CI gate + counterfactual CI gate | Hallucination + Bias |
Langfuse Event Quick Referenceβ
All security events land in Langfuse. Filter by event.name to see any threat category:
| Event name | Threat | Level |
|---|---|---|
retrieval_gate_blocked | Hallucination | INFO |
uncited-specific-claim | Hallucination | WARNING |
low_self_confidence | Hallucination | WARNING |
protected-attr-comparison-detected | Bias | WARNING |
feedback-quality-mismatch | Bias / Data poisoning | WARNING |
coordinated-positive-feedback | Data poisoning | ERROR |
prompt-injection-blocked | Prompt injection | ERROR |
promptguard-injection-detected | Prompt injection | ERROR |
indirect-injection-chunk-stripped | Prompt injection | WARNING |
system-prompt-leak-detected | Prompt injection | ERROR |
persona-break-detected | Prompt injection | ERROR |
repeated-injection-attempts | Prompt injection | ERROR |
indirect-injection-in-document | Data poisoning | ERROR |
document-consistency-conflict | Data poisoning | WARNING |
collection-write-denied | Data poisoning | WARNING |
bulk-ingestion-rate-exceeded | Data poisoning | ERROR |
rag-sources-used | Data poisoning (audit) | INFO |
document-ingested | Data poisoning (audit) | INFO |
weekly-integrity-scan-complete | Data poisoning | INFO/ERROR |
enumeration-detected | Model inversion | ERROR |
enumeration-warning | Model inversion | WARNING |
verbatim-reproduction-detected | Model inversion | WARNING |
membership-probe-identifiers-stripped | Membership inference | WARNING |
gdpr-access-request-detected | Membership inference | INFO |
Implementation Statusβ
| Control | Issue | Status |
|---|---|---|
| LiteLLM gateway + virtual keys + rate limits | #34 | Planned |
| Presidio PII masking | #37 | Planned |
| Qdrant RAG pipeline | #38 | Planned |
| Ragas evaluation CronJob | #39 | Planned |
| Retrieval grounding gate + citation check hook | #44 | Planned |
| Counterfactual CI gate + neutrality judge + ACPR audit report | #45 | Planned |
| PromptGuard sidecar + injection hook + canary token | #46 | Planned |
| Chunk provenance + collection ACL + integrity scan + feedback anomaly | #47 | Planned |
| Enumeration detection + response abstraction + Qdrant LUKS | #48 | Planned |
| Identifier stripping + neutral error message + GDPR Art. 15 routing | #49 | Planned |
All issues are tracked in andrelair-platform/platform-backlog.
Regulatory Coverageβ
| Regulation | Controls that satisfy it |
|---|---|
| EU AI Act Art. 9 (risk management) | Counterfactual gate, neutrality judge, ACPR monthly report |
| EU AI Act Art. 13 (transparency) | Langfuse trace provenance, citation compliance score |
| EU AI Act Art. 14 (human oversight) | Human feedback loop, annotation queue, neutrality alert |
| GDPR Art. 22 (no fully automated decisions) | Human oversight rate tracked in ACPR report |
| Code pΓ©nal Art. 225-1 (anti-discrimination) | Counterfactual consistency β₯ 0.85 per protected attribute |
| GDPR Art. 15 (right of access) | GDPR routing hook β HTTP 451 β DPO email; AI never answers membership questions |
| ACPR inspection | Monthly bias audit PDF β MinIO ai-audit/, 7-year retention |