← Back to the blogVerifying AI code

Deterministic or probabilistic: who should verify AI-written code?

Asking one model to check another's code stacks probability on probability. A loan eligibility rule shows why verification needs a deterministic engine.

September 10, 2026 · 4 min read

Picture a Tuesday release. Your lending app has a rule everyone agrees on. An applicant is eligible for a personal loan if they are at least 18 and their monthly net income is at least three times the monthly repayment. An assistant has just refactored the eligibility service, so you ask an AI reviewer whether the rule still holds. It says yes.

On Wednesday, with no code change, you ask again. This time it flags something about the age check.

Which answer do you ship on?

Same input, two verdicts

A language model is a probabilistic system. Given a context, it produces a likely continuation. That’s exactly why it’s good at writing code. It fills gaps, copes with vague requests and proposes alternatives. It also means the same question can get two answers, and a likely answer isn’t always a correct one.

A deterministic engine behaves differently. Same inputs, same result, through a computation you can replay. It doesn’t guess, and when information is missing, it says so.

This stops being academic the moment verification gates a release. If the same code can pass on Tuesday and fail on Wednesday, teams learn to rerun the check until it turns green, and the check becomes a ritual. With a deterministic check, a gap stays open until someone changes the code or the spec. When it closes, you can point to the reason.

AI CHECKING AIDETERMINISTIC ENGINERun 1Looks fineRun 1Rule R12 · gapRun 21 possible issueRun 2Rule R12 · gapRun 3Looks fineRun 3Rule R12 · gapSame question, different answers.Same question, same answer.
Asked three times, an AI checker can answer differently; a deterministic engine gives the same answer every time, with the rule it relies on.

Developers already hedge

Sonar’s State of Code Developer Survey (January 2026, more than 1,100 developers) found that 96% don’t fully trust that AI-generated code is functionally correct, and only 48% always check it before committing.

The usual response is another layer, where one model reviews what another one wrote. Those tools catch style issues, frequent mistakes and known vulnerabilities, and they’re worth having. Their verdict, though, is as probabilistic as the code it judges. Adding a reviewer that might change its mind tomorrow doesn’t close the trust gap.

There’s a second limit. Line-by-line review compares the code with itself, or with general good practice. It has never read your credit policy. The income ratio and the age threshold live in a policy document and in a few people’s heads, and that intent is the real reference. The code is only where it got implemented.

Back to the eligibility rule

Now run the same refactor through a deterministic check.

Lyriks represents your software and its spec as a graph: features, user journeys, business rules, screens, objects and invariants, each linked to the code that implements it. The eligibility rule points to the service that evaluates it. Verifying a change means applying transformation rules to that graph and computing whether each spec rule still holds. The engine is built on graph rewriting, developed in-house, and is patent pending.

So it asks precise questions. Is the age threshold still 18, and still “at least” rather than “more than”? Is the ratio still computed on net income? Is there exactly one path that decides eligibility, or did the refactor leave a second one, say in the mobile API, that still uses gross income? If it finds that second path, it reports a gap on that rule, along with the place in the code.

It also checks the edges people rarely test, like an applicant who turns 18 today, or an income exactly three times the repayment. Those boundary cases are where “at least” and “more than” part ways, and where a refactor most often slips.

The gap goes back to the LLM, which fixes it. The engine rechecks with exactly the rules it used the first time, and the loop continues until every rule is met. Each release gets a compliance report that sorts affected rules into compliant, addition, omission and regression. Those labels are computed, so running the report twice gives you the same report.

RULEAt least 18, net income at least 3x repaymentAge threshold still 18?CHECKED"At least", not "more than"?CHECKEDRatio still on net income?CHECKEDOne path decides eligibility?GAP: MOBILE API USES GROSSEdges: turns 18 today, income exactly 3xCHECKEDGAP SENT TO THE LLMLLM FIXESSAME RULES RECHECKEDSAME REPORT EVERY RUN
A deterministic check asks precise questions about the loan eligibility rule, including boundary cases, and reports a gap on a second path. The gap returns to the LLM and the same rules are rechecked.

Checking before the code, too

Determinism also lets you check earlier. Code review has to wait until code exists. Lyriks first checks the spec. A planned change, such as raising the minimum age to 21 for one loan product, is simulated on the graph to see what it touches, what fits and what conflicts, including with other changes in flight. Then the delivered code is checked against that spec.

The two families of tools don’t compete as long as each keeps its job. The LLM writes, and the deterministic engine verifies. Asking one model to do both is a bit like asking the musician to be the tuning fork as well.

The Verify AI code page covers the details, and a demo runs the check on one of your own modules. If an auditor asked you tomorrow to prove your eligibility rules still hold, which verdict would you rather hand over?

Keep your software in tune

Start with one module. Lyriks recovers its spec, then verifies every change. All it needs is your repository.