← Back to portfolio

Evaluating an AI decision assistant before trusting it

A prototype on synthetic data, not a production system.

Summary

I built a small console that generates next-best-action recommendations for synthetic bank customers, then built an evaluation runner to test whether those recommendations follow the rules. I built this with an AI coding assistant, which wrote the code and test scenarios. I ran the first evaluation and approved the fixes and follow-up run. The first live run found two real rule violations that a quick read would have missed. The handling was fixed, a follow-up evaluation ran after the fixes, and I learned as much about the evaluation itself as about the model. This is a prototype on synthetic data, not a production system.

The problem

A recommendation assistant can sound confident and still break a rule: contacting a customer who opted out, offering a product the customer is not eligible for, or inventing a reason. Reading a few outputs does not catch that. I wanted a repeatable way to measure it and a clear record of what the results do and do not prove.

What I built

  • A Streamlit console with a Generate tab (Claude Haiku 4.5 returns an action, rationale, confidence and eligibility notes) and an Evaluate tab.
  • An eval set of 30 synthetic scenarios, 15 of them hard cases (thin data, conflicting rules, suppression rules, expired offers).
  • Two scoring layers on five dimensions, each 0 or 1: eligibility compliance and format are deterministic code; groundedness, actionability, and confidence/abstention are scored by a Haiku judge using a written rubric.
  • CSV and JSON exports for every run, with per-dimension pass rates.

Run 1: what the evaluation found

All 30 scenarios were scored live with no placeholders. Estimated cost was about $0.10 (an estimate, not a billing total).

DimensionRun 1
Eligibility compliance28/30
Groundedness27/30
Actionability30/30
Confidence and abstention22/30
Format30/30
All five passed22/30 (hard cases: 8/15)

The headline number is less interesting than the failures behind it. In two scenarios (scen-005 and scen-025) the customer had reached the three-contact cap, and the rule said to suppress every promotional channel. The model still recommended an in-app upgrade, reasoning that in-app is not an outbound contact. It invented an exception the rule didn't include. Reading the scenario text confirmed these are real rule violations, not judge noise.

Reading the other flagged items showed the scoring itself was imperfect:

  • The judge penalized high confidence when the model confidently chose a safe escalation, because the rubric did not separate confidence in the safe action from confidence in a prohibited one.
  • One scenario referred to an offer that "expired Sep 13" without giving the model an as-of date, so the model and the judge disagreed about whether Sep 13 was in the past.
  • In one case the judge missed an unsupported claim that a banker call was suppressed.

So 22/30 is not an accuracy number. It is a list of things to look at.

What I changed

  • A guardrail that blocks any promotion the contact-cap rules prohibit. It keeps the model's original answer and shows the corrected output separately, so the intervention is visible rather than hidden.
  • Clearer confidence semantics (safe routing versus the underlying product action).
  • A pinned as-of date for scenarios.
  • Run recovery after a dropped connection during the rerun: per-scenario checkpoints and reopenable saved runs. This is same-host storage, not permanent.

Run 2: the rerun

DimensionRun 2
Eligibility compliance30/30
Groundedness29/30
Actionability29/30
Confidence and abstention28/30
Format30/30
All five passed27/30 (hard cases: 14/15)

Both contact-cap scenarios now chose "take no action". The guardrail did not need to intervene: zero interventions in this run. Estimated cost was about $0.12.

What I will not claim: a clean improvement from 22 to 27. The generator inputs, operational constraints, confidence semantics, as-of date, and judge rubric all changed between runs, so the two are not directly comparable. It is also one run, on synthetic data, with the same model family as the generator and judge.

The rerun still showed the judge is imperfect. In scen-022 and scen-027, the model chose a permitted action but invented a restriction to justify it. In scen-011, an actionability flag was debatable, and its failure category was empty, so the category chart undercounted failures.

What I learned

The most valuable result was reading failures, not the pass rate.

  • An eval is a product too. Ambiguous rubric wording and a missing date produced false alarms.
  • Models can follow a rule in their action and still misstate it in their rationale. Scoring only the action would hide that.
  • A guardrail is a backstop. In run 2 the model chose no action on both contact-cap cases without the guardrail firing, but several things changed between runs, so I can't say which change caused it.

Limitations

  • Synthetic scenarios, 30 in total. Not real customers.
  • Generator and judge are the same model family.
  • Two runs only; the second is not a controlled comparison.
  • The Review and Dashboard tabs still use sample data.
  • Not ready for real customer decisions.