AI & ML Practical By Samson Tanimawo, PhD Published Jul 26, 2026 4 min read

Prompt Version Control: The Discipline That Pays Off

Prompts are code. Version them, review them, test them. The git workflow for prompts and the eval gate that protects every change.

Prompts in git

Each prompt lives in its own .md or .txt file in the repo. Versioned, reviewable, diffable. No more 'we changed something but cannot remember what.'

PRs that change prompts get the same review as PRs that change code. A second pair of eyes catches subtle regressions.

Tag prompt versions with a release identifier. The model invocation logs the version; debugging is reproducible.

Eval gate on every PR

Every prompt PR runs the eval suite. Pass: merge proceeds. Fail: PR stays open until the prompt or the eval is fixed.

Override is allowed but written. 'Accepting eval regression on case-12 because new prompt fixes case-37 which is more important.' The override is logged.

Without the eval gate, prompts drift. With it, prompts compound in quality.

What to put in the prompt vs in code

Prompt: the reasoning steps, the format, the constraints expressible in language.

Code: routing, validation, deterministic logic, tool calls.

When in doubt, push toward code. Code is testable; prompts are stochastic. The discipline pays.

Rollback when something regresses

Production logs the prompt version per request. A regression is traceable to the prompt change that caused it.

Rollback is a single PR that reverts the offending prompt change. Fast; reversible.

Post-rollback: write the eval case that would have caught the regression. The case lands in the suite; future regressions are loud.