Skip to content

AI-300 · Domain 3: Design and implement a GenAIOps infrastructure · 24% of the exam

Task 3.3: Implement prompt versioning and management with source control

Designing prompts, creating prompt variants and comparing their performance, and version control for prompts in Git repositories.

Study it

  • Designing prompts and comparing prompt variants

    Partly covered by: Evaluating LLMs

  • Prompt and agent versions in Git

    Lesson coming

Sample questions

Try each one before opening the answer. Every option is explained, with the Microsoft documentation page that proves it.

Question 1 · choose 1

A team wants to fix a typo in the instructions of version 4 of a prompt agent without creating a new version, so that release notes stay simple. What applies?

  1. AEdit version 4 in place from the playground, then save it under the same number
  2. BEdit version 4's YAML definition through the REST API
  3. CThe fix is saved as a new version, since saved versions are immutable
  4. DDelete version 4 and save the fix under the same number
Show the answer and why
  • AEdit version 4 in place from the playground, then save it under the same number

    Incorrect

    Saved versions can't be modified.

  • BEdit version 4's YAML definition through the REST API

    Incorrect

    The definition of a saved version is immutable.

  • CThe fix is saved as a new version, since saved versions are immutable

    Correct

    Any change to a saved version is saved as a new version.

  • DDelete version 4 and save the fix under the same number

    Incorrect

    Version numbers aren't reused that way.

Each version of an agent is immutable after you save it; any modification requires saving a new version. This preserves version integrity and prevents accidental overwrites, and the agent's version history keeps every definition.

Question 2 · choose 1

Reviewers want to see exactly which instructions and tool settings changed between versions 6 and 7 of a prompt agent, and how the two answer the same questions. What should they use?

  1. AVersion history comparisons of setup, YAML definitions and chat output
  2. BTwo evaluation runs, one per version, each using a different test dataset
  3. CThe trace of a single run of version 7
  4. DThe Foundry resource's activity log
Show the answer and why
  • AVersion history comparisons of setup, YAML definitions and chat output

    Correct

    Version history compares setups, definitions and outputs.

  • BTwo evaluation runs, one per version, each using a different test dataset

    Incorrect

    Different datasets don't give a like-for-like comparison.

  • CThe trace of a single run of version 7

    Incorrect

    One trace shows one version's behavior, not the differences.

  • DThe Foundry resource's activity log

    Incorrect

    The activity log records management operations, not definitions.

Agent version history lets you go to any version and compare agent setup between versions, analyze chat output differences using identical inputs, and review differences in YAML definitions.

Question 3 · choose 1

Prompt and tool changes to a production agent must be reviewed in pull requests, every release must be traceable to a commit, and rollback must be immediate without re-editing the agent. What should the team set up?

  1. AKeep agent definitions in Git, have CI create a new version on merge, and pin the app to name:version
  2. BEdit the agent in the playground, then export its YAML definition into the repository after each release
  3. CKeep one agent version and have the pipeline overwrite its instructions on each merge to main
  4. DCreate a new agent with a new name for every release, and point the app to the newest name
Show the answer and why
  • AKeep agent definitions in Git, have CI create a new version on merge, and pin the app to name:version

    Correct

    Versions are immutable and addressable, so the app can move back to an earlier one.

  • BEdit the agent in the playground, then export its YAML definition into the repository after each release

    Incorrect

    Changes would bypass review and reach the agent before they're in Git.

  • CKeep one agent version and have the pipeline overwrite its instructions on each merge to main

    Incorrect

    Saved versions can't be overwritten, and rollback would need another edit.

  • DCreate a new agent with a new name for every release, and point the app to the newest name

    Incorrect

    Names can't be reused, and agents pile up as orphaned duplicates.

Saved agent versions are immutable, and in code an agent is referred to as <agent_name>:<version>, so requests can be directed to a specific version for controlled deployment and rollback. Storing agent definitions in source control, with tool bindings and connection configurations alongside, lets pull requests review changes; CI then creates the new version and the app's reference decides which version serves.

Question 4 · choose 1

Can a team rename a prompt agent after naming it?

  1. AYes, from the agent's settings
  2. BYes, by saving a new version with another name
  3. CYes, through the REST API only
  4. DNo, the name is fixed once the agent is named
Show the answer and why
  • AYes, from the agent's settings

    Incorrect

    Names can't be changed.

  • BYes, by saving a new version with another name

    Incorrect

    Versions share the agent's name.

  • CYes, through the REST API only

    Incorrect

    The name is fixed.

  • DNo, the name is fixed once the agent is named

    Correct

    After you name your agent, you can't change the name.

After you name your agent, you can't change the name. In code you refer to it by <agent_name>:<version>.

Question 5 · choose 1

Which syntax does the prompt engineering article suggest for structuring prompt sections when unsure?

  1. APlain text without separators
  2. BMarkdown or XML
  3. CBase64-encoded blocks
  4. DCSV for every section
Show the answer and why
  • APlain text without separators

    Incorrect

    Clear syntax helps the model separate sections.

  • BMarkdown or XML

    Correct

    Models were trained on large amounts of web content in these formats.

  • CBase64-encoded blocks

    Incorrect

    Encoding hides structure from the model.

  • DCSV for every section

    Incorrect

    The article names Markdown or XML.

The article recommends clear syntax such as punctuation, headings and section markers, and if you're not sure what syntax to use, Markdown or XML, because the models were trained on a large quantity of web content in those formats.

Question 6 · choose 1

A prompt starts with a stable 600-token system message. Why doesn't it benefit from prompt caching?

  1. ASystem messages are never cached
  2. BCaching works only on Provisioned deployments, not on Standard ones
  3. CThe cacheable prefix needs at least 1,024 tokens
  4. DCaching needs a new API version every month
Show the answer and why
  • ASystem messages are never cached

    Incorrect

    The prefix length is the issue.

  • BCaching works only on Provisioned deployments, not on Standard ones

    Incorrect

    Standard deployments support caching too.

  • CThe cacheable prefix needs at least 1,024 tokens

    Correct

    Prefixes shorter than 1,024 tokens aren't cached.

  • DCaching needs a new API version every month

    Incorrect

    No specific API version is needed.

Prompt caching reuses identical content at the beginning of prompts. A cache hit needs a prompt of at least 1,024 tokens whose first 1,024 tokens are identical, so a 600-token prefix isn't cached on any deployment type.

Question 7 · choose 1

From the Code tab in the agent playground's chat pane, where can a developer take a preconfigured code snippet that references the agent?

  1. ATo a Visual Studio Code for the Web cloud environment
  2. BTo a new hosted agent container that runs the snippet
  3. CTo the agent's version history as a new version
  4. DTo a pull request in the project's Git repository
Show the answer and why
  • ATo a Visual Studio Code for the Web cloud environment

    Correct

    The snippet opens there with the packages and extensions it needs, or you copy it to your own environment.

  • BTo a new hosted agent container that runs the snippet

    Incorrect

    The Code tab hands over a code snippet, not a container deployment.

  • CTo the agent's version history as a new version

    Incorrect

    Versions are saved from the agent's definition, not created from a code snippet.

  • DTo a pull request in the project's Git repository

    Incorrect

    The documented options are VS Code for the Web or copying the snippet to your own environment.

To develop an agent in code, take the code snippet from the Code tab in the agent playground's chat pane to a dedicated Visual Studio Code for the Web cloud environment. The snippet comes preconfigured with the packages and extensions you need, along with instructions to develop and deploy the agent to Azure. You can also copy it to your preferred development environment.

Practice domain 3 →Practice all domains →