🧭 How toSoftwareIntermediate✨ AI-assisted

Versioning Prompts Like Code: A Release Process for LLM Features

WittyTech··2 min read
#prompts#versioning#release

In many teams, prompts live in a dashboard or a string buried in the code, and anyone can edit them. Then a customer reports that answers changed last Tuesday, and nobody can say what was different.

Prompts change behavior as much as code does, so they deserve the same release process.

Step 1: Store prompts in the repository

Keep each prompt in its own file, next to the code that uses it:

prompts/
  support-agent/
    system.md
    config.yaml   # model, temperature, max_tokens, version

Loading prompts from files makes every change visible in a pull request.

Step 2: Give each prompt a version

Put a version in the config and include it in the logs and traces of every request that uses it. When someone asks why an answer changed, you can match the answer to the exact prompt that produced it.

Step 3: Review changes like code

Require a pull request for prompt edits. The description should say what behavior is expected to change and include a few before-and-after examples. Reviewers often spot contradictions the author no longer notices.

Step 4: Test before merging

Run your evaluation cases on every prompt change. Compare the results with the current production version as well as with a fixed threshold, so a small drop doesn't slip through because the score is still above the line.

Step 5: Release deliberately

Ship prompt changes through the same deployment pipeline as code, ideally behind a flag so you can switch back without a redeploy. Record each release in a changelog with the date, the version and the reason.

Step 6: Keep model settings with the prompt

A prompt tuned for one model often behaves differently on another. Version the model name and parameters together with the prompt text, so they're released and rolled back as a unit.

Things to watch

  • Business users may still need to propose changes. Give them a simple form or tool that opens the pull request for them.
  • Long prompts make diffs hard to read. Split them into sections or separate files.
  • Keep customer data and secrets out of prompt files.

When a customer asks why an answer changed, you should be able to answer from the changelog in a few minutes.

← More in Software