AI · MLOps · Engineering
Shipping AI Features Without Breaking Production: Evals, Guardrails and Rollouts
An LLM feature that demos well can still fail quietly in production. Here's the release checklist we use to ship AI features with confidence.
· 2 min read · By george
Traditional software fails loudly: an exception, a 500, a red test. LLM features fail quietly. The response looks fluent and confident, and it's wrong. That changes how you have to test and release them.
Here's the checklist we work through before an AI feature reaches real users.
1. Write evals before you write prompts
An eval is a test suite for model behaviour: a set of inputs plus a way to judge the outputs. Start with 50–100 examples drawn from real usage, including the awkward ones.
Judge outputs with the cheapest method that works:
- Exact or programmatic checks: valid JSON, the right category, a number in range.
- Reference comparisons: does the answer contain the key facts from a known-good answer?
- Model-graded rubrics: a second model scores against written criteria. It's useful for tone and helpfulness, but spot-check it against human judgement.
Run the suite on every prompt or model change, exactly like unit tests. A prompt tweak that fixes one case often breaks three others, and without evals you won't see it.
2. Constrain the output
The less freedom the model has, the less can go wrong.
- Ask for structured output (JSON matching a schema) and validate it. Retry or fall back on failure.
- Keep the model's job narrow: classify, extract, summarise, draft. Let ordinary code make the decisions that matter.
- Never let model output flow directly into SQL, shell commands or HTML without the same validation you'd apply to user input.
3. Add guardrails on both sides
Input guardrails catch prompt injection attempts, off-topic requests and personal data that shouldn't be sent to a third-party API. Output guardrails check for policy violations, leaked system prompts, or claims the feature isn't allowed to make (medical, legal, financial).
Guardrails don't need to be clever to be valuable. A keyword list and a schema check stop a surprising amount.
4. Design for the failure case
Assume some responses will be bad, and make that cheap for the user:
- Show sources so people can verify.
- Make AI output a draft the user approves, not an action taken on their behalf.
- Provide a one-click way to flag a bad answer, and pipe those flags straight into your eval set.
5. Roll out gradually
Ship behind a feature flag. Start with internal users, then 5% of traffic, then more, watching:
| Signal | Why it matters |
|---|---|
| Error and fallback rate | Schema failures, timeouts, refusals |
| Latency (p95) | LLM calls are slow; users notice |
| Cost per request | Token usage scales with traffic |
| User flags / thumbs-down | The closest proxy for quality |
6. Pin versions and log everything
Pin the exact model version, and log prompts, responses and eval scores (with personal data redacted). When the provider ships a new model, you'll want to rerun your evals and compare like-for-like before switching.
None of this is exotic. It's the discipline of normal software delivery (tests, validation, staged rollouts, monitoring) applied to a component that's probabilistic instead of deterministic.
Comments
Loading comments…