Most LLM code fails the second it hits production. Ask a model for an API client or a migration script, and you get pristine code for a world where nothing breaks. Network drops? Pools exhaust? The model wraps everything in a generic catch block that swallows the stack trace and logs a cheerful message.
This isn't a bug. It's training bias. Public code repos lean heavily toward happy paths and toy tutorials. When an LLM predicts the next token, it's incentivized to write clean-looking code instead of resilient code.
Stop treating AI like a junior dev who needs better prompts. Treat it like a literal macro processor. If you don't constrain failure modes explicitly, you ship silent bugs.
Take a standard prompt asking for a remote data fetch. You get this in Python:
import requests def get_user_profile(user_id): response = requests.get(f"https://api.example.com/users/{user_id}") return response.json() This assumes the network never drops, 504 timeouts don't exist, and responses are always valid JSON. If the server drops mid-stream, requests.get throws. If it returns an HTML error page, response.json crashes with a decode error. Your app hangs.
Production output requires shifting prompt engineering from what the code should do to what it's forbidden from ignoring. Enforce defensive boundaries upfront. Tell the model to handle timeouts, rate limits, and malformed payloads explicitly. That changes the token probability distribution.
Try this prompt structure instead: Write a Python function to fetch a user profile. You must explicitly catch connection timeouts, handle HTTP status codes other than 200, and validate that the response payload matches the expected schema before returning. Do not use generic exception catching. Every failure mode must be surfaced or wrapped in a domain-specific error.
The output changes completely. You get explicit error propagation, timeout params, and defensive type checks. The code is longer and uglier. That verbosity is the price of admission for real software.
As generation speeds up, code review bottlenecks shift. We aren't bottlenecked by typing speed anymore. We're bottlenecked by catching silent failure modes in generated code before it hits pipelines. Teams building strict automated linters and type checkers to police AI output pull ahead. Teams relying on human eyes to spot missing try-catch blocks spend maintenance windows debugging ghostly outages.

