5 Defenses Against Code Hallucinations (and Why Only 3 Work)

Last week I wrote about how my AI invented a complete JSON structure and wrapped it in DTOs, fixtures, and passing tests. 90 green tests. All fiction. That post was the diagnosis. This is the treatment. After discovering the disaster, I did what any engineer with wounded pride does: obsessively research for days to prevent it from happening again. I read papers, tried tools, analyzed real data from my APIs, and built a defense system for my app. ...

February 16, 2026 · Fernando

Silent failure: when your AI makes stuff up and tests say everything's fine

Yesterday I discovered that half of a module in my app was based on fabricated data. Not by a confused junior developer. By my AI. The worst part isn’t that it made things up. The worst part is that everything compiled and all 90 tests passed. The coherent fiction I’m building BFClaude-9000, a macOS menu bar app that monitors Claude Max quota. Part of the functionality requires distinguishing whether a Claude account is paid or free by calling the claude.ai API. ...

February 13, 2026 · Fernando

When Your AI Becomes Your Worst Enemy

Yesterday my AI sent 44 emails. The problem is that the content was fabricated. I’m not kidding. I had files with detailed feedback for each recipient, carefully generated. The task was simple: read each file and send it. Instead, the AI decided to “summarize” the content to “go faster.” It invented facts. It told one person they were missing docstrings when their code was perfectly documented. To top it off, four of those emails went to people who hadn’t even submitted anything. ...

February 6, 2026 · Fernando