AI coding agents have become very good at answering one question:

What should I do next?

They can inspect a codebase, form a hypothesis, make a change, run tests, read the failure, repair the code, and continue.

That is impressive.

It also creates a new engineering problem:

When should they stop verifying?

This sounds trivial until you let an agent work on a real repository for an hour.

A small change can start like this:

Fix the retry condition.

→ run the targeted unit test
→ run the module tests
→ run the full test suite
→ check lint
→ check types
→ add another edge-case test
→ inspect an unrelated warning
→ fix that warning
→ rerun everything

Every individual step is defensible.

The problem is the sequence.

Nothing in the loop says:

This is enough evidence for this task.

So the agent keeps buying more confidence with more work.

That is why I think AI coding agents need a verification budget.

Software verification has no natural endpoint.

After a unit test passes, you can run the package tests.

After those pass, you can run the whole repository.

Then integration tests.

Then another platform.

Then another runtime version.

Then inspect coverage.

Then add another test for an edge case you just imagined.

There is almost always one more thing you could verify.

Human engineers handle this through judgment.

We implicitly ask:

  • How risky is this change?
  • What can it break?
  • Which checks give useful evidence?
  • What level of confidence is appropriate here?
  • Is another hour of testing actually worth it?

Coding agents do not naturally have the same stopping instinct.

They are rewarded for being thorough.

So when the instruction is simply:

Make sure the change works.

“Make sure” can become an unbounded search.

More verification is not always more engineering

This distinction matters.

Suppose an agent changes one condition inside an isolated parser.

A reasonable verification plan might be:

1. Run the parser's targeted tests.
2. Run the relevant type check.

Both pass.

At this point, running every integration test in a large monorepo might increase confidence slightly.

But it also has costs:

  • more tokens;
  • more wall-clock time;
  • more logs to interpret;
  • more unrelated failures;
  • more opportunities to expand the task;
  • more chances for the agent to “fix” something it was never asked to touch.

Verification itself can cause scope creep.

This is one of the stranger properties of autonomous coding:

An agent can leave the implementation scope while trying to prove that the implementation is correct.

A pre-existing failure appears.

The agent investigates it.

It discovers an old configuration issue.

Then it fixes that.

Now another test is affected.

The original two-line task has turned into a repository cleanup.

At no point did the agent make an obviously irrational decision.

The overall process was still wrong.

A verification budget is not just a command limit

When I say “verification budget,” I do not mean:

You may run exactly four commands.

That is too crude.

A useful verification budget has three parts:

1. A planned set of checks

Before verification begins, decide what evidence is appropriate for the requested change.

For example:

Required:
- targeted unit test
- type check for the affected package

Optional only if evidence justifies it:
- package test suite

The important part is that verification starts from a plan instead of an open-ended instruction to “test thoroughly.”

2. A limit on automatic expansion

The agent should not widen verification simply because more verification is possible.

There should be a reason.

Good reasons include:

  • the current check exposed a new affected dependency;
  • the implementation changed more surface area than planned;
  • a failure suggests the bug crosses a module boundary;
  • previously valid evidence became stale after another code change.

A bad reason is:

We still have time, so let’s run more tests for confidence.

Unused budget is not a reason to consume the budget.

3. A stopping rule

This is the part most agent workflows are missing.

The system needs a state in which it can say:

The planned evidence is complete.
No new risk has been discovered.
Stop verifying.

Without an explicit stopping rule, “be thorough” wins forever.

Failure should not automatically buy more budget

Failures make the problem harder.

Imagine this loop:

run test
↓
failure
↓
change code
↓
run test
↓
failure
↓
change code
↓
run more tests
↓
investigate another module
↓
change more code

The agent is technically making progress.

But after several iterations, it may no longer be solving the original task.

A better rule is:

A failure gives the agent evidence, not unlimited permission.

For example:

1. Run the planned check.
2. If it fails because of the current change, inspect the relevant diagnostic.
3. Make one targeted repair.
4. Re-run the failed check.
5. If the same failure repeats beyond a small threshold, stop and surface the evidence.

