When your AI feature gets it wrong: an incident playbook for LLM features
What to do when an AI feature gives a harmful, embarrassing or costly answer in production: containing it, finding out what happened, judging how widespread it is, telling customers and making sure it stays fixed.
Sooner or later, an AI feature will do something you didn’t want. It tells a customer the wrong refund policy, leaks a detail it shouldn’t have, writes something offensive or quietly runs up a large bill. Someone posts a screenshot, and your team has to work out what happened, fast.
AI incidents are different from normal outages. The system is usually up and responding. It’s just responding badly, and it may not do the same thing twice. Here’s the playbook we’d have ready before the first one.
Prepare before anything goes wrong
Most of what makes an incident manageable has to exist beforehand.
- Log enough to reproduce a response: the input, retrieved context, prompt version, model, settings and output, with an ID you can find from a customer report. Apply your normal retention and privacy rules. See keeping customer data safe in LLM features.
- Have a kill switch and a fallback, so you can turn the feature off or limit it without a deploy. Our post on rolling out AI features safely covers how.
- Decide who is on point for AI issues and who approves turning a feature off, so nobody waits for permission.
- Give users a way to report a bad answer that links to the exact response. See collecting user feedback on AI features.
Contain it first
When a report comes in, limit the damage before you understand it fully.
- Judge the severity quickly. Wrong but harmless is different from data exposure, harmful advice or actions taken on someone’s behalf.
- Turn off or narrow the feature if the problem could repeat for other users. Restricting it to drafts or to internal users is often enough.
- Stop irreversible actions such as sending messages, issuing refunds or changing records, while you investigate.
- Check spend if the issue involves loops, retries or unusual usage.
Find out what happened
- Pull the logged request and look at exactly what the model saw, not just what it said.
- Try to reproduce it with the same inputs, prompt version and model. If it happens only sometimes, run it several times.
- Look for the real cause. Common ones include a recent prompt or model change, bad or missing retrieved context, instructions hidden in user content and a missing check in code. Our post on prompt injection for startups covers the last two.
- Check what changed recently across prompts, models, data and code. Versioned prompts make this much easier. See writing system prompts for production.
Work out how widespread it is
One screenshot rarely means one occurrence.
- Search your logs for similar inputs and outputs over the affected period.
- Identify affected customers and what they saw or what was done for them.
- Check stored outputs, such as summaries or extracted data saved to records, which may need correcting.
Tell people clearly
- Tell affected customers directly what happened, what it means for them and what you’ve done, in plain language.
- Don’t blame “the AI”. Customers bought your product, and the feature is your responsibility.
- Involve legal or compliance early if personal data, financial advice or regulated decisions are involved.
Fix it so it stays fixed
- Fix the cause, not just the example. Prefer a check in code over another prompt rule where you can.
- Add the case to your test set, with variations, so the same failure is caught before release. We cover how in test your LLM feature before users do.
- Turn the feature back on gradually and watch closely.
- Write a short, blameless review: what happened, how it was found, what helped and what you’ll change.
The short checklist
- Log enough to reproduce any response, and keep a kill switch ready
- Contain first: narrow the feature and stop irreversible actions
- Reproduce from logs and find the real cause
- Search for other affected customers and stored outputs
- Tell customers plainly and own the mistake
- Fix in code where possible, add tests and review what happened
If you want an AI feature that’s ready for its first bad day, see our fixed-scope offers or book a 30-minute call.