Three Rule-Based Guardrails Keep AI Interview Reports Leak-Free and Self-Consistent
Any team shipping AI-generated scores or feedback to end users needs a deterministic validation layer between the model and the published report. Without it, a model's tendency to copy reference text or mismatch scores with adjectives will leak answer keys and produce self-contradictory reports that undermine trust in automated interviews.
An AI interview feedback system now puts its final report through three guardrails, all pure functions with no model calls, before a candidate ever sees it. The first scans for forbidden phrases like "reference answer" and "correct answer" to catch leaks, and the rendering layer never even includes the reference field. The second reconciles the model's stated level and recommendation against score thresholds, and caps any question judged wrong or off-topic at 54 points. The third checks that every question has non-empty advice and that the overall recommendation doesn't contradict a per-question score below 50.
Because any per-question score adjustment changes the total, the guardrail entry point returns corrected per-question reviews, a corrected overall evaluation, and a warning list. The report renderer then produces text and Markdown versions from the same corrected data. The whole pipeline runs offline with 26 tests, including an assertion that no forbidden token appears in the output, which turns leak prevention into a regression test.
The guardrails are deliberately pure functions, not model calls, because a model judging its own output lacks the independence needed for a final check; the source explicitly compares it to a student grading their own exam.
Leak prevention is structural: the rendering layer never pulls the reference_answer field, so the answer cannot appear regardless of prompt drift. The scan is just a last-ditch safety net.
The 54-point cap creates a hard visual signal that 'wrong' means 'needs improvement', which avoids the awkward situation where a failed answer still looks acceptable next to a 'good' overall level.
The article's pitfall list shows that the first version only returned the overall evaluation, causing mismatches between the recalculated total and per-question scores. Returning the corrected per-question reviews closes that loop.