To change a chatbot's system prompt safely, version it and A/B test it like code: save every edit as a numbered version, try it on a test copy of the bot, A/B test it against the current version on real replies, then release it and keep the old version one click away.
Key takeaways
- Never edit the prompt customers are talking to. Edit a test copy, then release.
- Write down what each version changes and what you expect it to fix. That note is your experiment log.
- An A/B test is only as good as its sample. At 100 replies per version, a 10-point gap can still be noise.
- Pick one measure per test, decided before it starts: a judge's criteria, thumbs up, error-free replies, guardrail passes or speed.
- Automated prompt fixes are worth having only if they prove themselves on replayed conversations and still wait for a release.
What is prompt versioning, and why does a system prompt need it?
Prompt versioning means saving every edit to a prompt as a numbered version with a note, so you can compare, restore and explain any change. A system prompt is one of the most-edited parts of an AI assistant, and often one of the least controlled. One person tightens the refund wording, another adds a line about opening hours, and a week later nobody can say which edit made the bot start refusing simple questions.
This is an old problem with a known answer. Google's Site Reliability Engineering book (published 2016, about Google's own production services) says that "roughly 70% of outages are due to changes in a live system", and lists progressive rollouts, fast detection and safe rollback as the response (checked November 2026). Prompt edits are changes to a live system too. OpenAI's evaluation best practices make the same point for prompts: evaluate early and often, on data that looks like real traffic (checked November 2026).
In practice that means four things:
| Habit | Without it | With it |
|---|---|---|
| Every edit is a version | "Who changed this, and when?" | A numbered history with notes |
| Edits land on a test copy first | Customers see half-finished wording | Customers see only released text |
| Changes are compared on replies | Decisions by gut feel | Decisions by a measure you picked |
| Rollback is one action | Rewrite the old text from memory | Put the previous version or release back |
The rest of this post walks through each step with a worked example, using Rylvo Prompts as the concrete tool. The habits apply to any stack.
Step 1: Structure the prompt so changes stay small
Small, isolated edits are easier to test and to undo. Three structural tools help.
Placeholders. Put values that change in one place. Instead of writing the refund limit into five sentences, write it once as a placeholder:
You are the assistant for {{company_name}}.
Refunds: offer a refund up to {{refund_limit}} without asking a manager.
Above {{refund_limit}}, take the order number and say a person will reply within one business day.
In Rylvo, the model sees the value you set. If a placeholder has no value, the model sees [refund_limit] and the editor warns you. A bot fills {{bot_name}} and {{company_name}} itself.
Inheritance. Keep shared rules (tone, legal lines, escalation) in a parent prompt and write {{parent}} where its text belongs. The parent has to be active, and a chain stops after 5 levels. One fix to the parent then reaches every child.
Kinds. Rylvo keeps nine prompt kinds, but only three reach the model: System (role, persona and rules), Response composer (how answers are written) and Custom (sent after the main instructions under "Additional instructions"). The six older kinds are kept for reference and marked "Not sent to the model", so you are never editing text that has no effect.
Prompt limits by plan: Free 3, Starter 10, Lite 50, Pro no fixed cap, Enterprise no fixed cap.
Step 2: Save every edit as a version, with a reason
A version without a note is half as useful. Write one line for each save: what changed and the behavior you expect.
A worked example. A dental clinic's assistant keeps telling patients to "call the clinic" for anything about insurance, even when the answer is on the website. The version note:
v7: Insurance questions: answer from the knowledge base first; send to the front desk only if the plan is not listed. Expect fewer "call us" replies on insurance.
In Rylvo, saving makes a new numbered version and puts it in use in Test, the copy of the bot customers do not see. An edit you have not saved stays with the browser tab, so switching pages does not lose it. The Versions tab labels how each version was made (edited by hand, changed by the Architect, over MCP or through the API, or found by self-improvement), lets you filter by that, and shows any two versions side by side or line by line. Rollback is covered in Step 5.
Each reply's trace in Observability records the prompt versions it used, so when a customer gets a strange answer you can see exactly which text produced it. The post Why did my chatbot say that? walks through that trace step by step.
Step 3: How do you test a prompt change before customers see it?
Try the wording on its own first, then run your saved test cases, before the change meets a real customer. Rylvo's Try it tab fills in your placeholder values, sends the prompt and a test message to the model the bot uses, and shows the reply, the token use and the exact instructions the model received. It runs without the bot's knowledge, tools, skills or inherited parent text, spends the plan's included AI replies (or your own key if you added one), and saves nothing, so it tests the wording alone.
For a fuller check, run the bot's saved test cases in Tests against the new version. A test suite catches a version that fixes insurance answers but breaks booking answers. The post How to test an AI chatbot before launch covers what to put in that suite.
Step 4: How to A/B test a chatbot prompt on real replies
A playground shows that a version can answer well. An A/B test shows whether it answers better, more often, on the questions customers actually ask.
Set up the test
- Pick A and B. A is usually the version in use; B is the change you want to prove. Write what B changes and what you expect.
- Pick one measure. Rylvo offers five:
| Measure | What a reply scores | Good for | Watch out |
|---|---|---|---|
| Your own criteria (AI judge) | An AI judge decides if the reply meets criteria you write | Specific behavior, such as "answers insurance from the knowledge base" | On Lite, Pro and Enterprise; only judged replies count |
| Customer thumbs up / down | Share of rated replies with a thumbs up | Overall satisfaction | Most replies are never rated, so it needs a lot of traffic |
| Replies with no problems | Share of replies with no error or failed check | Stability changes | Blind to replies that are wrong but error-free |
| Replies no guardrail stopped | Share of replies where guardrails ran and none triggered | Safety and policy wording | Only replies where guardrails ran |
| Speed | Faster replies score higher; 5 seconds or more scores zero | Shorter prompts, fewer instructions | Says nothing about quality |
Versions and A/B tests are on every plan. The AI-judge measure needs Lite, Pro and Enterprise; the 7-day Pro trial includes it.
- Set the split. The default gives half of customers B. Each customer keeps the version they got, by their ID, or by their conversation when they are anonymous, so nobody sees the bot change personality mid-chat.
- Set the stopping rule. Two numbers: how many replies each version needs (default 100) and the winning margin in percentage points (default 5).
- Start it. Nothing is split until you press Start.
Every 10 minutes, Rylvo scores the replies that the prompt's bot gave since the test started. When both versions have the replies you asked for, the test finishes: the higher score wins if it is ahead by at least your margin. You choose whether the winner is put in use automatically or waits for you. A prompt shared by several bots and owned by none can split replies but never collects results, so run tests on a prompt that belongs to a bot.
Know where the split applies
A release carries a prompt and its versions, not its tests. So the split applies to replies in Test, and to replies in Production until your first release. After that, released Production replies always get the version in use. In practice, run A/B tests in Test with real conversations from your team and testers, or before the first release, and ship the winner in a release. The post Test vs production for chatbots explains why that separation matters.
How many replies does a chatbot prompt A/B test need?
Several hundred replies per version for a small improvement; about 100 only when you expect a large one. The winner rule is a margin, not a significance test, so the sample size is your protection against noise. Here is a rough guide, calculated with the normal approximation for pass rates near 80% and 85%. The "noise band" is the 95% margin of error on the gap between the two versions: a measured gap smaller than the band can easily be chance. The values are about 10.5, 5.3 and 3.3 points at 100, 400 and 1,000 replies per version, rounded in the table:
| Replies per version | Noise band on the gap |
|---|---|
| 100 | about 10 points |
| 400 | about 5 points |
| 1,000 | about 3 points |
Read it this way: with the defaults (100 replies, a 5-point margin), two identical prompts that both pass about 82% of replies would still show B ahead by 5 points or more in roughly 1 test in 6 (normal approximation, our calculation). A "win" at the defaults is weak evidence. If you expect a small improvement, raise the replies per version to several hundred, or raise the margin. If you expect a large one, such as a bot that went from refusing insurance questions to answering them, a smaller test is fine.
An illustrative example, with made-up numbers. A (v6) and B (v7) run on the AI-judge measure with the criterion "answers insurance questions from the knowledge base". After 400 judged replies per version, A passes 71% and B passes 82%. The gap is 11 points, above the 5-point margin and above the roughly 5-point noise band at 400 replies, so B wins. If the same test had stopped at 100 replies with B ahead by 8 points, the result would sit inside the 10-point noise band and you would keep running.
Three more rules keep results clean:
- Change one thing per version. If B rewrites the tone and the refund rule, a win tells you nothing about which helped.
- Run one test per prompt at a time. Rylvo uses one running test per prompt.
- Do not stop early because the numbers look good. Repeatedly checking a running test and stopping the moment it looks good inflates false wins. In Evan Miller's worked example, a test that does nothing, checked after every observation and stopped as soon as it hit 5% significance, produced a false positive 26.1% of the time, more than five times the intended 5% (checked November 2026). Fix the reply count in advance and let the test reach it.
Step 5: Release, then keep rollback close
When B wins, put it in use in Test (or let the test do it), then activate a release to give it to customers. Production stays read-only in between, so a half-finished edit never reaches a visitor. Rylvo's Environments page explains what a release carries: prompts move together with knowledge, flows and guardrails.
If something goes wrong after release, you have two levers:
- In Test: open Versions and put the previous version back in use. Nothing newer is deleted.
- In Production: open the Releases drawer, go to History and roll back to the release that was live before. Production points at it again with nothing rebuilt.
Keep the version notes. Three months from now, "v7: insurance from the knowledge base first" is the fastest way to understand why the prompt reads the way it does.
Step 6: Let checks propose fixes, but make them prove it
Most prompt problems show up in the replies before anyone reports them. Reading two weeks of conversations by hand is slow, which is where automated checks help, as long as they have to prove their fixes.
On Pro and Enterprise (included in the 7-day Pro trial), Rylvo's self-improvement check works in four steps:
- Read. It reads the last 14 days of replies that used the prompt. Edge Cases checks, customer thumbs-down and an AI review flag the ones that went wrong.
- Write. It writes up to 3 small fixes, each a few exact edits to today's text. When a reply failed because a tool broke or a fact was missing, it says so and names the place to fix it, such as the knowledge base or a connector, instead of rewording the prompt.
- Replay. It runs the failing conversations again on the bot in Test, with today's text and with each fix. Replays run with tools off, or with only read-only tools if you choose, so nothing is sent, booked or saved. With enough failing conversations, the best fix is also tried on replies it never saw.
- Judge. A judge compares each pair blind, and reads the pairs that decide twice, with the fix shown first and then second. A fix is offered only when it wins clearly, made no reply clearly worse, and broke no reply that was already good.
You set the schedule (hourly, daily, weekly, or only when you press Check now) and what "better" means: solves what the customer asked, follows its rules, leaves the customer happy, short and to the point, or a goal in your own words. You can let clear wins go into use in Test by themselves, but customers still get a fix only in a release. Each check keeps its evidence: the replies it read, what went wrong, the fixes and every replayed conversation beside the judge's verdict.
If your plan does not include self-improvement, the same loop works by hand: read a week of flagged replies, write one small edit, save it with a note, A/B test it, release.
For wrong facts rather than wrong wording, prompts are usually the wrong lever; see How to stop an AI chatbot from hallucinating.
A checklist for every prompt change
- The edit changes one behavior, and the version note says which.
- Placeholders have values; no
[name]shows in the rendered text. - Try it shows the reply you meant on three representative messages.
- The test suite still passes.
- For a behavior change, an A/B test with a measure chosen in advance and enough replies per version.
- Released, and the previous release noted as the rollback target.
- A week later: the traces and flagged replies confirm the fix held.
When another approach fits better
If your assistant runs on a single fixed prompt you change twice a year, version history in a text file and a careful read of a few conversations may be all you need. If you are a developer running prompts inside your own application, an open-source evaluation tool such as Promptfoo (a CLI and library for evaluating and red-teaming LLM apps, usable in CI) or a prompt-versioning service such as LangSmith (prompt commits, tags and a Playground) may fit your workflow better than a dashboard (checked November 2026). A managed prompt workflow earns its keep when several people edit prompts, the bot talks to real customers every day, and a bad edit costs you leads. Plan details are on the pricing page.
Frequently asked questions
Does saving a prompt change what customers see?
No. A save makes a new version in Test only. Production changes when you activate a release.
How many replies does a prompt A/B test need?
More than most people expect. Rylvo's default is 100 replies per version and a 5-point margin. At 100 replies a version, a pass-rate gap of about 10 points can still be chance, so for small differences ask for several hundred replies per version.
Can I A/B test a prompt in Production?
Only until your first release. A release carries a prompt and its versions but not its tests, so released Production replies always get the version in use. Test replies, and Production replies before the first release, are split.
Does the AI rewrite my prompt by itself?
Not for customers. On Pro and Enterprise, a check reads 14 days of replies, writes up to 3 small fixes and replays the failing conversations in Test. A fix is offered only when it clearly wins, makes no reply clearly worse, and breaks no reply that was already good. By default it waits for you; if you switch on "Put clear wins in use by themselves", a high-confidence fix goes into use in Test only. Customers get it in a release.
How do I roll back a bad prompt change?
In Test, open the prompt's Versions tab and put an earlier version back in use; nothing newer is deleted. If the change already reached customers, roll back to the previous release from the Releases drawer.
Which plans include prompt versions, A/B tests and self-improvement?
Versions and A/B tests are on every plan for admins and owners. The own-criteria measure, where an AI judge scores replies, is on Lite, Pro and Enterprise. Self-improvement is on Pro and Enterprise, and the 7-day Pro trial includes it. Prompts per plan: Free 3, Starter 10, Lite 50, Pro no fixed cap, Enterprise no fixed cap.
