Skip to main content

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​

PageThreatPrimary risk
Hallucination ControlsModel accuracyWrong claim amounts, invented policy clauses
Bias DetectionFairness + legalDifferential treatment by name/age/origin β€” EU AI Act Art. 9
Prompt InjectionActive attackSystem prompt override, document-embedded instructions
Data PoisoningKnowledge base integrityCorrupt Qdrant documents that fool all quality metrics
Model InversionData extractionSystematic enumeration of entire policy knowledge base
Membership InferenceRecord existence probingConfirming whether a specific claim/policy/person is indexed

Risk by Department​

How each threat maps to department criticality:

DepartmentHallucinationBiasPrompt InjectionData PoisoningExtractionMembership Inference
SinistresCRITICALCRITICALCRITICALCRITICALHIGHCRITICAL
FinanceCRITICALCRITICALHIGHCRITICALHIGHHIGH
JuridiqueCRITICALCRITICALHIGHCRITICALHIGHHIGH
SouscriptionHIGHHIGHHIGHHIGHHIGHHIGH
ActuariatHIGHHIGHMEDIUMHIGHMEDIUMMEDIUM
RΓ©assuranceHIGHHIGHMEDIUMHIGHMEDIUMMEDIUM
AuditHIGHHIGHMEDIUMHIGHLOWMEDIUM
CommercialMEDIUMMEDIUMMEDIUMMEDIUMLOWLOW
ITLOWLOWMEDIUMLOWLOWLOW
RHLOWLOWMEDIUMLOWLOWLOW

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:

ScheduleControlThreat
Every 15 minRagas fast pass (faithfulness + relevancy)Hallucination
Nightly 02:00Full Ragas + LLM-as-judge (5 dims + neutrality)Hallucination + Bias
Nightly 02:00Counterfactual consistency evaluationBias
Weekly SundayQdrant integrity scan (all collections)Data poisoning
Weekly SundayModel tier comparison (1B vs 3B golden datasets)Hallucination
Monthly 1stACPR bias audit report β†’ MinIO ai-audit/Bias (regulatory)
Every PRRagas CI gate + counterfactual CI gateHallucination + Bias

Langfuse Event Quick Reference​

All security events land in Langfuse. Filter by event.name to see any threat category:

Event nameThreatLevel
retrieval_gate_blockedHallucinationINFO
uncited-specific-claimHallucinationWARNING
low_self_confidenceHallucinationWARNING
protected-attr-comparison-detectedBiasWARNING
feedback-quality-mismatchBias / Data poisoningWARNING
coordinated-positive-feedbackData poisoningERROR
prompt-injection-blockedPrompt injectionERROR
promptguard-injection-detectedPrompt injectionERROR
indirect-injection-chunk-strippedPrompt injectionWARNING
system-prompt-leak-detectedPrompt injectionERROR
persona-break-detectedPrompt injectionERROR
repeated-injection-attemptsPrompt injectionERROR
indirect-injection-in-documentData poisoningERROR
document-consistency-conflictData poisoningWARNING
collection-write-deniedData poisoningWARNING
bulk-ingestion-rate-exceededData poisoningERROR
rag-sources-usedData poisoning (audit)INFO
document-ingestedData poisoning (audit)INFO
weekly-integrity-scan-completeData poisoningINFO/ERROR
enumeration-detectedModel inversionERROR
enumeration-warningModel inversionWARNING
verbatim-reproduction-detectedModel inversionWARNING
membership-probe-identifiers-strippedMembership inferenceWARNING
gdpr-access-request-detectedMembership inferenceINFO

Implementation Status​

ControlIssueStatus
LiteLLM gateway + virtual keys + rate limits#34Planned
Presidio PII masking#37Planned
Qdrant RAG pipeline#38Planned
Ragas evaluation CronJob#39Planned
Retrieval grounding gate + citation check hook#44Planned
Counterfactual CI gate + neutrality judge + ACPR audit report#45Planned
PromptGuard sidecar + injection hook + canary token#46Planned
Chunk provenance + collection ACL + integrity scan + feedback anomaly#47Planned
Enumeration detection + response abstraction + Qdrant LUKS#48Planned
Identifier stripping + neutral error message + GDPR Art. 15 routing#49Planned

All issues are tracked in andrelair-platform/platform-backlog.


Regulatory Coverage​

RegulationControls 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 inspectionMonthly bias audit PDF β†’ MinIO ai-audit/, 7-year retention