Note
Where do production AI agents fail between systems?
Production AI Agents Fail at the Seams
Notes from hardening LLM workflows: provider semantics, queues, logs, prompts and evaluation matter as much as the model.
Note
Where do production AI agents fail between systems?
Notes from hardening LLM workflows: provider semantics, queues, logs, prompts and evaluation matter as much as the model.
Most AI agent demos are built around a clean loop: user input, model reasoning, tool call, answer. That loop matters, but it is not where production systems spend most of their time failing.
In production, the agent sits between systems with their own rules. The model may produce a valid instruction while the provider rejects the message, the queue retries a job, the external state changes, the customer replies in a different channel, or the operator needs to understand why the automation made a decision three hours ago.
That is where the real engineering work starts.
A demo can assume a stable world. A production workflow cannot.
The model sees a prompt and a tool schema. The product sees users, providers, databases, queues, dashboards, rate limits, compliance constraints and support teams. Between those layers there are seams, and every seam needs a contract.
For an AI agent, a seam is any place where intent becomes an effect:
If those boundaries are loose, the agent may look intelligent while the system around it becomes hard to operate.
The most expensive failures are often not dramatic model mistakes. They are small mismatches between layers.
Tool schemas accept too much ambiguity. The model sends a shape that is technically valid but semantically unclear. The backend accepts it, and now the workflow has to infer intent from a weak contract.
Retries duplicate effects. A queue retries after a timeout, but the external provider already accepted the first request. Without idempotency, the system can repeat work that should have happened once.
Provider states do not map cleanly to product states. A message can be accepted, queued, delivered, blocked, expired or rejected. Collapsing those into a single "failed" state makes support faster for the engineer and slower for everyone else.
Logs explain the stack, but not the decision. A trace that says a function ran successfully is useful. A trace that explains why the agent selected a path, what guardrails were evaluated and what fallback was available is much more useful when a workflow needs audit.
An agent is not only a prompt. It is also an operating model.
That means the system should expose enough structure for humans to intervene without reading raw model output. Status labels should be precise. Errors should be actionable. Retries should be visible. Guardrails should leave evidence.
For production AI work, I usually care about five questions before I care about prompt polish:
Those questions are less exciting than model selection, but they decide whether the automation survives real traffic.
I try to keep the contracts small and explicit.
Tool calls should have narrow inputs and boring names. External effects should have idempotency keys. Provider responses should map to product states without losing important detail. Logs should capture decisions, not just exceptions. Fallbacks should be chosen by failure type, not by a generic catch block.
The model still matters. Better reasoning, better latency and lower cost all matter. But the model is only one component in a system that has to be observed, debugged, audited and changed by people.
The strongest AI systems I have worked on did not become reliable because every answer was perfect. They became reliable because the seams were designed as carefully as the prompt.