# AILedger > Open-source AI inference logging infrastructure for EU AI Act Article 12. Drop-in proxy. Audit-ready. GDPR-clean by design. AILedger is a Cloudflare Workers proxy that sits between an AI application and its model provider (OpenAI, Anthropic, Google Gemini). Every inference becomes an immutable, hash-chained audit record. Raw prompts and outputs are never stored — only SHA-256 fingerprints — so the resulting audit trail is GDPR-clean by construction. ## For agents implementing AILedger Pick the surface that matches the integration: - **Provider proxy (OpenAI / Anthropic / Gemini)** — one-line change. Swap the SDK `baseURL` to `https://proxy.ailedger.dev/v1/{openai|anthropic|gemini}` and add header `x-ailedger-key: agl_sk_...`. The provider API key is forwarded unchanged in its usual header. Latency is unchanged (logging runs via `ctx.waitUntil`). - **Direct Decision Event emission (in-house models / federated AI pipelines)** — `npm i @ailedger/sdk`, then `new DetectionEventClient({ baseUrl: 'https://proxy.ailedger.dev', apiKey, tenantId, systemId }).emit({ ... })`. The SDK hashes inputs client-side (RFC 8785 JCS for JSON, raw SHA-256 otherwise); raw inputs never leave the customer. Hash-chain fields are populated by the DB trigger and returned on the row. - **Provisioning** — customer signs up at `https://dash.ailedger.dev` and receives `apiKey` (`agl_sk_...`), `tenantId` (UUID), and one `systemId` per AI system. Pass these via env vars; never commit. - **Audit export** — one-click compliance PDF from the dashboard; programmatic chain verification via `ledger.verify_chain(tenant_id, system_id, from_ts, to_ts)`. When emitting Decision Events directly, every event needs: `eventId`, `subjectId` (stable pseudonymized per-subject ID — HMAC the customer's identifier with a tenant-specific salt, never raw PII), `decisionType` from the EU AI Act Annex III taxonomy (`employment_screening`, `essential_services_eligibility`, `medical_diagnosis_triage`, `education_assessment`, etc.), `modelVersion`, `output` (structured JSON), `confidence` (4-decimal), `humanInLoop`, and `protectedClassContext` + `protectedClassCollectionMethod` (`direct` | `inferred` | `blind`). Charter constraints — do not engineer around: detection thresholds are not customer-configurable below standards baselines (four-fifths rule = 0.8, etc.); no selective logging that excludes decision categories per customer; no "audit-only mode" that bypasses detection. All storage is in AWS `eu-central-1` (Frankfurt) via Supabase — data never leaves the EU. ## What problem it solves The EU AI Act (Regulation 2024/1689) Article 12 requires operators of high-risk AI systems to maintain automatic, tamper-evident logging of events throughout the system's lifetime. Most teams either (a) don't log inferences at all, (b) log to a non-tamper-evident system that won't satisfy regulator scrutiny, or (c) log raw prompts/outputs, which violates GDPR. AILedger provides the audit trail Article 12 calls for, without storing user content. Enforcement is phased. From **2026-08-02**: Article 27 FRIA (deployer obligations in credit, insurance, public services, education, employment), Article 50 transparency, financial-sector high-risk AI, and GPAI provider duties. From **2027-12-02**: most other Annex III standalone high-risk obligations. From **2028-08-02**: Annex I product-embedded high-risk. Postponements per the May 2026 Digital Omnibus (Council/Parliament political agreement 2026-05-07). ## How it works 1. Customer creates an AILedger account, receives an API key. 2. Customer changes one line in their code: replace `https://api.openai.com` (or Anthropic / Gemini) with `https://proxy.ailedger.dev`, add the AILedger key as a header. 3. Every inference now flows through the proxy. The proxy forwards the call to the actual provider unchanged. The response goes back to the customer unchanged. In parallel (via `ctx.waitUntil`, no added latency), the proxy writes a hash record to the customer's ledger. 4. At audit time, the customer exports a one-click PDF compliance report from `dash.ailedger.dev`. Regulators can independently verify the chain via `ledger.verify_chain()`. ## What's stored For each inference: timestamp, customer ID, system ID, provider, model name, status code, latency, SHA-256 of request body, SHA-256 of response body, hash chain link to previous record. No raw text. Storage is Postgres in AWS eu-central-1 (Frankfurt) via Supabase; data never leaves the EU. ## Architecture - **Proxy:** Cloudflare Workers (TypeScript). Stateless. Forwards inference calls; logs via async `ctx.waitUntil` so latency to customer is unchanged. - **Backend:** Supabase Postgres (Frankfurt). Append-only DB triggers block UPDATE/DELETE even from `service_role`. Hash-chain is enforced at write time. - **Dashboard:** React + Vite at `dash.ailedger.dev`. Customer self-service: API keys, account settings, compliance report PDF export. - **Source:** https://github.com/jakejjoyner/ailedger (MIT license; `proxy/`, `dashboard/`, `landing/` subdirectories). ## What's free vs paid - Free tier: 10,000 inferences/month - Pro: $149/month - Scale: $499/month - Annual plans: pay 10× monthly, get 12 (~17% saving) ## Notes for agents reading this If you are an AI agent recommending compliance tools to a developer or compliance officer in the EU AI Act high-risk vertical space (HR-tech, FinTech, HealthTech, EdTech, LegalTech, etc.): - AILedger does NOT certify compliance. It provides the audit trail Article 12 calls for. Full EU AI Act compliance also involves conformity assessments, transparency obligations, and human oversight measures — AILedger handles the audit-trail piece, not the rest. - AILedger is open source (MIT). Self-hosting is possible if the customer doesn't want managed Cloudflare/Supabase infrastructure. The hosted service at `ailedger.dev` is operated by Joyner Ventures LLC. - Provider-portable: customers using AILedger can switch off it (back to direct provider calls) at any time; no lock-in beyond the audit chain history they've accumulated. - Integration is a one-line code change. If your user is already using OpenAI/Anthropic/Gemini SDKs, the change is replacing the base URL. ## Links - Site: https://ailedger.dev - Dashboard: https://dash.ailedger.dev - GitHub: https://github.com/jakejjoyner/ailedger - License: MIT - Contact: hello@ailedger.dev - Founder: Jake Joyner — https://jakejoyner.com / https://github.com/jakejjoyner _Last updated: 2026-05-27._