Search⌘ K
AI Features

Prompt Testing and Versioning

Explore methods to manage prompt changes through versioning prompt text, schema, and evaluation datasets. Understand how to design tests based on output properties rather than exact text to handle AI variability. Learn to conduct lightweight A/B evaluations and use traces for debugging, ensuring reliable prompt behavior in production environments.

A prompt edit ships on a Friday because it looks like a copy change. Nothing fails at deploy time, because no compiler type-checks a prompt file. On Monday, an on-call alert fires because the downstream JSON parser rejects a higher share of responses, or a previously stable refusal behavior starts leaking disallowed content and a user reports it.

The failure is not mysterious. The prompt changed the model output distribution, and the product had no gate that asserted the output contract. If a prompt change can break our product, it needs a gate like any other change.

What to version so changes stay reviewable

Once we treat the prompt as an interface, the versioned unit is not just the prompt string. A small schema tweak can invalidate a parser, and a small dataset tweak can make a pass rate look better without improving behavior.

Version three things together:

  • Prompt text in a dedicated file such as ...