Writing

Your AI System Has Technical Debt. It’s Just Not Where You’re Looking.

If changing three sentences can change how your product makes decisions, those sentences are part of your production system - and they can accumulate technical debt too.

By Sagi Chizik7 min read

ai · engineering · technical debt

A clean, minimal house standing on a hidden foundation of loose, taped-together paper notes, one small sheet at the bottom holding up everything

Technical debt used to be relatively easy to recognize.

Messy code, duplicated logic, an abstraction that should never have survived the prototype, or a database column called status2 that everyone is afraid to rename. You might not fix it. You might even build a respectable career around carefully avoiding it. But at least you knew where the bodies were buried.

Then AI came along and decided the bodies should be stored in plain English.

The Assistant Who Forgot the Customer

I've worked with conversational systems and AI long enough to know that a convincing conversation and a working product are two very different things.

Still, occasionally a bug demonstrates the distinction so elegantly that you almost feel obliged to thank it.

One recent example came from an AI assistant I was building for my personal website. Its job was straightforward: understand why someone came, answer useful questions, help them explore whether I could contribute, and, when there was a good reason to talk, make that connection happen.

Essentially, a friendly digital colleague who knows what I do and doesn't require a salary, an office, or an annual performance review.

During testing, it had a genuinely good conversation with a visitor. It understood what they were trying to accomplish, asked sensible questions, recognized that we should probably speak, and successfully convinced them to get in touch.

Excellent. The assistant had done its job.

Except it hadn't.

It forgot to collect their contact details.

The visitor was ready to talk. The assistant was delighted. I had absolutely no idea who to contact.

The AI succeeded. The product failed.

A fairly accurate summary of a surprising amount of AI software right now.

The interesting part wasn't that an AI assistant had made a mistake. That's hardly breaking news. It was how easily a perfectly reasonable conversational behavior could miss a critical business requirement.

The failure lived in the increasingly complicated layer surrounding language models: instructions, examples, retrieved documents, tool descriptions, business rules, and assumptions that quietly influence what happens next.

We tend to call much of this prompting, which makes it sound like something you do before asking a computer to draw a cat wearing sunglasses.

But when changing three sentences can change how your product makes decisions, those sentences are part of your production system.

Congratulations. You've found another place to accumulate technical debt.

Four Thousand Words of Institutional Panic

The process is painfully familiar.

An AI conversation goes wrong, so someone adds an instruction. Another one fails, so they add an exception. Then an example. Then another instruction explaining when the exception applies, followed by a clarification to prevent the model from enthusiastically applying the clarification to absolutely everything.

Before long, there's a 4,000-word system prompt that looks suspiciously like a legal contract drafted by several committees who have never met.

Somewhere inside it are 600 words that genuinely matter. Nobody is entirely sure which ones.

“We have invented global mutable state in English.”

Change something in one place, and behavior changes somewhere completely unrelated. Two instructions interact unexpectedly. An old example conflicts with a new rule. The model follows the words, just not necessarily the ones you intended.

Eventually, the team reaches that ancient and highly respected engineering principle:

Don't fucking touch it.

Prompt length isn't inherently the problem. Long, structured instructions can be perfectly reasonable. The trouble starts when important behavior depends on undocumented interactions between instructions, examples, external knowledge, and whatever context happens to arrive that day.

We've seen this movie before. Last time, it involved shared mutable state, hidden dependencies, and a developer explaining that nobody should restart the server on Thursdays.

Give the AI Everything. What Could Go Wrong?

The problem gets even more interesting when agents are connected to company knowledge.

Suddenly, they have access to documentation, previous conversations, internal notes, retrieved search results, tool descriptions, and dynamically generated state. We give them more information because more information should produce better answers.

Sometimes it does.

Other times, we've handed them four contradictory versions of reality and asked them to pick one confidently.

Imagine sales believes one thing about the product, engineering believes another, the official documentation describes something from two releases ago, and the actual answer is buried in a Slack conversation between two people currently on vacation.

