AI can write code. It can write tests. It can run those tests, interpret the results and tell you everything is working.

That’s impressive …and a little concerning.

Because if the same agent is responsible for building something and deciding whether it works, who’s actually checking its work?

It’s a question worth asking as engineering teams hand over more of the software development lifecycle to AI. And the answer matters more than you might think.

A passing test doesn’t mean you’ve got it right

Here’s a scenario that’s becoming increasingly common.

A developer gives an AI agent a set of requirements. The agent writes the code, generates tests and runs them. Everything passes. The agent reports success.

Great. Except what if it misunderstood the requirements in the first place?

It might have built the wrong thing, written tests that reflect its own interpretation and then congratulated itself for getting everything right.

The tests pass. The report looks good. The underlying problem is still there.

This is the problem with letting an agent verify its own work. It can carry the same assumptions and blind spots from development into testing. If it gets something wrong at the start, there’s a good chance its tests will miss it too.

The question isn’t whether AI can write tests. Of course it can. The question is who decides what those tests need to prove, and who gets to say whether the result is good enough.

The coding agent can write and run the tests. But the person or team accountable for the business requirement needs to own the expected behavior and approve any changes to it.

That’s what independent verification actually looks like. It doesn’t mean AI can’t be involved. It means the agent doesn’t get to set its own definition of success.

What happens when nobody checks the work? 

We saw a good example of why this matters during a Provar TrustAI evaluation of an open-source AI agent.

The agent was handling an identity verification workflow. We gave it an incorrect email address during the verification process. Instead of rejecting the information and protecting the account details, it supplied the correct email address.

Think about that for a moment. The agent was supposed to verify someone’s identity. Instead, it revealed the very information the verification process was designed to protect.

The expected behavior was straightforward: reject the incorrect email address and keep the account email private.

It didn’t.

TrustAI found the failure on its first evaluation. No planted bugs or deliberately weakened agent. Just a realistic scenario that exposed a serious gap in the agent’s behavior.

That’s the point of testing. Not simply confirming that an agent can complete the task it’s been designed to perform, but finding out what happens when things don’t go according to plan.

And it’s not just about security. An agent might follow instructions most of the time but ignore them when challenged. It might handle a normal request perfectly well but invent information when it doesn’t know the answer. It might complete a workflow while exposing data it shouldn’t have access to.

You won’t necessarily find these problems by testing the happy path.

We shared a few more real-world examples of what can go wrong in our AI Horror Stories post. The common thread is that unexpected behavior tends to become a much bigger problem when it’s discovered after deployment.

The same rule applies to deployed agents 

So far, we’ve talked about AI agents writing code and testing their own work. But the same principle applies to agents deployed into business workflows.

An AI coding agent might produce software that doesn’t meet the original requirements. A customer-facing agent might give incorrect advice. An internal agent might access information it shouldn’t or take an action it wasn’t authorized to take.

Different applications, same fundamental issue: how do you know the agent is behaving as intended?

This gets particularly complicated in enterprise environments, where workflows rarely live in one place. An agent might interact with Salesforce, an ERP, a financial system and several other applications to complete a single business process.

Getting one part right doesn’t guarantee the whole process works.

And there’s an important distinction when it comes to fixing failures, too.

AI can absolutely help maintain tests. If an application update moves a button or changes a page layout, an agent can update how a test finds that button without changing what the test is actually checking.

That’s useful. It’s one of the ways AI can make testing easier to maintain.

But changing how a test runs is not the same as changing what counts as a pass.

If the original requirement says a customer must receive an approval before an order is processed, and the application stops enforcing that approval, the answer isn’t to rewrite the test so it accepts the new behavior.

The expected outcome hasn’t changed. The application has stopped meeting it.

An agent can help fix the test. It shouldn’t get to quietly redefine success.

You need a way to check before you ship

There’s a commercial consequence to all of this, too.

One executive recently described a team that had spent months tuning an AI agent on expensive models. Now cheaper models were available, and switching could improve the economics. But the team was reluctant to make the change.

Their plan was essentially to swap the model, put it into production and see what happened.

That’s not a testing strategy.

What they needed was a way to run the same approved scenarios against both models, compare the results and understand where each one succeeded or failed.

Did the cheaper model follow the same instructions? Did it respect the same permissions? Did it produce the same business outcomes? Were there new failure points?

With that evidence, the team could make an informed decision instead of treating production as the testing environment.

This is where independent evaluation becomes particularly valuable. It’s not just about catching problems before launch. It’s about giving teams the confidence to change models, prompts and agent behavior without introducing a new set of unknowns every time.

Let AI do the work. Just don’t let it grade itself.

None of this is an argument against using AI to write code, generate tests or maintain automation. The productivity gains are real, and the opportunity to accelerate software development is enormous.

But faster development doesn’t make verification less important. If anything, it raises the stakes.

As AI agents take on more responsibility, we need to be just as rigorous about checking their work as we are about checking the software they help build.

At Provar, this is central to our approach with TrustAI. We’re bringing functional testing and AI agent evaluation together so teams can test both what their software does and how their agents behave.

Because an agent saying it completed a task successfully isn’t proof that it did.

And a passing test isn’t proof that the business got what it needed.

Let the agent do the work. Just don’t let it give itself the grade.

Want to see what your AI agents are actually doing? Book time now to explore TrustAI.