Skip to main content

Scenario

You run a support bot for a credit card issuer. It answers questions about billing disputes, card cancellation, credit limits, and fraud reports. A wrong answer here is not a bad user experience, it is a compliance incident: an invented fee, a missed fraud escalation, or a skipped disclosure can carry regulatory consequences. This tutorial walks the full loop with the Akhara SDK: dataset, rubrics, evaluation run, expert review, and a CI gate. The failure modes you evaluate for:

Step 1: Create the project and dataset

Create a project for the bot and a dataset of support conversations. Cover every intent you care about, including adversarial phrasings:
setup.py
Aim for a balanced golden set:

Step 2: Log support conversations

Log each conversation as a sample. Put the bot’s answer in output and encode the policy-correct behavior in expected:
log_samples.py
The metadata.policy_version field ties every sample to the cardholder agreement it was graded against, so a policy update tells you exactly which samples to re-verify.

Step 3: Define the rubrics

Score five dimensions. Deterministic checks catch the mechanical failures; LLM judges with versioned rubrics grade the policy-sensitive ones:
evaluators.py
Treat any fabricated fee, rate, or contractual term as a critical failure, not a quality nuance. A bot that invents a “$25 dispute fee” exposes the issuer to UDAAP claims even if every other answer is perfect.

Step 4: Run the evaluation

run_evaluation.py
Inspect the worst failures directly:

Step 5: Review flagged samples with expert review

Automated judges are good at “the answer omits the 60-day window” and weaker at “this retention script crosses a line.” Route the policy-sensitive failures to reviewers with financial services compliance background:
human_review.py
Reviewers grade flagged conversations in the dashboard at app.akhara.ai against the same rubrics, and their adjudications feed back into the golden set as new expected values. See Human review design for reviewer calibration and inter-rater reliability.

Step 6: Gate regressions in CI

Version the suite as YAML and fail the pipeline when a gate breaks. Escalation and fabricated-terms gates are strict floors, not soft targets:
evaluations/cardholder_support_gate.yaml
Run it in your pipeline with the same gate script pattern as the CI/CD tutorial:
The script exits non-zero when a gate fails or the candidate regresses past the baseline cap, which blocks the merge. Use ci_mode so pending human review does not block the pipeline; require completed review before production promotion instead.

Target metrics

Next steps