DEV Community

Gaurav Narasimhan
Gaurav Narasimhan

Posted on Originally published at agentair.ai

Evidence, not confidence

Coding agents report success in the same fluent voice whether or not they succeeded. The fix is to separate the claim from the proof, and to put the proof where the agent can't write it.

Every coding agent I use writes a good summary. It's clear, well organized and confident. It reads exactly the same when the work is done and when it isn't.

That's not dishonesty. The agent reports what it believes, and what it believes is shaped by what it checked. If it ran three of the four relevant tests, its summary describes a world where three tests are all there is. The last post said a loop needs a check. This one is about what makes a check worth trusting.

The rule: separate the claim from the proof

A claim is what the agent says: "fixed", "deployed", "all tests pass". A proof is an artifact that would be different if the claim were false: a test log, a commit hash reported by the running service, a version number read off the installed app.

The rule behind everything in this post is one sentence:

The rule

The proof has to come from somewhere other than the agent's own report. If the only evidence that work is done is the agent saying so, it isn't evidence.

That rules out a surprising amount. "I verified it works" is a claim. "I ran the tests" is a claim. A pasted test output from this session's worktree, with the command that produced it, is starting to be proof. A pipeline that refuses to continue until a health endpoint reports the expected commit is proof the agent can't fake, because the agent doesn't write that endpoint's answer.

Five places agent work over-claims

Across many sessions, the gaps between "done" and done cluster in five places. Each has a gate that catches it.

Where 'done' isn't done, and what catches it

  1. GAP 1 · The test it didn't run The agent runs the tests it thinks are relevant. 'Relevant' is a guess. The landing script runs the full suite inside the worktree, and nothing reaches live until it's green.
  2. GAP 2 · The environment it didn't check Work passes on the branch it was written on, against a live that has since moved. Landing rebases onto current live first, then tests again, inside the worktree.
  3. GAP 3 · The deploy it assumed 'Shipped' often means 'merged'. A merge isn't a deploy. Kargo verifies every promotion: the image signature, and a health endpoint that must report the same commit that passed staging.
  4. GAP 4 · The number it estimated Agents produce plausible numbers from memory: prices, sizes, counts. A plausible number is often wrong. Any price is looked up live, with its region and date, before it's quoted.
  5. GAP 5 · The step it skipped Long procedures get summarized. A ten-step session close becomes seven steps and a confident report. Skills run in full, and the close ends with a self-audit that counts what was done.

lit = this gap · tap a box · ← → or Play · Interactive version in the original post

1 · The test it didn't run

An agent asked to fix a bug runs the test for that bug. It usually doesn't run the test for the code that calls the code it changed, because it doesn't know that test exists, or thinks it's unrelated. Its report ("tests pass") is true for the tests it ran.

The gate is to take the choice away. Work in this workspace lands through a script that rebases the unit onto live inside its worktree, runs the full suite there, and only then squashes and merges. The agent can say whatever it likes about which tests matter. The landing doesn't ask.

2 · The environment it didn't check

A change can be correct against the code it was written on and wrong against the code it lands on, because another session changed something in between. With several sessions running at once that's not rare; it's a normal Tuesday.

The same landing script handles this by order of operations: rebase first, test second. The test result that counts is the one against today's live, not the one from when the agent started.

3 · The deploy it assumed

"Shipped to production" is the claim I trust least, because there are so many steps between a merge and a running service where something can quietly not happen. A build can fail. A promotion can be pending. A pod can still be running the old image.

The gate here is the strongest in the workspace, because the proof comes from production itself. Every service reports the commit it was built from on its health endpoint. Kargo won't mark a promotion verified until the image signature checks out and that endpoint reports the expected commit. Production is a promotion of the exact image that passed staging, verified again. When the ship script says "prod health sha = staging", that's not the agent's opinion. It's two services answering the same question the same way.

4 · The number it estimated

Agents are good at producing numbers that sound right: what an instance costs, how many files a folder has, how long a job takes. Many of them are remembered rather than measured, and memory drifts.

The rule is blunt: a price is looked up live, with its region, before it's quoted, and a count is counted. This series follows the same rule: a figure names where it came from (git refs, the Linear API, the CI system's records, Kargo's records) and says plainly where a number is softer than it looks.

5 · The step it skipped

The quietest over-claim is in long procedures. A session-close ritual has many steps: commit, write the handoff, check that notes stay under their size limit, lift any rule that lives only in notes, and so on. Asked to run it, an agent will sometimes run most of it and report the whole.

Two rules catch this. Skills run in full: there are no optional steps. And the procedure ends with a self-audit that lists every step and whether it was done, with the score counted rather than estimated. A skipped step shows up as a line in the audit, not as an absence nobody notices.

Evidence you can't write yourself

The gates above have one thing in common. In each, the proof comes from a source the agent doesn't control:

Claim Who produces the proof
tests pass the landing script, running the full suite
works against current code the same script, after the rebase
deployed the running service's health endpoint, checked by Kargo
installed the app on the Mac, reporting its version
this costs $X the provider's live price list
procedure complete the self-audit's line-by-line count

That's the design principle. Don't ask the agent to be more careful in its report. Arrange things so that the report isn't the evidence.

What this doesn't catch

Gates check what they're told to check. A full suite with a missing test still passes. A health endpoint proves the right code is running, not that the code is right. Evidence narrows the gap between "done" and done; it doesn't close it. The remaining gap is what review, and the next post's procedures, are for.

The cost of the gates

None of this is free. The full suite takes longer than the one relevant test. Verified promotions take minutes, not seconds. Self-audits make the close ritual longer.

In practice the cost is small and the trade is lopsided. In one busy 48-hour stretch, measured from the CI system's records, the median CI build took 1.4 minutes and the median merge-to-production 7.9. Against that, every false "done" the gates catch is a bug that doesn't reach production, a regression nobody has to find the next morning, and a report I can act on without re-checking. With several agents working at once, I can't re-check everything. The gates are what let me not have to.

What to take from this

  • An agent's report is a claim. Treat it as one.
  • For every claim that matters, find a proof the agent can't write: a test run by the landing script, a commit reported by the running service, a price from the live list.
  • Put the gates where the claims are made: before landing, before promotion, at the end of every procedure.
  • Count, don't estimate, and say plainly where a number is soft.

The last post in the series is about what happens after the evidence: how a lesson learned in one session becomes a procedure every agent can follow, and how the same procedure can teach a person.

Links


Originally published at https://agentair.ai/blog/evidence-not-confidence.

Top comments (0)