A prompt running inside a product is code, and it tends to be treated as configuration. It gets edited in a dashboard, changed without a record, and nobody can say what it looked like last month or why a line was added. That works until something breaks.
Why does a prompt need versioning?
Because behaviour changes for reasons you did not cause. Providers update models under the same name, safety layers change, and a prompt that produced reliable output in March produces something subtly different in June.
Without a record you cannot tell whether the change came from your edit, the model, or the input distribution shifting.
What should be recorded?
- The prompt itself, in version control alongside the code that calls it.
- The model and version it was tested against, pinned rather than floating.
- The settings. Temperature, effort, maximum tokens.
- Why each change was made, which is what nobody keeps and everybody wants.
- The evaluation results at the time it was accepted.
Why does the reason matter so much?
Because six months later nobody remembers which line fixed which problem, and unnecessary instructions accumulate for exactly that reason. A line with a dated note explaining what it prevents can be removed confidently when the problem no longer exists.
Without that, prompts only ever grow.
How do you handle a model update?
Pin the old version, run your evaluation set against the new one, and compare before switching. Providers deprecate dated versions eventually, which gives you a window rather than a surprise.
Where the new model behaves differently, the fix is frequently to remove instructions rather than add them, since many were compensating for weaknesses that have been fixed.
What does prompt drift look like?
Gradual changes in tone or length, edge cases starting to fail, or structured output occasionally malformed where it never was. It is rarely dramatic, which is why it goes unnoticed until somebody complains.
Logging a sample of real outputs and looking at them periodically catches this earlier than waiting for reports.
Should prompts live in code or a database?
In code for most teams, because it gets review, history and deployment for free. A database or prompt management tool makes sense when non-engineers need to edit them, and it needs the same discipline bolted on: versions, approval and a rollback path.
Should prompts be tested in production?
Gradually, yes. Running a new version alongside the current one on a sample of real traffic, and comparing, catches the cases your evaluation set does not contain, which is always more of them than you expected.
It requires logging both outputs and a way to compare them, which is more work than a straight switch. It is also the only way to find out how a prompt behaves on the inputs nobody imagined, and those are the ones that generate complaints.
What about the rollback path?
Have one. The ability to revert to the previous prompt and the previous model within minutes is worth more than any amount of testing, since testing catches the failures you anticipated and production finds the others.
Who should be allowed to change one?
Whoever can also run the evaluation set. That is the practical constraint rather than a question of seniority, since a change made without measurement is a change nobody can assess.
Where non-engineers need to edit prompts, which is reasonable in many products, the tooling has to include the tests. A dashboard that permits editing without running anything is how a well-intentioned wording change reaches production and breaks an edge case nobody thought about.
How often should a prompt be reviewed?
Every few months, and after every model change. The review that matters is subtractive: remove each line, run the evaluation set, and see whether anything breaks. Most prompts that have been in production for a year can lose a third of their length without any measurable effect, and the remaining instructions work better for it.