Work / 01 · Evals

Verified Personal research project · July–August 2026

A text-to-SQL agent that can't game its own eval

An agent that improves its own prompts will find the cheapest way to raise its score. I made the cheap ways impossible, and let only real improvements through.

What I refused to trust

The agent, with its own scorer

The safety gate, the read-only executor and the result comparer are hash-locked. A test fails if anything edits them, and only a person can re-lock them.

A raw accuracy delta

On 100 questions the noise is about ±5 points. So a change is judged on questions it fixes minus questions it breaks, against a fixed bar.

Any SQL the model writes

Every query is parsed before it runs. Anything but a single SELECT is blocked, and the database is a disposable copy.

Turn the ratchet

real results

Feed a real experiment into the gate. If it clears the bar, the gear clicks one tooth forward. If it doesn't, the pawl holds and nothing ships.

Pick an experiment.

How it works

Six fixed stages. Pick one to lift it out of the stack.

Evidence

Verified

61.4%

Execution accuracy on all 1,532 BIRD dev questions, two-candidate setup, $3.86, 66 minutes.

Verified

70.2%

Of 500 questions, the right answer was among the candidates. The agent then picked it 61.8% of the time.

Held

68%

The design target. Not reached on a 500-question run. Some 100-question runs hit 70%, but that is inside the noise.

Where it still fails

Misses by type, from the failure classifier. Most failures are in writing the query, not in choosing between candidates.

Joins
252
Schema
232
Selection
42
Values
24
Syntax
21

What this page can't claim

  • The self-improving loop is built but has never run unattended. Every step so far was a manual paired test.
  • All measured runs used one fast, low-cost model. Runs with a larger model were planned and not done.
  • The code was written with AI coding agents. The eval design, the gates and the guard layer are mine.

ProposedRun the loop nightly under a $30 cap · open-source the repo