You Can't Fix A Bug With A Prompt: Why AI Code Lacks Finality
As code shifts from deterministic to interpreted prompts, bug fixes are no longer permanent solutions but mere wishes.

Stock photo for illustration only, not from the actual event
- Traditional code runs deterministically, whereas AI agents and prompts rely on dynamic interpretations.
- Instructing AI with rules like TDD often treats them as mere suggestions rather than strict constraints.
- Frequent background model updates by LLM providers introduce hidden changes and unpredictable behaviors.
Fixing bugs is a fundamental part of software engineering. The golden rule taught by seasoned developers to ensure a bug never returns is simple: write an automated test for it. While minor fixes might occasionally bypass this luxury, the underlying assumption has always been that code remains constant until modified by a human or a bot. Every statement executes and every exception is caught in the exact same deterministic way every single time.
However, modern programming has introduced prompts, agents, and workflows that do not execute identically on every run. Instead, they operate based on their interpretation of a given request. While they execute deterministic tools when invoked, sub-agents rely on layers of interpretations based on previous interpretations. These probabilistic behaviors work reliably until they suddenly do not, exposing the fragility of AI-generated workflows.
"bug fixes in prompts are not real bug fixes. They are more like wishes. Which may or may not come true."
Gil Zilberfeld
This challenge became apparent when Gil Zilberfeld attempted to teach his agent to develop using TDD, establishing a strict rule not to generate any code without a matching test. Assuming the LLM inherently understood TDD, he discovered instead that the model treated the rule merely as a suggestion, following it or ignoring it depending on its current state. To enforce proper behavior, part of his solution required implementing a deterministic targeted coverage tool to halt the process immediately if extra code was detected.
The fundamental shift highlighted here is the transition from programmed logic to interpreted behavior. Traditional software engineering relies on strict determinism where inputs yield predictable, repeatable outputs. In contrast, generative AI introduces non-deterministic mechanics, meaning software quality assurance can no longer rely solely on static checks. Developers must adapt to managing shifting probabilities rather than static syntax errors.
The core issue is that an increasing volume of software is interpreted rather than explicitly programmed, making bugs flaky and virtually impossible to fix permanently. Compounding this challenge, LLM providers frequently alter model capabilities behind the scenes without explicit notification. Ultimately, attempting to fix bugs through prompts alone yields no permanent security, functioning more like wishful thinking than engineering. This article was written by Gil Zilberfeld, an expert in API testing and test automation.
Source: Dev.to
Found something wrong in this article? Report an issue with this article
Comments
Leave a Comment