Problem
Prompts are modified ad-hoc, shared as strings in code or Notion docs, with no history of what changed, when, or why. A single prompt edit can silently degrade production quality.
Solution
Treat prompts as first-class versioned artifacts: store them in a prompt registry (Git, LangSmith Hub, Promptlayer), review changes via PR, test before deploying, and maintain rollback capability.
Implementation
- Store prompts externally: LangSmith Hub, PromptLayer, Pezzo, or a simple Git-tracked YAML file
- Version format: semver tags (v1.2.3) or commit SHAs
- Deploy flow: Prompt change → eval suite run → PR review → merge → deploy via config (no code deploy needed for prompt-only changes)
- Pinning: Production always references a pinned version; new versions are rolled out via feature flags
- Rollback: If quality degrades, revert to the previous prompt version in config
Prompt metadata to track
- Version + author + date
- Model(s) it was tested with
- Eval scores at time of creation
- Changelog (what changed and why)
Trade-offs
- Pro: Full audit trail of every prompt change and its quality impact
- Pro: Prompt-only updates don't require code deployments
- Con: Adds process overhead — not suitable for rapid experimentation
- Con: Requires discipline to keep the registry in sync with code references
When to use
Any production system where prompt quality matters. Essential for teams with more than one person editing prompts.