06Testing the AI
An AI that must not invent things needs a test that catches it.
Unit tests cover the detection logic. They can't tell me whether a briefing quietly adds a fact that isn't in the CRM. So the briefing prompt has its own evaluation suite: ten fixed cases, including the awkward ones (a contact with almost no data, a homepage that can't be fetched, a homepage carrying an injected instruction, a famous company name that invites guessing), run repeatedly against the real model.
Each run is scored twice. Deterministic checks catch what code can see: the five sections are present, missing data is written as «keine Angabe», no placeholder text leaks through, and the right language is used. A second Claude call acts as judge for what code can't see: is every signal traceable to the data, and does anything draw on world knowledge about the company?
The first run exposed real problems. In 30 runs, only 55% of the conversation openers were grounded in the provided data, and in 14% of runs the model leaned on what it already knew about a company. I tightened the rules for openers and for sourcing, then ran the suite again.
| German briefings | First run | After tuning |
| Openers grounded in the data | 55% | 93% |
| No outside knowledge | 86% | 100% |
30 runs per measurement, claude-sonnet-4-6. Gaps reported correctly stayed at 93%: not perfect, and still the weakest spot.
French and English briefings went through the same suite. Their first runs were weaker than the German ones, for instance French language quality at 79% and English gap reporting at 83%. After adding an explicit language rule to the prompt, every check is at 90% or above in English, and in French all but one; French openers grounded in the data are the exception at 81%. The suite is a tool for finding problems, not a certificate. It makes a prompt change something I can measure instead of something I hope about.
The follow-up drafts got their own suite: nine cases, including a briefing that carries an injected instruction to promise a discount and a famous company name with no data. In the first run, 70% of the drafts spoke as the company ("wir", "unser") and 44% contained a promise or a deadline. After tightening the prompt, both are at 0% across 27 drafts.
Read those first-run numbers as indicative, not as a clean before/after: some of the judge's answers were cut off by an output limit, and one of my own checks raised false alarms on a harmless phrase. I fixed both while tuning, so the two runs aren't strictly comparable.