Writing · 2026-11-27
Five Ways an Unreviewed AI Architecture Breaks in Production
AI projects rarely fail at the demo. The demo works. They fail three or six months later, when the agent has more tools, more users and more data than anyone planned for, and nobody ever sat down and reviewed the architecture as a whole.
That is going to get more common, not less. Agent tooling moved fast this year. Google added a /swarm mode to Antigravity, where a coordinator model hands work to parallel agents. The MCP spec moved to a stateless core with stricter auth in July. It has never been easier to wire a model to real systems. It is just as easy to wire it in a way that breaks quietly.
Here are the five failure modes I would look for first in any AI architecture review, and what to check for each.
1. Cost that grows faster than usage
Agent loops usually re-send the whole conversation on every step: the system prompt, the tool definitions and every tool result so far. That makes input tokens grow roughly with the square of the number of steps, not in a straight line.
I worked it out with a small script. Assume a 2,000-token system prompt plus tools, and 1,500 tokens of tool output added per step. Here is the total input the model reads across a whole run:
| Steps | Full history re-sent | Avg per step | Last 4 results + summary | Saving |
|---|---|---|---|---|
| 5 | 32,500 | 6,500 | 32,500 | 0% |
| 10 | 102,500 | 10,250 | 80,000 | 22% |
| 20 | 355,000 | 17,750 | 175,000 | 51% |
| 40 | 1,310,000 | 32,750 | 365,000 | 72% |
Going from 20 steps to 40 doesn't double the tokens. It multiplies them by about 3.7. A task that cost cents in testing can cost dollars per run once real users ask harder questions.
What to check: a hard cap on steps per task, a context policy (windowing or summarising old tool output), and cost per task tracked as a metric, not just monthly spend.
S, T, WINDOW = 2_000, 1_500, 4 # system prompt, tokens per tool result, results kept
def full_history(n):
return sum(S + k * T for k in range(1, n + 1))
def windowed(n):
return sum(S + min(k, WINDOW) * T + (T if k > WINDOW else 0) for k in range(1, n + 1))
for n in (5, 10, 20, 40):
print(n, full_history(n), windowed(n))
These are assumptions, not a benchmark. Plug in your own numbers. The shape of the curve is the point. The script is in production-ai-notes.
2. Tools with more power than the task needs
OWASP's Top 10 for LLM applications calls this "excessive agency": giving an agent tools or permissions it doesn't need. In a lot of agent setups, one set of credentials can read, write and delete, because that was the quickest thing to wire up.
What to check: separate read and write tools, scoped credentials per tool, and a human approval step for anything irreversible (payments, deletes, outbound email). Approval should be a state in the workflow with an audit record, not a checkbox in the UI.
3. Retries that do the work twice
Queues deliver messages more than once. Webhooks get replayed. Agents retry failed tool calls. Without idempotency, a retry means a second CRM update, a second email or a second charge.
When I built a meeting-to-CRM pipeline, handling duplicate webhooks was part of the design from the start. The fix is boring and it works: idempotency keys, deduplication on receive and replay-safe recovery.
What to check: can every write step run twice safely? If nobody can answer that quickly, it can't.
4. No way to tell when answers get worse
Prompts change, models get upgraded and documents go stale. Without an evaluation set, quality drifts and the first signal is a customer complaint.
What to check: a fixed set of representative questions, including ones the system should refuse. Run it on every prompt or model change. Measure the false-refusal rate as well as accuracy, because tightening one usually moves the other.
5. Tail latency nobody planned for
Parallel agents feel fast in a demo. In production, a coordinator that waits for every worker finishes when the slowest one does. In a simulation I ran with 10 parallel workers, the median wait was about 2.5 times a single worker's, and 80% of runs had at least one worker slower than 15 seconds. (simulation code)
What to check: per-tool and per-worker timeouts, a fallback answer, and p95 latency as an explicit target, not just the average.
Why a review, and why early
None of these are exotic. They are the ordinary data, permissions and reliability problems of any distributed system, showing up again around a model. The difference is that AI systems hide them well: the output still looks fluent while the cost, the risk or the error rate climbs.
A review before scaling is cheap. Usually it's a few days to map the data flow, the failure modes, the security boundaries, the eval plan and the cost per task. Rebuilding after an incident is not cheap, especially when the agent has already written to production systems.
If you only do one thing this quarter: pick your most-used AI workflow and write down its worst-case cost per task, what it can change without a human, and how you'd know if its answers got worse last week. If any of the three is "not sure", that's where to start.
Sources: Google Antigravity /swarm (InfoWorld), MCP 2026-07-28 spec (Anthropic), OWASP Top 10 for LLM Applications.
Also on DEV, Hashnode and Medium. More case studies at abuzar18.github.io.