My AI agent quietly built a second drawing engine. I caught it by accident

I build mostly with AI agents these days. This week I asked for a small change to annotations and the diff came back way too big for what I asked, so I asked why.

The answer, word for word:


"You're right, and it's my fault — I wrote a second drawing engine instead of using the one that exists. Let me check what it takes to mount the real one."


We already had a drawing engine. It wrote another one instead of reading the code around it.

The extra code is whatever. What worries me is that I only caught it because I know what the app contains. Someone vibecoding their first product ships both engines and never finds out.

Curious how other makers handle this. Do you review every diff, or do you have a rule that forces the agent to check what exists before it creates?

34 views

Add a comment

Replies

Best

Review every diff is the wrong question, because you already know the answer is no. What worked for us is making the agent list what it read before it writes anything, and rejecting the diff if that list is empty or doesn't include the module it just reinvented. Writing a second drawing engine requires having read nothing, so it's a cheap check that catches exactly this. The scarier version isn't the duplicate, it's a duplicate with slightly different behaviour, because six weeks later both are load bearing and neither one is wrong.