That last step is important.

Stopping is not failure.

Sometimes stopping is the correct engineering action.

The agent has learned something new:

The current plan is insufficient.

That should trigger a decision, not an infinite loop.

Verification should be tied to the current code

There is another subtle issue.

Suppose an agent runs:

unit test ✓
type check ✓

Then changes a shared dependency.

Can it still claim both checks passed?

Not necessarily.

Verification is evidence about a particular state of the repository.

Change the state, and some evidence becomes stale.

So a good agent workflow should treat verification results roughly like this:

repository state R1
    ↓
test A passed
test B passed

code changes → R2

test A may still be valid
test B may now be invalid

The goal is not to rerun everything after every edit.

The goal is to know which evidence still applies.

That is a much better use of verification budget.

The real problem is not that agents test too much

“Agents run too many tests” is only the surface symptom.

The deeper problem is that most coding agents are optimized around:

What should I do next?

But autonomous engineering also requires another set of questions:

How far am I allowed to go?

How much evidence is enough?

What would justify doing more?

When should I stop and ask for a decision?

Those are control questions, not reasoning questions.

The model may be perfectly capable of choosing the next technically sensible action.

That does not mean the action is still sensible for the task as a whole.

This distinction becomes increasingly important as coding agents get stronger.

A weak agent fails because it cannot solve the problem.

A strong agent can fail differently:

It keeps finding reasonable things to do.

A practical policy

The verification policy I now prefer looks roughly like this:

Before implementation

Define:
- acceptance criteria
- expected files
- initial verification plan
- verification limit

Then:

After implementation

Run only the planned checks.

If a check fails:

Is the failure caused by this task?

Yes
→ inspect the relevant evidence
→ make a targeted repair
→ rerun the affected check

No / pre-existing
→ record it
→ do not expand the task automatically

If the agent wants another check:

What specific uncertainty does this check resolve?

If there is no concrete answer, do not run it.

If verification repeatedly fails:

Stop.
Preserve the evidence.
Ask for a decision or revise the plan.

This is intentionally boring.

That is the point.

Good engineering control is often boring.

This is a budget, not a ceiling on quality

A verification budget should never mean:

Stop even though the code is obviously broken because we used all four commands.

The budget controls automatic work, not correctness.

When the planned budget is no longer sufficient, the right transition is:

continue automatically
        ↓
      STOP
        ↓
explain why more verification is needed
        ↓
approve / revise / investigate

The important thing is that the expansion becomes visible.

The agent does not silently turn a small task into a large one.

Why this matters more as models improve

It is tempting to assume better reasoning models will solve this problem automatically.

I think the opposite is likely.

As models improve, they become better at finding:

  • another possible edge case;
  • another architectural concern;
  • another test worth running;
  • another nearby inconsistency;
  • another “small improvement.”

Each suggestion can be locally correct.

That makes boundaries more important, not less.

The future of coding agents is probably not:

Give the model perfect instructions so it never considers unnecessary work.

It is closer to:

Let the model reason freely, but make the boundaries around its actions explicit.

Reasoning can stay flexible.

Execution needs constraints.

Where TaskBelay fits

This idea is one of the reasons I built TaskBelay.

It does not try to tell Codex, Claude Code, DeepSeek, or another coding agent how to solve the engineering problem.

The agent still reads the code, chooses a technical approach, edits files, and decides what action makes sense next.

TaskBelay keeps the task around those decisions explicit:

  • Explicit Scope — what may change;
  • Bounded Verification — how much verification is planned and why it may expand;
  • Durable State — what state and evidence are authoritative;
  • Safe Recovery — what to do when an operation fails or its result is uncertain.

The distinction I keep coming back to is:

The coding agent decides what to do next.
The surrounding system should decide how far that decision is allowed to grow.

For long-running AI coding, verification should not be an infinite search for confidence.

It should be a planned, bounded engineering activity.