Explaining every AI credit decision to the applicant, the auditor and the regulator
A lending agent gathers bureau data, applies the credit policy and recommends approve, decline or refer. ZizkaDB keeps the full causal record of each application, so the bank can show exactly which data and which policy rule led to every decision, months later.
The situation
A retail bank uses an AI agent to pre-assess consumer loan applications. For each application the agent pulls the credit bureau report, reads the applicant's income and expense data from open banking, checks the bank's credit policy, asks a language model to summarise affordability, and recommends approve, decline or refer to an underwriter. Thousands of applications a week go through it.
Creditworthiness assessment of natural persons is listed as a high-risk use of AI in the EU AI Act (Annex III, point 5(b)). Declined applicants are entitled to an explanation, and the bank's internal audit and model risk teams must be able to reconstruct any decision on request.
What goes wrong without a record
- An applicant complains that they were declined unfairly. The application logs show the final status, but not which bureau fields the agent used, which policy version applied, or what the model wrote.
- The credit policy changed on the 1st of the month. Nobody can say which decisions were made under the old rules and which under the new.
- A prompt change goes live and the decline rate quietly rises. It takes weeks to notice and longer to find the cause.
- Application logs can be edited by anyone with database access, so they carry little weight as evidence.
How ZizkaDB is used
Each application is one session in ZizkaDB. Every step the agent takes is recorded as an event linked to the step that caused it:
- The application arrives (
application_received, with the application id, not the full personal data). - The bureau call and its result (
tool_callandtool_result, with the bureau's reference and the fields actually read). - Each credit policy rule evaluated (
policy_rule_checked, with the rule id, policy version, the inputs and the outcome). - The model's affordability summary (
llm_end, recorded automatically byzizkadb.instrument()with model name, output and token usage). - The recommendation and the reasons given (
decision). - The underwriter's final decision for referred cases (
human_review), linked to the agent's recommendation.
Every event carries agent_version (the release of the prompt, policy pack and model), so any decision can be tied to the exact configuration that produced it.
Example
import zizkadb
from zizkadb import ZizkaDB
# ZIZKADB_API_KEY from the environment; the version is stamped on every event
db = ZizkaDB(agent_version="credit-policy-2026-11+prompt-v12")
zizkadb.instrument(db, agent="credit-assessor") # records every model call
async def assess(application):
async with db.track(agent="credit-assessor", session_id=application.id):
await db.log(agent="credit-assessor", event="application_received",
data={"application_id": application.id, "product": "personal_loan"})
rule = await db.log(agent="credit-assessor", event="policy_rule_checked",
data={"rule": "DTI_MAX", "policy_version": "2026-11",
"value": 0.47, "limit": 0.40, "passed": False})
await db.log(agent="credit-assessor", event="decision",
data={"outcome": "decline", "reasons": ["DTI_MAX"]},
parent_id=rule.event_id)When a complaint arrives, the analyst opens the decision and runs why:
chain = await db.why(decision_event_id)
chain.print() # decision ← policy_rule_checked DTI_MAX ← tool_result bureau ← application_receivedQuestions the bank can now answer
- Which data and which rule caused this decline? (
whyon the decision event) - What did the agent know about this applicant at the moment it decided? (
atwith the decision time) - How many decisions were made under policy version 2026-10 after the switch-over date? (a search on
policy_version) - Has the agent's behaviour changed since the last model update? (
baselinedrift score on the Agent Behavior page) - Can we prove these records were not changed after the fact? (
verify_chain: no event removed, inserted, reordered or edited)
Regulation and standards this supports
- EU AI Act: automatic record keeping for high-risk systems (Article 12), human oversight (Article 14) and the right to an explanation of individual decisions (Article 86).
- EU Consumer Credit Directive (EU) 2023/2225: creditworthiness assessment and the right to an explanation when automated processing is used.
- GDPR Article 22: meaningful information about the logic of automated decisions.
- Model risk management (for example SR 11-7 in the US, ECB guidance in the euro area): evidence of how a model behaves in production.
ZizkaDB provides the evidence; the bank's compliance team still owns the interpretation and the controls.
What to measure
- Time to answer a decision complaint or audit request (from days of log digging to minutes).
- Share of decisions that can be fully reconstructed (target: all of them).
- Time from a behaviour change in production to its detection.
- Regression tests created from real wrong decisions (
zizkadb test from-session), so the same mistake is caught before the next release.