Esta nota todavía no está traducida, así que se muestra la fuente en inglés.
Ship a prompt change safely
Mental model: a prompt is production logic. Treat every edit as a versioned behavioral change with a baseline, holdout comparison, launch gate, monitoring plan, and rollback owner.
Mechanism: candidate → differential eval → gradual release or rollback
Use this playbook when a prompt edit is ready to move beyond local testing and into a shared environment, release branch, or production traffic.
Inputs
- Current prompt version and candidate prompt version.
- Regression eval suite and high-risk manual cases.
- Product metrics, cost target, latency target, and safety gates.
- Rollback path and owner.
Procedure
- Write the reason for the change and the expected behavior improvement.
- Change one prompt variable at a time when possible.
- Run the regression suite against baseline and candidate.
- Compare pass rate, slice-level failures, cost, latency, refusals, and format validity.
- Inspect examples where the candidate differs from the baseline.
- Run targeted cases for known risks and previous incidents.
- Version the prompt and release notes in the registry.
- Deploy gradually if traffic or risk justifies it.
- Monitor production traces and feedback for regressions.
- Roll back if release gates fail or a serious new failure appears.
Release gate
| Gate | Example |
|---|---|
| Quality | no drop on target eval slices |
| Format | structured outputs still parse |
| Safety | no new unsafe or over-refusal pattern |
| Cost | token and model usage within budget |
| Latency | p95 within product target |
Pitfall
Do not ship because the edited prompt fixes the single example that annoyed you. That example is now a dev case; the regression suite decides.
Connects to: prompt regression testing · evaluating prompts · prompt registry
Executable release gate
baseline, candidate, safety_ok = .88, .90, True
print("release" if candidate >= baseline and safety_ok else "rollback")
Run with python3; expected output is release. Compare critical slices, p95 latency, cost, format validity, refusals, and incident cases—not one aggregate score.
Sources
- NIST AI RMF — lifecycle controls.
- HELM — scenario-based evaluation.
- OpenAI Cookbook — executable eval patterns.