Package 03 · Hardening

LLM in production: make it reliable, affordable and safe.

Your LLM is live. It also fails in ways nobody can measure, costs more every month, or keeps getting stopped by security review. This page covers how production LLM systems fail, the fix for each failure, and how our Hardening package applies those fixes to your system.

Part of our AI consulting packages. Priced per scope, agreed before work starts.

What changes once an LLM is in production.

Before launch, an LLM feature is judged on a handful of examples someone picked. In production it meets thousands of inputs nobody picked, from users who don't read the instructions and, sometimes, from people actively trying to break it.

Production LLM systems also fail differently from ordinary software. The same input can produce a different output. The model can change without a code change, because the provider updated or retired it. Cost scales with tokens, not users. And a quality drop rarely throws an error: it shows up weeks later as complaints, churn or a bad answer in front of the wrong customer.

That is why the fixes below all start from the same place: measuring the system on your own production cases, so every later change can be proven better or worse rather than argued about.

How production LLM systems fail, and the fix for each.

Seven failure modes. Most live systems have two or three of them at once.

Quality regresses and nobody notices

What you see
A prompt tweak or a new model version fixes one complaint and quietly breaks three other cases. Users notice before the team does.
Why it happens
Without an evaluation set built from real cases, there is nothing to compare a change against, so every release is a guess.
The fix
A regression suite built from your logs and known failures, scored automatically, with quality gates in CI that block a release which makes things worse.
LLM Evaluation

The provider changes the model under you

What you see
Outputs shift after a provider update, or a model you depend on is scheduled for retirement and the replacement behaves differently.
Why it happens
The system was tuned against one model's behaviour, and nobody can say what a switch would break.
The fix
Candidate models scored on your own cases, a shadow run against live traffic, and a rollback path before anything switches.
AI Model Migration

Retrieval quietly gets worse

What you see
The RAG system starts citing the wrong document or misses answers it used to find, especially on your own terminology.
Why it happens
The corpus has grown and changed, chunking no longer fits it, and a general-purpose embedding model doesn't understand your domain's language.
The fix
Retrieval measured on its own, separately from generation, then fixed: chunking, ranking, and where it pays off, an embedding model fine-tuned on your data.
Embedding Model Fine-Tuning

Cost grows faster than usage

What you see
The monthly LLM bill rises faster than active users, and nobody can say which feature or request type is driving it.
Why it happens
Long contexts, retries, agent loops and the largest model used for every request. Cost was never measured per request or per feature.
The fix
Cost and quality measured per feature, then routing, caching and, where quality holds on your evaluation set, a fine-tuned or distilled smaller model.
Model Distillation

Inputs turn hostile

What you see
A user, a document or a web page gets the model to ignore its instructions, reveal data, or call a tool it shouldn't.
Why it happens
The system trusts whatever text reaches the model, and tools run with broader permissions than the task needs.
The fix
Adversarial testing of the live system, fixes for every finding, least-privilege tool permissions, and a retest to prove the fix holds.
AI Red Teaming

Agents loop or act without approval

What you see
An agent repeats the same step, burns tokens, or takes an action with real consequences that nobody approved.
Why it happens
No limits on steps or spend, state that isn't persisted properly, and no human approval step for high-impact actions.
The fix
Step and budget limits, durable state, scoped tool permissions, and human-in-the-loop approval where an action can't be undone.
Agentic AI Development

Nobody can explain what the system did

What you see
A customer, auditor or regulator asks why the system gave an answer or took an action, and there is no record that answers it.
Why it happens
Decisions, inputs, model versions and approvals were never logged in a form anyone can review.
The fix
Audit logs, approval workflows and runtime enforcement of your AI policies, so the evidence exists before anyone asks for it.
AI Governance

How we harden an LLM in production.

Five steps, in this order, because each one depends on the measurement from the one before.

  1. 01

    Baseline on your own cases

    We build an evaluation set from your production logs, incident history and the failures your users already reported, then measure today's quality, cost per request and security exposure against it. Every later change is judged on this baseline.

  2. 02

    Put quality gates in CI

    The evaluation set becomes a regression suite that runs automatically on every prompt, model or code change. A release that makes agreed metrics worse doesn't ship.

  3. 03

    Attack it, then fix it

    We red-team the live system with the attacks that fit its exposure: prompt injection, data leakage, tool misuse. Each finding is fixed and retested.

  4. 04

    Cut cost without losing quality

    We measure cost per feature, then apply routing, caching, context reduction and, where it holds up on your evaluation set, a smaller fine-tuned or distilled model.

  5. 05

    Govern it and hand it over

    Approvals, audit logs and runtime enforcement go in, then documentation and a walkthrough so your team keeps the gates running without us.

What you leave with.

  • Before-and-after measurements of quality, cost and security on your own evaluation set
  • A regression suite and quality gates in CI that catch regressions before release
  • Red-team findings, fixed and retested
  • Cost per feature, and the changes that brought it down
  • Audit logs, approvals and runtime enforcement for your AI policies
  • Documentation, runbooks and a handover so your team owns all of it

What we need from you.

  • Production logs and incident history
  • Cost and usage data
  • Any security findings or review feedback you have already received
  • An engineer who owns the system and can take it over

Done when

The agreed reliability, cost or security targets are met on your own evaluation set, and your team has taken over the gates.

LLM in production checklist.

Ten questions to ask about any LLM system that is already live. Every 'no' is a place it can fail without warning.

  1. Do you have an evaluation set built from real production cases, not just a demo set?
  2. Does every prompt, model or code change run against it automatically before release?
  3. Could you switch model or provider next month and know what would break?
  4. Do you know the cost per request and per feature, not just the monthly bill?
  5. Is retrieval quality measured separately from answer quality?
  6. Has the live system been tested against prompt injection and data leakage?
  7. Do tools and agents run with the least privilege their task needs?
  8. Do agents have step and spend limits, and human approval for irreversible actions?
  9. Can you show who approved what, and which model version produced an answer?
  10. Could someone other than the original builder deploy and roll back the system from documentation?

LLM in production: common questions.

Find out which of the seven your system has.

Tell us what's live and what's going wrong. In 30 minutes we'll tell you which failure modes you're likely facing and what fixing them would cover.

Talk to an AI Engineer(opens scheduling widget)30 minutes · No slide deck · No sales pitch

NDA available · Scoped engagements · No surprise fees

We use analytics cookies to understand how visitors use the site. No ads or retargeting. Learn more