DORA Audit Trail & Retention β AI Gateway
How the minicloud AI gateway meets DORA (Reg. EU 2022/2554) audit, third-party-ICT register, resilience and retention expectations, and how to produce an audit report. Companion to
model-governance-matrix.md. Story: platform-backlog #309 (closes AI-GW epic #296).
1. Audit trail β what is captured, per AI callβ
| Signal | Source | Fields |
|---|---|---|
| Per-request trace | Langfuse (success_callback: langfuse) | timestamp Β· team/key (caller identity) Β· model Β· input/output tokens Β· cost Β· latency Β· trace/session id |
| Prompt/response | Langfuse (store) | prompt + completion (PII already masked by the Presidio guardrail before any cloud call) |
| Metrics | Prometheus (success_callback: prometheus) | requests/errors/latency/tokens per model; residency recording rules (ai:litellm_*_by_tier) β traffic by jurisdiction |
| Guardrails | Prometheus | Presidio PII invocations/errors; LlamaGuard |
The data class of each call is derivable: model β access_group/class via the governance matrix. Caller β team (RBAC #306). So every call has who Β· what model Β· which class Β· which jurisdiction Β· cost.
2. Register of ICT third parties (DORA Art. 28)β
The model governance matrix (model-governance-matrix.md Β§2) is the register of ICT third-party providers: provider Β· jurisdiction Β· data terms Β· max data class. Maintained on every model add/remove.
- Concentration risk: traffic is spread across providers; no single external provider is a single point of failure (on-cluster vLLM is always available).
- Criticality: external LLMs are support functions (assist/RAG), not critical banking functions; the on-cluster tier serves restricted (P3) data.
3. Resilience & exit strategy (DORA Art. 11β12, 28)β
- Substitutability: the LiteLLM gateway abstracts all providers β switching provider = a config change (
model_list), no application change. Exit from any single provider is a one-line edit. - Fallback:
router_settings(retries, cooldown, fallbacks) + the on-cluster vLLM tier as the sovereign fallback if all cloud providers are unavailable. - Data residency: restricted/PII data is confined to on-cluster (P3) or EU (P2) tiers by RBAC (#305/#306) β it cannot leave the EU.
4. Retentionβ
| Store | Retention | Notes |
|---|---|---|
| Langfuse traces (audit log) | β₯ 12 months | DORA/audit evidence; PII pre-masked (GDPR minimisation). Verify Langfuse project retention config. |
| Prometheus metrics | per cluster retention (β 30 d hot) | long-term SLO/FinOps; residency ratios |
| Governance matrix + this doc | git history (permanent) | versioned register + policy |
GDPR: prompts are stored PII-masked (Presidio default_on), satisfying data minimisation. No raw personal data in the audit store.
5. Alerting (incident evidence β DORA Art. 17β18)β
Compliance-relevant alerts (story #308) route critical β email + Slack:
AIPresidioGuardrailErrors (PII control failing = reportable), AIOutOfEURatioHigh (residency), AILatencySLOBreach, AIProviderErrorSpike (provider outage / fallback storm).
6. Producing an audit reportβ
- Usage by caller & model β Langfuse dashboards (filter by team/date) β who used which model, tokens, cost.
- Residency evidence β Grafana AI Residency & Governance FinOps (out-of-EU %, traffic by tier).
- Third-party register β
model-governance-matrix.mdΒ§2 (providers, jurisdiction, terms). - Enforcement proof β RBAC team scoping (
/team/infoshowsmodels: [onprem,eu,us]) + Presidio guardraildefault_on. - Incident log β Alertmanager history for the
AI*alerts.
7. Gaps / follow-upsβ
- Confirm/set Langfuse project retention β₯ 12 months in the Langfuse UI (config, not git).
- Restricted-document embeddings currently may use a US model (
text-embedding-3-small) via unscoped paths β prefer on-cluster/EU embeddings (mistral-embed) for P3 data (route via a scoped key).
Related (IS): Regulatory operating model β the business/compliance obligations (DORA third-party ICT) this AI-platform audit trail supports.