A prompt that works on one model version can fail on the next, and a prompt edited in place leaves no way back. The fix is versioning: save each prompt with a version number, record the model version it was tested against, and keep the old versions when you change either one. Then a regression is a rollback, not a rewrite.
Prerequisites
- A place to store prompt versions: a file, a repository, or a prompt store.
- The model version each prompt was tested against.
- A test set to check a prompt version against.
Steps
Step 1: Save each prompt version
Save every prompt change as a new version with a number and a date, and a one-line note saying what changed. Never edit a version in place; create a new one.
Step 2: Record the model version
Record the model version each prompt version was tested against, and the score it got on the test set. A prompt version without a model version is untested.
Step 3: Roll back when needed
When a model update breaks a prompt, roll back to the last prompt version that passed the test set on the current model, or pin the old model version while you fix the prompt. Either way, the rollback is one step, not a rebuild.
Worked example: Harbor Light library reference prompts
The fictional Harbor Light library versions its reference-desk prompt across 3 versions.
| Prompt version | Model version | Test score | Status |
|---|---|---|---|
| v1 | Model A | 8 of 10 | Kept |
| v2 | Model A | 9 of 10 | Current |
| v3 | Model B | 6 of 10 | Rolled back to v2 |
Version 3 scores 6 of 10 on the new model, so the library rolls back to version 2, which scored 9 of 10, while the prompt is fixed.
Expected result. Every prompt version has a model version and a test score, and a failing version can be rolled back in one step. UNTESTED: this guide was not run against a live model or API. The worked example below is fictional practice material, and its result is the expected result, not a measured one.
Limits
- Versioning helps recovery; it does not prevent a model update from breaking a prompt.
- Keep the test set with the versions, or the scores cannot be re-checked.
- This guide does not cover automated prompt testing.
