
Understanding and Preventing Hallucinations in AI Chatbots
What are hallucinations in AI, why do they happen, and how can you avoid them? Learn how to keep your AI chatbot answers accurate with practical, human-centered...
ChatGPT drifts, hallucinates figures and breaks house style on regulated compliance notes. Here is the prompt-hardening and stateless-agent method that made a UK Responsible Gambling workflow audit-ready — with model testing across 9 models and 27 runs.
A UK Responsible Gambling (RG) team came to us with a problem that anyone automating regulated work will recognise. They use ChatGPT to turn automated compliance triggers into formal analyst notes. When a customer breaches a threshold — turnover up more than 100% in 30 days, a session running past its limit — an analyst copies the relevant data into ChatGPT, and the model, following a pre-uploaded prompt, drafts a note for the customer’s compliance file.
That note is not a draft email. It is a legal document reviewable by the UK Gambling Commission. And after a while, ChatGPT started to hallucinate figures, miss key information, insert em dashes that broke house style, and quietly drift away from the rules by the afternoon. On a regulated file, each of those is a compliance issue.
The question they asked was simple: can we get the consistency regulated work requires from a language model at all? The answer is yes — but not by tweaking the wording of a prompt inside a chat window. It takes a change in architecture plus a disciplined rewrite. This article walks through the exact method, using the RG workflow as the worked example, so you can apply it to any regulated process where the same input must produce the same trustworthy output every single time.
Before fixing anything, it helps to name the failure modes precisely. On the RG workflow we reproduced five distinct ways the output broke, ranging from critical to merely annoying.
The two critical ones are the dangerous pair. Hallucinated figures put a wrong deposit or profit-and-loss number on a regulated file — the model fills a gap from training memory rather than admitting the data is absent. Convention reversal is subtler: this operator uses an inverted profit-and-loss convention where a positive number means the customer is losing. It is counterintuitive, so the model reverts to the standard convention it learned in training and writes that a customer is losing when they are actually winning.
The high-severity issues — em dashes that violate house style, and session drift where rules are ignored later in the day — do not put a wrong number on file, but they erode trust in the output and create rework. The medium issue, informal intervention names instead of the exact regulatory terms, quietly corrupts the compliance record.
Four of those five failures share one root cause. In a single ChatGPT session, every case you review is appended to the context window. Review case one and the model sees the prompt and one case. By case fifteen it sees the prompt plus the statistical residue of fourteen previous exchanges. The prompt’s rules are still there, but they are competing with a growing pile of context, and attention to them decays.
This is why the same prompt produces a perfect note at 9am and a flawed one at 4pm. The architectural fix is statelessness: every case must be a completely fresh, isolated call that sees only the locked prompt and the current case. Nothing carries over. An AI agent configured this way gives the prompt the same attention on case fifty as it did on case one.
Statelessness is necessary but not sufficient. It stops the drift, but it will faithfully reproduce a bad prompt on every call. So the prompt itself has to be hardened.
Language models do not weight every line of a prompt equally. Attention is roughly U-shaped — strongest at the beginning and the end, weakest in the middle. The original RG prompt fought this. Its most important rule, the inverted profit-and-loss convention, sat in the middle of the prompt, stated once. The em dash ban was the very last line, also stated once.
The rewrite moved the critical rules to where the model actually looks and reworked the weak parts of the system prompt . Here is what changed and why.
| Original | Hardened v2.0 | Why it matters |
|---|---|---|
| P/L rule buried mid-prompt, stated once | Rule 1 at the very top with a self-check step, repeated in the writing-style section | Primacy weighting — the most important rule must come first |
| Em dash ban at the very end, once | Rule 2 at the top, repeated as the final rule at the bottom | Catches both primacy and recency weighting |
| No instruction for incomplete input | Rule 4 — missing-data protocol with an exact response format | Eliminates hallucination and creates an audit trail |
| No instruction for input format | Rule 3 — accept any format, always rewrite from scratch | Stops the model from lightly reformatting a pasted note |
| 19 required fields, all equal weight | 15 required + 4 optional fields, clearly separated | Optional fields omit silently; required fields block generation if absent |
| “Professional. Natural. Not robotic.” | Concrete rules: connective language, varied sentence length, forbidden constructions | Vague adjectives are not followed; concrete rules are |
| Example note included | Example removed entirely | The model treated the example as input to respond to |
The single biggest lesson here: vague adjectives are not instructions. Telling a model to be “natural” actively encouraged the em dashes and rhetorical flourishes that broke house style. Replacing that with concrete, testable rules is what made the style consistent.
Hallucination is often framed as a model defect. On structured work it is usually a prompt defect: the prompt never told the model what to do when a field is absent, so it did the statistically likely thing and produced a plausible value.
The fix is a missing-data protocol. Split your fields into required and optional. Optional fields are omitted silently when absent. Required fields do the opposite — if one is missing, the model must stop and request it in an exact format rather than generate a note. That single rule converts a silent hallucination into a visible, auditable prompt for more data. It is the difference between a wrong figure on a regulated file and a note that was never produced because the input was incomplete.
With a hardened prompt, the agent itself has to be locked down so nothing reintroduces variability. The whole flow is deliberately minimal — three nodes and nothing else.
The configuration choices that mattered:
Every fix above is undone by one bad habit: reusing the same chat. The most important operational rule for the analyst team is to start a new conversation for every single case. Never continue reviewing cases in the same window. This is the rule that eliminates session drift — the root cause of most of the original failures — and it costs nothing to follow.
If your team is fighting a drifting prompt inside a chat window, the fix is a hardened prompt running on a stateless agent. FlowHunt lets you lock the prompt, pin the model and temperature, and run a clean call per case. Let us help you get there.
A method is only as good as its evidence. We tested nine models against the hardened prompt, using an identical real case (a Gambling Intensity trigger with prior session-duration history) across three runs each — 27 runs in total — and scored every run against 16 compliance criteria.
Across all 27 runs, no production-ready model hallucinated a figure, reversed the P/L convention, used an em dash, or truncated output. The hardened prompt eliminated every one of the original failure modes on the models that qualified. The differences that remained were about analytical depth and consistency, not correctness.
| Model | Vendor | Avg score | Production | Notes |
|---|---|---|---|---|
| GPT-5.6 Luna | OpenAI | 10 / 10 | Yes | Perfect on all three runs; highest consistency |
| Claude Fable 5 | Anthropic | 10 / 10 | Yes | Most reasoned outcome paragraphs; best single note |
| Claude Sonnet 5 | Anthropic | 9.8 / 10 | Yes | No hallucination on any run; best all-round Claude |
| Claude Opus 4.8 | Anthropic | 9.8 / 10 | Yes | Deepest analysis; premium cost |
| GPT-5.4 Default | OpenAI | 9.5 / 10 | Yes | One naming slip; best budget option |
| Claude Sonnet 4.6 | Anthropic | 8.7 / 10 | No | Confused the trigger threshold with the deposit limit in 2/3 runs |
| Claude Haiku 4.5 | Anthropic | 8.5 / 10 | No | Consistent but weak outcome rationale |
| Cheapest tier | Budget | 8.0 / 10 | No | Exact intervention name in only 1/3 runs |
| DeepSeek V4 Pro | DeepSeek | 7.8 / 10 | No | Truncated output on run 1; inconsistent |
The disqualifications are instructive. Claude Sonnet 4.6 produced beautiful prose but confused the trigger threshold with the deposit limit — a factually wrong figure on a regulated file, which is disqualifying regardless of how well it reads. DeepSeek’s run-to-run swing (6, 8.5, 9) is the real problem: in regulated work, quality that depends on luck is not quality at all.
It is tempting to optimise for price, but the numbers make the case against it. Even the most expensive production-ready model, Claude Opus 4.8, costs roughly six cents per note. For a team reviewing 50 cases a day, that is under $90 a month. The cost of a single regulatory finding from an incorrect note would dwarf the annual cost of any model on the list. For regulated compliance, choose the most reliable model you can, not the cheapest.
The best single note across all 27 runs came from Claude Fable 5. Notice what it does: it states the position in the correct convention, quotes figures verbatim, uses the exact intervention name, and — critically — explains why escalation would be disproportionate rather than simply stating an outcome.
The customer is currently in a winning position of £1,612.50 with an account balance of £8,962.50, which represents an improvement on the winning position of £1,275.00 recorded at the previous review… Session duration was reviewed under Session Duration Level 1 on 19/07 and again on 20/07… Given that those decisions were made within the last few days, insufficient time has elapsed to assess their effectiveness, and repeating or escalating on the same behaviour at this stage would be disproportionate… In this context, No Further Action Required is the proportionate outcome.
That is the standard regulated work demands: evidence-based, proportionate, and identical in quality on the first case of the day and the fiftieth.
The RG note generator is a specific case, but the method generalises to any process where a language model must produce trustworthy, repeatable output on regulated or high-stakes data:
Do those five things and you convert a model that hallucinates by the afternoon into one that produces audit-ready output every time. The consistency regulated work requires is achievable — it is an architecture and prompt-engineering problem, and both are solvable.
Arshia is an AI Workflow Engineer at FlowHunt. With a background in computer science and a passion for AI, he specializes in creating efficient workflows that integrate AI tools into everyday tasks, enhancing productivity and creativity.

Turn a drifting ChatGPT prompt into a locked, stateless agent that produces audit-ready notes every time. We will help you harden the prompt and pick the right model.

What are hallucinations in AI, why do they happen, and how can you avoid them? Learn how to keep your AI chatbot answers accurate with practical, human-centered...

Discover how OpenAI's latest research identifies why language models hallucinate and produce confident falsehoods. Learn the root causes and practical solutions...

Jailbreaking AI chatbots bypasses safety guardrails to make the model behave outside its intended boundaries. Learn the most common techniques — DAN, role-play,...
Cookie Consent
We use cookies to enhance your browsing experience and analyze our traffic. See our privacy policy.