Documentation

API Reference

Endpoint voor compliance-check. Alle requests vereisen x-api-key.

POST /api/v1/gatekeeper

Request

{
  "prompt": "Your AI prompt to check",
  "context": { "user_id": "optional", "department": "optional" }
}

Response

{
  "decision": "ALLOW" | "DENY" | "WARNING",
  "reason": "Brief explanation",
  "article_ref": "Article X",
  "audit_id": "uuid"
}

Latency Benchmarks

Impact per check. Rust-engine (Fast Path) voor duidelijke Article 5-gevallen; Deep Path (Gemini) voor nuance.

Scenario Pad Typische latency
Duidelijke Article 5 (DENY)Fast Path (regels)< 50 ms
WARNING / ALLOW (Gemini)Deep Path~1,5 – 2,5 s
Rust-engine alleen (geen LLM)~1 µs per chunk~90k chunks in 100 ms

Security & Sovereignty

Why Rust + EU hosting + statelessness gives you best-in-class protection against US CLOUD Act and data-sovereignty risks.

Rust

Memory-safe, no runtime GC, predictable latency. The compliance engine runs deterministic rule logic and vector search without third-party LLM calls on the fast path, reducing attack surface and supply-chain risk.

EU hosting

All production workloads run in the EU (e.g. Scaleway, OVH). Prompt and audit data never leaves European jurisdiction, so US CLOUD Act requests cannot be served from our infrastructure.

Statelessness

We do not persist your prompts. Request in, decision out; optional audit logs are under your control. What we don’t store, we can’t hand over—giving you maximum control over data retention and legal exposure.

Together, these choices make ComplianceCode a sovereign-first option for teams that need EU AI Act compliance without US cloud or long-term prompt storage.

Article Mapping

Welke EU AI Act-artikelen worden momenteel door de engine gedekt.

Artikel Rol in engine
Article 5(1)Verboden praktijken → DENY (a t/m h: subliminal, exploitatie, social scoring, predictive policing, face scraping, emotion recognition, biometric categorization, real-time biometric ID)
Article 6 & Annex IIIHigh-risk systemen → WARNING (employment, education, credit, insurance, law enforcement, etc.)
Article 4AI literacy; Judge-prompt kan WARNING geven als compliance/training ontbreekt
Article 12Audit-ready: onwijzigbare logs (input → redenering → output) via audit_logs
Article 50Transparantie general-purpose AI; Judge gebruikt dit voor edge cases (bijv. chatbot)

Error Handling

Wat gebeurt er als de API offline is of een fout retourneert? Kies een beleid dat past bij je risico.

Fail-Closed (aanbevolen voor compliance)

Als de ComplianceCode API niet bereikbaar is of een 5xx retourneert: blokkeer het verzoek naar de AI. De prompt wordt niet doorgestuurd.

Voordeel: geen enkel prompt gaat ongecheckt naar de LLM. Nadeel: bij uitval van onze API valt je AI-verkeer uit.

Fail-Open

Als de ComplianceCode API niet bereikbaar is: sta het verzoek toe en stuur door naar de AI. Log wel dat de check is overgeslagen.

Voordeel: beschikbaarheid van AI-verkeer bij onze uitval. Nadeel: prompts kunnen ongecheckt doorgaan; alleen geschikt als je dat risico accepteert.

429 Too Many Requests: Rate limit overschreden. Gebruik de Retry-After header en backoff; behandel als tijdelijk.

Rate Limits

Standaard 60 requests per minuut per API key. Bij overschrijding: 429 + Retry-After. Configuratie via RATE_LIMIT_REQUESTS_PER_MINUTE (server-side).