Prompt
How do I test prompt changes before pushing to production?
Latest observation
Nov 26, 2026
OpenAI APIWeb search: off
A good way to test prompt changes before production is to treat prompts like code: version them, evaluate them, and run them against a fixed test set before release.
Practical workflow
-
Create a test set
- Collect real or representative inputs from users.
- Include edge cases, ambiguous cases, and failure cases.
- Keep expected outputs or evaluation criteria alongside each example.
-
Version your prompts
- Store prompts in git or a prompt registry.
- Tag versions so you can compare “current” vs “new.”
-
Run side-by-side evaluations
- Test the old prompt and the new prompt on the same inputs.
- Compare:
- task success rate
- format correctness
- hallucination rate
- latency
- cost/token usage
-
Use automated evals
- Add checks for:
- required fields present
- JSON/schema validity
- banned content
- semantic similarity or rubric-based scoring
- If you use an LLM judge, validate it with a small human-reviewed set first.
- Add checks for:
-
Do a canary or shadow release
- Send a small percentage of production traffic to the new prompt.
- Or run it in shadow mode: it processes requests but doesn’t affect users.
- Monitor regressions before full rollout.
-
Review failures manually
- Inspect outputs where the new prompt performs worse.
- Update the prompt or test set based on those failures.
-
Set rollout criteria
- Example: “Promote only if accuracy improves by 5% and schema failures stay under 1%.”
Good tools/patterns
- Prompt management/versioning: LangSmith, PromptLayer, Humanloop, etc.
- Evaluation harnesses: custom scripts, unit tests, golden datasets
- CI integration: run prompt evals on every change before merge
Simple rule of thumb
If a prompt change matters, test it on:
- a fixed benchmark set
- edge cases
- live-like traffic in shadow/canary mode
If you want, I can also give you:
- a CI test template
- a prompt evaluation checklist
- or a Python example for running prompt A/B tests before deployment.