How to make an AI coding agent prove its work with tests

Last updated: November 16, 2026

An AI coding agent will tell you a task is done. Whether it is done is a different question: the agent may not have run the tests, may have run them on an older version of the code, or may have tested something you did not ask for. This page describes a method that works with any agent and any test framework, and then shows how AvowGate does the bookkeeping for you.

The rule

A task only counts as done when every behavior you asked for has a named test with a passing result for the exact commit, and anything no test can judge has been signed off by a person. The rest of this page is how to make that rule easy to follow.

The method in five steps

  1. Write each request as a commitment. One sentence that is either true or false, such as "a signed-out visitor who opens the account page is sent to sign-in". Avoid wording like "works well".
  2. Name the test for each commitment. Use the exact name of the real test. A commitment with no test stays open, and an open commitment is visible rather than forgotten.
  3. Write the tests before the code. Ask the agent to show them failing first. A test that never failed may not be testing anything.
  4. Record real results for the commit. Run the tests, then record pass or fail by test name against the short commit id. Results from an older commit do not count for the new one.
  5. Ask for the verdict before you accept the work. The answer is pass or blocked, with reasons. If it is blocked, the task is not done, however confident the agent sounds.

What only a person can decide

Some commitments cannot be machine-tested: whether a screen is clear, whether a message reads well, whether a live system behaves. Mark these as needing a human sign-off. The agent may say what it checked, but it may not sign off its own work; the sign-off belongs to a named person.

Doing it by hand

You can start today with a file in your repository that lists each commitment, the test that proves it, and the commit where it last passed. Tell the agent to update the file and to quote the real test output. It works, but it depends on everyone remembering to keep it current, and a pass for one commit is easy to mistake for a pass on the next.

Doing it with AvowGate

AvowGate keeps that list for you. The agent connects over MCP and works in this order:

  1. at_task_start: record what you asked for before any code is written.
  2. at_commitment: write one testable commitment for each behavior.
  3. at_create_test and at_link_spec_test: register each test by its exact name and link it to its commitment.
  4. at_report_results: report the real results for the short commit id.
  5. at_check_gate: ask for the verdict before telling you anything is done.
  6. at_task_close: this only succeeds when the gate passes.

The agent can add and strengthen requirements and report results. It cannot sign off a risk, dismiss a finding or retire a test; a person does those and the record carries their name. The exact connection steps are on the page for agents and in the guide. Sign-up is open and a read-only live demo is on the home page.

Common ways this goes wrong

Questions and answers

Why does an AI coding agent say it is done when it is not?

An agent is rewarded for finishing, and nothing in a chat stops it from saying so. It may not have run the tests, may have run them on an older version of the code, or may have tested something other than what you asked for. The fix is a rule outside the chat: done only counts when every requested behavior has a named test with a passing result for the exact commit.

What is the simplest way to make an agent prove its work?

Write each thing you asked for as one sentence that is either true or false, name the test that shows it, have the agent run the tests and record the real result for the commit, and ask for the verdict before you accept the work. A checklist file in the repository is enough to start.

What about behavior that no test can show?

Some things only a person can judge, such as whether a screen is clear or a message reads well. Mark those as needing a human sign-off, and do not let the agent mark them as done. The sign-off belongs to a named person, not to the agent.

How does AvowGate help with this?

AvowGate keeps the list of commitments, links each to the tests that prove it, stores the test results per commit, and answers pass or blocked with reasons. An agent connects over MCP and cannot close a task while the gate is blocked.