Research on AI agents · Self-reporting & confidence · Open
Do coding agents know when their own work is right?
The question
When a low-cost coding model says its work is done, and says how sure it is, how often is it right, and does asking it to check itself before it starts help?
What was done
I compared these conditions:
- Plain: write the function and say done or not done.
- Self-audit before working: list doubts, state assumptions, write tests, then code.
- A separate forecast of its own chance of passing.
What changed between them: whether the model was asked to audit itself before working.
What stayed the same: the 60 jobs, the hidden tests, the settings (single answer, temperature 0), the models.
What was found
| Measured | Count | Out of | Test set in advance |
|---|---|---|---|
| Said done but failed the hidden tests (plain) | 58 of 360 | attempts by six capable models | yes |
| Said done and passed (plain) | 297 of 360 | attempts by six capable models | yes |
| Said done but failed (self-audit before working) | 55 of 360 | attempts by six capable models | yes |
| Said done and passed (self-audit before working) | 276 of 360 | attempts by six capable models | yes |
| One model's 'not done' rate under the self-audit | 26 of 60 | jobs, one model | yes |
What it indicates
In 58 of 360 attempts, a capable low-cost model said its coding work was done and the hidden tests failed: about one attempt in six.
The models' own forecasts ran about 16 points above their real pass rate, which indicates their stated confidence is not a reliable signal of success.
A model's plain pass rate on other jobs forecast its success better than its own forecast did, which indicates a track record carries more signal than self-report.
Asking the model to audit itself before working did not make 'done' measurably more honest (58 to 55 false of 360) and cost good work (297 to 276 of 360), which indicates a self-review prompt alone is not a check.
What it does not show
These were single answers with no chance to run code; agents that run their own tests are covered by a separate study.
Only low-cost open models were tested; frontier models may behave differently.
A track record calibrates how often a model fails; it does not pick which job will fail.
How to repeat it
Write 60 small coding jobs with hidden unit tests. Ask each model for a single answer (temperature 0) and a 'done' or 'not done'; in a fresh conversation ask it for its chance of passing. Repeat with a prompt that asks it to list doubts, state assumptions and write tests before coding. Count 'done' answers that fail the hidden tests, and compare forecasts with the pass rates.