Picture a support assistant that has been running fine for months. On a Friday afternoon someone softens the wording of the refund instructions. No code is shipped, no pipeline runs, nobody breaks a rule. By Monday a few customers have been told something slightly different about refunds, and now someone asks a simple question: which exact instruction text was the assistant using when it answered each of those conversations? That question is the whole point of prompt version control on Databricks, and it maps to an exam objective that sounds boring until you meet it in a scenario: “Apply prompt version control and manage prompt lifecycle.” In my book it opens the chapter on releasing changes safely, and here I’ll walk you through it the way I’d explain it to a friend studying 30-60 minutes a day.
If you are new to the exam, start with my Databricks Generative AI Engineer Associate study guide. This post leans on two earlier ones: Databricks prompt engineering (what goes inside a prompt) and MLflow + Unity Catalog for GenAI (versions and aliases for models). Today the same versions-and-aliases idea comes back, attached to a prompt, and it behaves in a way that surprises people.
The ambush: “our prompts are already in git”
Here is the reflex the exam is built to catch. Ask a team whether their prompts are under version control and the answer comes out instantly: yes, they live in the repository, and the repository is in git. Some teams go one step further and move prompts into a table so a product owner can edit them without waiting for an engineer.
Both moves feel responsible. Both solve a scheduling problem. Neither gives the prompt a lifecycle of its own. The test I use is simple: can you name, with a number, the exact prompt version that served a given request, and can you put the previous one back without touching anything else? If the answer to either half is no, the prompt is versioned by accident, not on purpose.
What git actually versions
Git versions files. That is valuable and you should keep doing it. But the file is a container, and the prompt inside it inherits a history that belongs to the container. Three consequences follow:
- The prompt cannot move without the code moving. A prompt change in production means a build, a pipeline and a deployment.
- Nothing links a request to a prompt. To say which text answered a conversation you have to line up commit times against deployment times against conversation times, and hope nobody deployed twice that day.
- Rollback is a release. Putting the old text back means reverting, rebuilding and redeploying.
MLflow’s own documentation makes the same point in a note titled “Why not use Git?”: an application holds many prompts across many components, and tracking the change of a single prompt in one linear git history is hard.
Why the table is not the answer either
The table fixes the visible problem (non-engineers can edit) and quietly gives up the rest. An UPDATE overwrites, so yesterday’s text is gone. There is no pointer that separates “the version we are running” from “a version that exists,” so promotion becomes a convention someone has to remember. And nothing links a row to a request, which is the same attribution gap as git, arriving by another road.
So the two common answers fail from opposite sides. Prompts in code have versions but no independence. Prompts in a table have independence but no versions. What you want is both, and that is not a discipline you impose. It is a mechanism you adopt.
How prompt version control on Databricks works: the MLflow Prompt Registry
That mechanism is the MLflow Prompt Registry. On Databricks it stores prompts in Unity Catalog, and as I write this the docs label it Beta, which is worth remembering before you build a compliance process on top of it. Its model is short enough to memorize:
- Prompts are named entities in Unity Catalog, with the usual three-level name,
catalog.schema.prompt. - Versions are immutable snapshots with auto-incrementing numbers. You never edit version 7; you register version 8.
- Aliases are mutable pointers to a version, such as
productionorstaging. - Tags are key-value pairs on a version.
import mlflow
mlflow.set_registry_uri("databricks-uc")
# 1. Register: every call creates a new, immutable, numbered version.
mlflow.genai.register_prompt(
name="prod.support.refund_policy", # catalog.schema.prompt
template="You are a support assistant. {{policy_context}}\n\nQuestion: {{question}}",
commit_message="Soften refusal tone; keep the 30-day window explicit.",
)
# 2. Promote: move the pointer, not the text.
mlflow.genai.set_prompt_alias("prod.support.refund_policy", alias="production", version=7)
Two details are worth slowing down for. First, the functions live under mlflow.genai. Second, a prompt in Unity Catalog is governed like a function. The docs ask for CREATE FUNCTION, EXECUTE and MANAGE on the schema to view or create prompts. If you already learned the Unity Catalog privilege cascade for models and tables, nothing new is needed here; it just ends in EXECUTE.
One small asymmetry from my book that is worth knowing: the template text of a version is immutable, but the configuration recorded alongside it (model settings, tags) can be updated in place. The text is the release artifact; the metadata around it is not frozen.
Alias names: environments, not Champion
For models you met @Champion and @Challenger. Prompt aliases conventionally use environment names instead: dev, staging, production, with latest reserved for the newest version. Nothing breaks if you name a prompt alias Champion, but if an answer option puts @Champion on a prompt, read it as a hint that the option was written by someone thinking about models.
If you are working through this with my free Databricks Generative AI Engineer Associate course, this is a good moment to pause and say the four words out loud: prompt, version, alias, tag. The rest of the objective is just what those four do together.
The trap that decides rollback: who re-reads the pointer
This is the part I think matters most, and it is the part people get backwards.
In the model world, an alias is mostly a note to humans and tooling. When you create a serving endpoint, you hand it a version number, and from then on it serves that exact version. Move @Champion back to last week’s model and the endpoint does not care, because it was never asking. (I covered that in Model Serving vs ai_query.)
A prompt alias is different because the running application reads it.
import os
import mlflow
PROMPT_NAME = os.getenv("PROMPT_NAME", "prod.support.refund_policy")
ENVIRONMENT = os.getenv("PROMPT_ALIAS", "production")
# Live: re-reads the alias (cached about 60 seconds by default).
prompt = mlflow.genai.load_prompt(f"prompts:/{PROMPT_NAME}@{ENVIRONMENT}")
# Pinned: version 7 forever. Moving the alias will not touch this line.
pinned = mlflow.genai.load_prompt(f"prompts:/{PROMPT_NAME}/7")
Look at the first load. There is no version number in it. The application asks for whichever version the production alias currently names. MLflow caches alias-based loads with a short time-to-live, 60 seconds by default, so after about a minute the next request looks at the alias again. Version-pinned loads are cached indefinitely, which is safe because a version can never change.
So when someone moves the production alias on a Friday afternoon, they are not leaving a note. They are changing what every running copy of the app says, within about a minute, with no deployment anywhere. The Databricks docs recommend exactly this pattern: load by alias, keep the alias name in an environment variable, and update production by reassigning the alias without redeploying code.
When the version gets resolved
The rule I want you to carry into the exam is not “models are one way and prompts are another.” It is this:
- Resolved at deployment time = pinned. Moving the pointer later changes a label and nothing else.
- Resolved at call time = live. Moving the pointer changes behavior on the next read.
That axis cuts across artifacts. A batch job that loads a model by alias at the start of each run will pick up an alias move on its next run. An application that pinned a prompt version will ignore every alias move you make. In my book I compress it to one line: an alias only moves what re-reads it.
Promotion and rollback: one call each way
Here is another place where prompts and models part ways. For models, Databricks recommends separating environments by catalog (a dev catalog, a staging catalog, a prod catalog). For prompts, the docs promote by reassigning aliases on one registered prompt. My book notes there is no documented cross-catalog promotion pattern for prompts. So you end up with something like this:
devpoints to version 9stagingpoints to version 8productionpoints to version 7
Promoting version 8 to production is one set_prompt_alias call. Rolling back is the same call in the other direction. Both are true only if the application loads by alias. If it pinned a version number, rollback means shipping code again, which puts you right back where the git file left you.
That is why I treat the load line as the single most important line in the app. Ask by alias and a bad prompt costs one command. Pin the version and it costs a release. Put the environment name in configuration rather than in source, so the same build runs in staging and production and only the alias differs.
Answering “which prompt produced this answer?”
Back to the question from the opening: which text was live for each conversation? The registry answers it, but not from the prompt page. The link lives in tracing. When an app loads a registry prompt inside a traced function, MLflow records which prompt version that trace used, and you can search traces by it.
# Which conversations ran on version 7? Exact name/version match.
mlflow.search_traces(filter_string='prompt = "prod.support.refund_policy/7"')
That filter is an exact name/version match, which is fine, because an exact answer is what the question wanted. Two cautions from my book:
- Order matters. The call that declares which application version is active has to run before the prompt is loaded. Load first and the link is simply not recorded, with no error to warn you. Make that ordering part of the app’s startup, not something a developer remembers.
- Don’t mix up lineages. Prompt-to-trace history answers “what was in play when this ran.” It is not the same as tracing a retrieved chunk back to its source document. Exam stems sometimes describe one while the options talk about the other.
If you want an evaluation run tied to a specific prompt version, that link also comes through tracing. I wrote about the evaluation side in Databricks agent evaluation vs monitoring.
How the exam asks about prompt lifecycle
Like most objectives in this exam, this one is written as a decision, not a definition. The constraint words in the stem carry the answer:
- “Preserve version history,” “roll back to a previous version,” “promote only after approval” describe a registry with immutable versions and aliases. They rule out anything that overwrites.
- “Which prompt produced this output” is about the trace link, not the registry listing.
- “Reversible immediately, without a release” is about how the app loads the prompt: by alias, at call time.
- An option that promotes a prompt by merging a branch or overwriting a row is wrong for the same reason both times: the promotion is not separable from something else.
- An option that “fixes” a pinned app by shortening the cache is a timing answer to a resolution problem. A shorter cache helps only a client that re-reads the alias.
My study tip for a 30-60 minute session: write the load line twice on paper, once with @production and once with /7, and next to each write what rollback costs. If you can explain that difference to someone in two sentences, you own this objective. If you want the bigger picture of where this sits in a release, my post on the Databricks Agent Framework and MLflow Tracing shows where the prompt fits inside an agent.
FAQ
Is keeping prompts in git enough for prompt version control on Databricks?
No. Git versions the file, not the prompt. You cannot promote the prompt without deploying code, nothing links a request to the text that served it, and rollback is a release. Keep the file in git if you like, but give the prompt its own versions in the MLflow Prompt Registry.
Where are prompts stored on Databricks?
In the MLflow Prompt Registry, backed by Unity Catalog, under a three-level catalog.schema.prompt name. You need CREATE FUNCTION, EXECUTE and MANAGE on the schema to view or create prompts. The feature is labeled Beta in the docs as of this writing.
How fast does moving a prompt alias reach a running app?
If the app loads by alias, about a minute by default, because alias-based loads are cached for 60 seconds. If the app pinned a version number, never: the pinned version is cached indefinitely and does not re-read the alias.
How do I roll back a bad prompt?
Point the alias back to the previous version with set_prompt_alias. That works only when the app loads the prompt by alias. If it pinned a version, rolling back requires a code release.
Do prompts use Champion and Challenger aliases like models?
Conventionally no. Prompt aliases use environment names such as dev, staging and production, with latest reserved for the newest version. Champion and Challenger are model registry habits.
Wrapping up
A prompt is a release artifact in its own right. It has its own immutable versions, its own movable pointer and its own history, and none of the three belong to the code. Once you see that the running app is the thing reading the pointer, the exam questions on this objective stop being trivia and become one question: who re-reads, and when?
If you want to learn the rest of this exam the same way, trap by trap, in 30-60 minutes a day and without dumps, my free Databricks Generative AI Engineer Associate course is the place to start. Next on the blog I’ll take the release one step further: what CI/CD can honestly promise for a GenAI app.









