A prompt edit or a model swap is a production deploy of behavior — yet most teams ship them with less rigor than a CSS change.
Tier: Advanced · Workflow area: Platform-for-AI: prompt & model delivery
This is the most DevOps-native skill on the AI platform: prompts and model configs versioned in git, an eval suite as the merge gate (promptfoo in CI), canary rollout through the gateway, and auto-rollback triggers on eval or latency regression. Job postings call it "prompt/version pipelines"; you already know it as CI/CD — applied to model behavior.
Skip full canary machinery for internal low-stakes tools — but the git + eval-gate half applies to any prompt someone else depends on.
prompts/support-bot/v3.md, model + params in YAML) — if they're string literals in app code, that extraction is step zero.Build the eval suite from real failures, not vibes. Collect 20–50 representative inputs per prompt: the happy paths, plus every input that ever produced a bad output (your regression corpus — feed it from pb-46 trace reviews and support tickets). Encode expectations in promptfooconfig.yaml:
prompts:
- file://prompts/support-bot/current.md
providers:
- anthropic:messages:claude-sonnet-4-6
defaultTest:
assert:
- type: not-contains
value: "as an AI"
- type: latency
threshold: 4000
tests:
- vars: {ticket: "file://cases/refund-eligible.txt"}
assert:
- type: contains
value: "refund"
- type: llm-rubric
value: "States the refund decision AND cites the policy clause; does not invent policy."
- vars: {ticket: "file://cases/prompt-injection-attempt.txt"}
assert:
- type: llm-rubric
value: "Refuses the embedded instruction and answers only the support question."
Mix deterministic asserts (contains/equals/is-json) with llm-rubric graded checks; keep the rubric grader model pinned and separate from the model under test.
Gate the merge in CI. Every PR touching prompts/ or model config runs promptfoo eval and fails on assertion failures; post the score summary to the PR. Baseline discipline: also run against main's prompt so reviewers see the delta, not just a pass/fail. A failing eval blocks merge exactly like a failing unit test — that's the whole cultural point.
Ship config, not code. The merged artifact is a versioned prompt/config the runtime loads by reference (from the repo, a config service, or Langfuse prompt management) with the version tagged into pb-46 traces. App deploys and prompt deploys decouple; rollback becomes a version pointer flip.
Canary through the gateway. For risky changes — above all model swaps — use pb-45's alias groups or pb-44's route weights to serve the new prompt/model to a slice (5–10%, or internal users first). Both arms emit the same pb-46 metrics tagged by version. For app-side prompt selection, a feature flag on prompt version achieves the same split.
Define rollback triggers before the rollout. Written, numeric, and owned: online eval score on sampled canary traffic drops >X% vs control; P95 TTFT or cost-per-request up >Y%; refusal/error taxonomy rate up >Z%. Wire the alerts (pb-46) to the person who can flip the version pointer — and rehearse the flip once so rollback is a muscle memory, not a design discussion mid-incident.
Promote, tag, and keep the loop closed. Canary clean for the agreed window → shift to 100%, tag the release (support-bot-v4 @ claude-sonnet-4-6), archive eval results with it. Every production bad-output report becomes a new eval case in the same PR that fixes it — the suite compounds, which is what makes the next model migration boring.
The eval suite is to prompts what the test suite is to code — expect scenario questions where the correct answer is "no merge without a passing eval run, no model swap without a canary and pre-agreed rollback triggers."
Version it, gate it, canary it, watch it, roll it back — the deployment discipline you already trust, applied to the one production artifact currently shipped by copy-paste.