Phase C · Information Systems Architecture
AIB Audit Service API
Version: 1.0 | Status: Draft | Date: 2026-06-08
Overview
aib-audit owns immutable audit logging for all data mutations. Read-only queries for compliance investigations.
Primary Table: audit_log (append-only, immutable)
Calls: None (passive listener on all mutations)
Called By: Compliance, internal audit, FMA inspection
SLA Targets
| Metric | Target |
|---|---|
| Audit log write | Sub-millisecond (trigger-based) |
| Query latency | P95: 500ms (10-year dataset) |
| Availability | 99.99% (immutable critical) |
Key Endpoints
GET /audit-log/{entity_type}/{entity_id}
Params: from_date, to_date, field_filter
Returns: Chronological mutation history (who, what, when, why)
SLA: P95: 500ms
GET /audit-log/str/{str_id}/tipped-off-checks
Returns: All attempts to set str.tipped_off != 0 (should be empty)
SLA: P95: 100ms (critical compliance check)
GET /audit-log/sanctions-freeze/{freeze_id}/unfreeze-audit
Returns: Who unfroze, when, authorization chain
SLA: P95: 200ms
GET /audit-log?table={table}&date_range={range}&mutation_type={type}
Advanced filtering for investigations
SLA: P95: 1000ms (complex query)
POST /audit-log (INTERNAL ONLY)
Body: { entity_type, entity_id, mutation_type, before_values, after_values, actor_id }
No response to client (fire-and-forget)
SLA: P95: <1ms (trigger-driven from DB)Immutability Enforcement
-- Database layer
CREATE TABLE audit_log (
id TEXT PRIMARY KEY,
entity_type TEXT NOT NULL,
entity_id TEXT NOT NULL,
mutation_type TEXT NOT NULL, -- 'INSERT' | 'UPDATE' | 'DELETE'
before_values JSONB,
after_values JSONB,
actor_id TEXT NOT NULL,
timestamp DATETIME NOT NULL,
CONSTRAINT immutable_no_updates CHECK (true) -- DB row cannot be updated once written
);
-- Application layer: audit_log is write-only, never UPDATE/DELETERegulatory Compliance
| Framework | Requirement | Implementation |
|---|---|---|
| BCBS 239 P12 | Audit trail for all mutations | 100% coverage, 10-year retention |
| SPG Art. 16 | Tip-off prohibition enforcement | Immutable flag + query endpoint to verify no attempts |
| GDPR Art. 5(1)(f) | Accountability (audit trail) | All data mutations logged with actor + timestamp |
| DORA Art. 9 | ICT audit trail | 1-year minimum for all ICT changes |
Referenced by
- agentAgent — Credit Risk Manager (agent:aib-credit-risk)
- agentAgent — Depositary Oversight (agent:aib-depositary-oversight)
- agentAgent — FX/Treasury Officer (agent:aib-treasury)
- agentAgent — Internal Audit Director (agent:aib-audit)
- agentAgent — Market Risk Manager (agent:aib-market-risk)
- agentAgent — Regulatory Affairs Officer (agent:aib-regaffairs)
- refAPI-to-Process Cross-Reference
- refPhase 1–3 Verification Checklist
- refTOGAF ADM Phase Breakdown
- ServiceAIB AML Service API
- ServiceAIB Identity Service API
- ScreenSCR-AML — AML & Sanctions Screens
- ScreenSCR-AUD — Audit & Governance Screens
- ScreenSCR-CLM — Client Lifecycle & Onboarding Screens
- ScreenSCR-ICT — ICT & DORA Operational Resilience Screens
- ScreenSCR-KYC — KYC & Due Diligence Screens
- ScreenSCR-PRV — Data Privacy (GDPR/DSG) Screens
- ScreenSCR-RSK — Risk Management Screens
- DocAIB Agent Interaction & Provenance Protocol
- DocAIB Application Build PRD
- DocAIB Architecture Principles
- DocAIB Cloud Infrastructure Research — Best-in-Class Secure Cloud for a Liechtenstein/EEA Private Bank
- DocAIB Data Ownership Matrix (RACI)
- DocAIB Non-Functional Requirements & SLO Register
- DocAIB Solution Building Block (SBB) Catalog
- GovernanceAgent Definition Standard (ADS v2)
- GovernanceAIB Agent Evaluation & Monitoring
- GovernanceAIB Agent Lifecycle & Kill-Switch Runbook
- GovernanceAIB AI & Model Risk Governance Charter
- GovernanceAIB Security Threat Model (STRIDE)
- GovernanceAIB TIBER-EU Threat-Led Penetration Testing Program