Skip to main content
All editions

Beyond the Abstraction

What Was the Last Failure You Turned Into a Test?

Bruno Valente e Costa · · 4 min read

For a couple months I have been training an AI agent that helps me with sales, and it finally works the way I do. What it still lacks, and what I suspect most agents inside companies lack too, is a test proving that last month's correction still holds.

It reads and updates our CRM, loading the records I would otherwise type in myself. It searches our content repository when I need a past answer or a reference. In the morning it summarizes my calendar, and it books meetings on my behalf. It tells me which emails are still waiting for my reply, and for the technical and operational questions it writes a draft that I review before anything is sent.

None of that worked on day one. I trained it the way you train a junior, one point at a time, and it kept each correction in its memory as one of my personal rules. Only after months of that can I say I have an assistant shaped to my own reality rather than to an average user's.

Every Rule Is a Failure

Read that memory and you are reading a list of mistakes. Each rule exists because the agent did something I had to tell it to undo. One of the early ones came from an invitation it drafted in my voice, polished and ready to send, that described me as working in a field I only knew through client requests. The rule now says it must never give me a role I do not have.

The memory is a record of corrections, and nothing ever runs it again. At the start of November I rejected a step it wanted to add to a colleague's weekly routine, a check that would have cost more than the mistake it was meant to prevent. I explained why. A week later, reviewing the next batch, it proposed the same check again.

A rule in memory works like a note on the fridge, and a regression test is the thing that would have caught that repeat before I did.

The Textbook Answer

On a previous edition, a reader who builds AI into software products answered a version of this question, and the answer was the textbook one. Start with hand-written cases for the common tasks and the edge cases. Add cases from actual failures. Use masked production examples where the data policy allows, and recreate the failure with synthetic data where it does not.

It is a good answer, so I asked the obvious follow-up: what was the last real failure you turned into a test case? That question is still open, and for my own agent I could not have answered it well either.

Where the Failures Live

My agent learned on production. Its training data was my real inbox, my real CRM and my real calendar, and that worked because the data is mine and so is the risk. A company putting agents in front of customers cannot train them that way, and its data policy will say so before anyone asks.

So the evaluation set gets built from what is left. Hand-written cases are tidy and test what someone already imagined; in October I called them the newest generation of fake test data. Synthetic recreations rebuild a failure you already understood. The failures you have not understood yet sit in production, with real people's names in them.

Masking those names is where most teams stop, and masking a name does not make a record anonymous while the date of birth, the postcode and the order history are still there. The test cases that matter most are the hardest ones to take out of production.

The test cases that matter most are the hardest ones to take out of production.

Test What It Did

The same reader made one point I agree with completely: a good final answer can hide a bad tool call. For my assistant, the outputs that matter most are actions, a record written to the CRM or a meeting booked in my name, and a polished draft says nothing about either.

A test case for an agent therefore needs the data it acted on, the action it took and the state of each system afterwards. That means production-shaped data in an environment where the agent is allowed to be wrong, which low-code teams have been short of for years, and agents will need more of it than applications ever did.

Why I Care

At Infosistema we build DMM, which moves and anonymizes data between low-code environments, so I read every answer about agent evaluation looking for where the data comes from. My own agent is a personal assistant, one person's tools and one person's data, but a company-scale agent deployment would have to be different.

Your Turn

When did your team last turn a real agent failure into a test case: this month, this year, or never?

Bruno