All insights
AI Agents

Why AI Agents Work in Demos but Fail in Production

AI agent demos optimise for the happy path. Production exposes ambiguity, permissions, changing systems, bad data, latency, cost, and accountability.

An AI agent leaving a controlled demo platform and entering a complex production network

A demo proves capability, not reliability

A demo usually has a clean input, a cooperative tool, a known outcome, and an engineer ready to intervene. Production replaces those assumptions with customers who describe the same need in twenty ways, APIs that time out, records that disagree, and actions that may be irreversible. A model can reason well and still be attached to an unsafe process.

The decisive question is not whether the agent can complete the task once. It is whether the whole system can complete the right task repeatedly, at an acceptable cost, while detecting uncertainty and recovering safely. That changes the work from prompt design to product engineering and operations.

Illustrative production readiness by control area

Demo task accuracy
88/100
Integration resilience
52/100
Permission design
44/100
Observability
37/100
Recovery readiness
31/100

The failure modes that appear after launch

First, the objective is underspecified. The agent optimises the literal instruction while missing the business constraint. Second, tool contracts are brittle: a renamed field or unexpected null changes the outcome. Third, permissions are too broad, so a small reasoning error becomes a large business event. Fourth, teams test outputs but not sequences; each step looks plausible even though the combined plan is wrong.

Then operations take over. Long tasks hit timeouts. Retries duplicate payments or tickets. Costs climb because the agent loops. Nobody can reconstruct why a decision was made. A human approval step exists, but arrives without enough context to make a sound decision. These are system failures around the model, and a model upgrade alone rarely repairs them.

Demo assumptionProduction realityRequired control
Known inputsMessy and adversarial inputsValidation and confidence thresholds
Tools always respondLatency, schema drift, partial failureTyped adapters, timeouts, idempotency
Harmless test actionsFinancial and customer impactLeast privilege and approval gates
Engineer watches runUnattended executionTracing, alerts, replay and rollback
Accuracy is successBusiness outcome is successOutcome metrics and error budgets

Design the production system around bounded autonomy

Start with one narrow workflow and write its authority envelope: what the agent may read, what it may propose, what it may execute, and what always needs approval. Give every external action an idempotency key. Validate tool inputs and outputs against schemas. Put hard limits on spend, runtime, retries, and the number of records affected.

Build an evaluation set from real edge cases before launch, then keep adding failures from production. Log the user request, retrieved evidence, model and prompt version, tool calls, approvals, result, latency, and cost under one trace ID. Define a safe degraded mode when a model or system is unavailable. Finally, assign a product owner who can stop the agent and an operational owner who responds when it fails.

A production-hardening sequence

  1. 01

    Write the task contract

    Define accepted inputs, required evidence, success, safe refusal, escalation, and forbidden outcomes for each task class.

  2. 02

    Build a representative evaluation set

    Include normal work, rare exceptions, conflicting records, malicious instructions, missing permissions, timeouts, and partial failures.

  3. 03

    Constrain tools and transactions

    Use typed adapters, least-privilege identities, preview modes, spend and record limits, idempotency keys, and reconciliation.

  4. 04

    Instrument the whole run

    Link request, retrieval, model version, decisions, tool calls, approvals, cost, latency, and business outcome under one trace.

  5. 05

    Release authority gradually

    Move from shadow to recommendation, approved action, and bounded autonomy only when the evidence for that task category passes.

Evaluate the system you operate, not the model in isolation

Create separate measures for task selection, evidence quality, tool argument validity, policy compliance, action correctness, and final business outcome. A single accuracy score hides where controls are failing. Segment results by workflow variant, customer type, data source, language, and consequence so a strong average cannot conceal a dangerous weak group.

Run the evaluation whenever the model, prompt, retrieval index, tool schema, policy, or workflow changes. Add every material production incident and meaningful human correction to the regression set. Use an error budget for autonomous actions: when the rate or severity crosses the agreed threshold, automatically reduce authority or return to approval mode.

Go-live evidence checklist

  • Named business and technical owners
  • Versioned evaluation set with documented thresholds
  • Least-privilege tool credentials and tested approval gates
  • Idempotency, rollback, reconciliation, and safe degraded mode
  • Dashboards, alerts, runbook, incident contacts, and kill switch

Frequently asked questions

Why does an AI agent work in testing but not production?

Testing usually covers controlled examples. Production adds ambiguous inputs, changing data, external-system failures, security boundaries, concurrency, latency, cost, and real consequences.

Is hallucination the main reason AI agents fail?

It is one reason, but many failures come from integration design, excessive permissions, weak evaluation, duplicated actions, missing observability, and unclear ownership.

What should we monitor first?

Monitor task outcome, tool-call errors, human overrides, retry loops, latency, cost per completed task, permission denials, and the share of runs that safely escalate.

Start with clarity

Turn the idea into a responsible next move.

Bring the context, constraint, and stakes. We’ll help clarify the most useful next decision.

Book a 30-minute fit call No generic pitch. No obligation.