Human organizations somehow survive this. We ask around, remember who actually knows, and develop complicated informal systems for separating official information from reality. Every company eventually acquires at least one person who functions as an undocumented distributed database.

Then we connect an AI agent to everything.

Wonderful. We've automated the confusion.

A small robot surrounded by four sources - a sales chart, an engineering gear, a document and a chat bubble - each pointing at it. It cheerfully holds up one shape while the other three lie ignored at its feet.
Four sources, four versions of reality. The robot picks one with impressive confidence.

RAG, or retrieval-augmented generation, helps models retrieve relevant information. It doesn't magically establish which source is correct. A beautifully retrieved contradiction is still a contradiction.

Sometimes the most valuable result of introducing AI isn't that it answers everyone's questions. It's discovering that nobody in the organization agrees on the answers in the first place.

Useful information, even if it makes the next management meeting significantly less pleasant.

When English Becomes Business Logic

One of the recurring challenges in conversational products is translating business intentions into behavior that survives contact with real users.

Consider a rule from my website assistant:

Ask a discovery question only if the answer would materially change whether I should talk to this person.

It's written in English, but its responsibility is architectural. It controls when the product asks for information and, just as importantly, when it should leave the visitor alone.

An assistant that asks twenty technically relevant questions before letting someone contact me isn't intelligent. It's a government application form with access to a language model.

We spent decades moving business logic out of vague specifications and into increasingly precise programming languages. Now we're deliberately putting some of it back into English.

Apparently we missed meetings.

And there are good reasons to do that. Natural language can express nuanced behavior that would otherwise require a forest of special cases. The challenge isn't that we're using English. It's that we're sometimes treating executable business decisions as though they were merely editorial content.

If a sentence influences a business decision, it deserves an owner, a purpose, and a way to verify its behavior.

For the website assistant, a good conversation wasn't enough. The tests also needed to verify the outcome: Did it ask an unnecessary question? Did it invent a capability? Did it recognize when someone wanted to talk? Did it collect the information needed for a useful handoff?

That last one would have been particularly helpful.

With agents, the stakes extend beyond conversation. A wrong answer is irritating. A wrong action can modify records, send messages, make purchases, or trigger a chain of otherwise perfectly functioning tools.

And a more capable model doesn't automatically solve this.

It might simply follow a bad instruction more effectively, travel much further with a mistaken assumption, and produce a beautifully formatted explanation of why everything went according to plan.

We used to call this a bug.

Now it has bullet points.

The Boring Engineering Lessons Nobody Escapes

After years of engineering software, I'm not particularly surprised that AI systems need versioning, tests, boundaries, ownership, and observability. What interests me is how many teams seem tempted to treat the language-model layer as an exception.

Important instructions should be versioned. Behaviors should have regression tests. Knowledge sources need ownership and some notion of authority. Model upgrades deserve testing because the same instructions can produce different behavior. Agents need clear boundaries around what they can read, decide, and change.

And when something goes wrong, we need evidence of what context the model received, what it decided, and which tools it used. Otherwise debugging becomes an expensive exercise in asking the AI why it did something and hoping its explanation is accurate.

None of this makes language models deterministic. Tests don't guarantee that every future conversation will behave correctly, and observability won't make ambiguous requirements disappear.

But engineering discipline gives us a fighting chance of detecting failures before they reach a customer or, in my case, leave a perfectly happy visitor waiting for a call from someone who doesn't know their name.

For all the dramatic predictions about AI changing software engineering forever, a remarkable amount of the practical work involves applying lessons we've already learned to systems that are much less predictable.

The code may now be the cleanest part of the system.

Somewhere, a team is staring at a 6,000-word system prompt containing years of accumulated wisdom, emergency fixes, contradictory instructions, and at least one rule written specifically because an AI once tried to do something nobody imagined it would attempt.

Nobody knows exactly why it works. Nobody remembers who wrote half of it. And nobody wants to be responsible for the next edit.

So eventually, someone adds the only documentation everyone understands:

// DO NOT TOUCH

And just like that, the future has arrived.

← More writing