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
Step 2: Log support conversations
Log each conversation as a sample. Put the bot’s answer inoutput and encode the policy-correct behavior in expected:
log_samples.py
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
Step 4: Run the evaluation
run_evaluation.py
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
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
ci_mode so pending human review does not block the pipeline; require completed review before production promotion instead.
Target metrics
Next steps
- Safety gating before production: stricter gates for policy-sensitive agents
- Deploy evaluations in CI/CD: the full gate script and GitHub Actions wiring
- Continuous monitoring in production: track the same metrics on live traffic

