Guides · Checking AI code

How to check the code an AI writes

Updated:

Do not rely on the AI’s own report. Have the work checked by a second model from a different company, against the rules you agreed, from the screen to the database and back — and keep a record of what passed and what failed. Problems go back for repair and are checked again.

Why can’t you trust the AI’s own report?

Because a model checking its own work shares its own blind spots, and it can say “done” without proof.

A builder that misread a rule will test what it misread and find it correct. That is not dishonesty; it is the same reading twice. A second reader with a different training finds different mistakes.

What is an independent check?

A second AI, from a different company, reads the agreed rules and tests the result against them. It does not edit the product; it records what passed and what failed.

Keeping the checker away from the code it checks matters: a checker that may fix things soon starts to explain away what it found. Its job is to say, with evidence, whether each rule holds.

What does a good check look at first?

The business rules, from input to output: what the person does on the screen, what is stored in the database, what comes back. Then security and speed.

Take a rule such as “up to €500 is approved automatically; above that a manager approves — never their own request”. The check tries €499, €500 and €501, tries a manager approving their own request, and reads the database after each step. A finding counts only if the case can really happen.

What happens when the check fails?

Each finding goes back for repair and is checked again. After three failed cycles the work stops for a person’s decision.

The limit is a circuit breaker: it stops an agent from trying the same thing forever and spending time on a problem that needs a decision, not more attempts.

What does this look like on a real project?

In a recorded build of an equipment-requests app, the checker from a different AI company found two layout problems on phones that the builder had missed; the repair and the passing recheck stayed with the project.

Nobody had to look for the problems by hand. They were found because someone other than the builder looked, against the rules, and the record shows the finding, the repair and the second check.

What should you ask any AI supplier?

Who checks the work, and is it a different model from the one that built it? What exactly was tested? Where is the record? What happens after repeated failure?

If the answers are “the same AI”, “it works”, “there is no record” and “it keeps trying”, you are relying on the builder’s own opinion.

Where does CodeHero fit?

By default, every build in CodeHero is checked by a model from a different AI company, which records what passed and what failed; repairs are checked again, and repeated failure stops for your decision.

A check by the same company happens only when no other is connected or the project allows it, and it is labelled as such. The record stays with the project, on your own computer or server.

Questions people ask

All the articles
How does CodeHero compare with other AI coding tools?

It is a different kind of thing. Coding tools help a person who writes code. CodeHero does the whole job — asks, plans, builds, checks, hosts and maintains — for the person who knows the business. Read the article

If CodeHero writes the code, what is my role?

You become the advisor: you decide the business rules, approve the plan and accept the result. CodeHero is the developer that asks, builds, checks and maintains. Read the article

Do my passwords and keys reach the AI company?

Not the ones you store as secrets (eight characters or longer): your application uses them, but their values are not sent to the AI service. A password typed into a chat message or shown in a screenshot cannot be recognised — store every password as a secret. Read the article