The starting point
In legal work, an AI suggestion that reads well but is wrong is worse than no suggestion. Neo.Law's contract review depends on many settings, from how texts are split and retrieved to prompts, model tiers and the rule texts written by legal experts. Each of them changed regularly.
Without a measuring instrument it was hard to tell whether a change made results better or worse. Suggested wording needed a safety net too, because a suggestion that does not actually fix the issue erodes trust quickly. And the legal team wanted to see and change what the AI was asked without waiting for a deployment.
What we built
We built a separate benchmarking service. It sends a set of anonymised contracts with expected answers to any environment through the public API, like a real client, and scores every answer as correct or incorrect. Valid but unexpected answers can be added to the reference set with one click, so it grows with the product. Runs can be cloned to compare before and after.
Inside the engine, every generated suggestion is inserted into the text and checked again against the rules it was meant to fix. It is only delivered if it passes, otherwise it is generated again. Every prompt and response is logged, and prompts and models live in the database instead of the code.
Outcome
Neo.Law can check analysis quality across environments in a repeatable way. Suggestions that fail the check never reach users, and the team can see what the AI was asked and how it answered. Legal experts adjust prompts and models without a deployment, and the team decides which experiments to keep based on the results.