short · 3 min
Prompt versioning
Tracking every prompt change so you can compare versions and roll back.
updated 29 Sept 2026
Someone on the team says: "The support bot got worse after yesterday's prompt change. Can you put the old one back?"
To do that we need three things. We need to know which prompt was running yesterday and which is running now. We need the old one saved somewhere. And we need a way to switch back that doesn't take all afternoon. That's prompt versioning: every change to a prompt gets a number we can point to. There are two common ways to set it up.
Way one: a registry with labels
A prompt registry (Langfuse and Braintrust are two) stores prompts outside our code. Say the support bot's system prompt is on version 6, and someone saves an edit. The registry stores it as version 7 on its own. Nothing in production changes yet.
What production actually uses is decided by a label, a pointer to one
version that we can move. In Langfuse, production marks the version in
use and latest always points at the newest, and we can add our own, like
staging. Our code asks for the prompt by name and gets whatever version
has the production label.
So shipping version 7 means moving production onto it. Rolling back
means moving it back to 6. No code change, no deploy. Braintrust works the
same way with environments, and edits in its UI reach the running app
right away. For our teammate's request, that's one click.
That speed cuts both ways. Moving a label changes what users see as much as shipping code does, so run the evals on the new version before the label moves. (Some registries can lock labels so only admins move them; in Langfuse that's an enterprise feature.)
Way two: git is the registry
The other camp says the prompt is the main interface between our code and the model, so it should live in the repo and be treated like any other code (prompts as code). It's a function in the codebase, it changes through a pull request, and its version is the git commit. For our teammate, rolling back is a revert and a deploy. Slower than a click. But the prompt gets code review, tests, and the same history as the code that calls it.
Both sides have a point: a registry is faster to change, a repo is easier to review.
Either way, the first thing our teammate's question needs is knowing which version wrote which answer. So every trace should carry the prompt's name and version (LLM tracing has fields for both). And a prompt version alone isn't the whole picture. The same prompt on a different model is a different system, so the model goes in the record too (model upgrades).
When the registry goes away
Here's a case for keeping a copy in the repo even if we use a registry. Humanloop was a hosted prompt and eval platform. After it was acquired, customers got a notice: every prompt, version, log and evaluation stored there would be permanently deleted on 2025-09-08. There was an export tool and a list of other platforms to move to. Teams that had their prompts only in Humanloop had a deadline to get them out, and after that date, "put the old one back" had no old one to go back to.
Further reading
- Prompt version control, Langfuse docs. Versions, labels and rollback, in a few short sections.
- Use prompts in code, Braintrust docs. How the running app picks up a pinned or environment version.
- 12-Factor Agents, Factor 2: Own your prompts, Dex Horthy, 2025. The case for keeping prompts in your own code. Quick to read.
- Migrating from Humanloop, Humanloop, 2025. The shutdown notice itself.