Skip to content

AI-103 · Domain 2: Implement generative AI and agentic solutions · 33% of the exam

Task 2.2: Build agents by using Foundry

Agent instructions, conversation state and tool schemas; retrieval, function calling and memory; built-in and custom tools; multi-agent workflows; approvals for autonomous steps; and monitoring and evaluating deployed agents.

Study it

  • Prompt agents and hosted agents: instructions, conversations and tool schemas

    Partly covered by: Agents and Tools

  • Retrieval, function calling, built-in tools and memory in agents

    Partly covered by: The Tool-Use Loop

  • Multi-agent workflows and human approval steps

    Lesson coming

  • Monitoring, evaluating and debugging deployed agents

    Partly covered by: Evaluating LLMs

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 web app talks to a prompt agent in Foundry Agent Service. Users ask follow-up questions such as "and the second one?", so the agent must see earlier turns. The app wants the service to keep the history rather than resend it. What should the app do?

  1. AAdd the earlier turns to the agent's instructions after each reply
  2. BSend all earlier messages in every request and start a new conversation
  3. CCreate a conversation and pass its ID with every request to the agent
  4. DSend each follow-up with a new conversation ID
Show the answer and why
  • AAdd the earlier turns to the agent's instructions after each reply

    Incorrect

    Instructions define the agent for all users; rewriting them per chat would mix users' histories.

  • BSend all earlier messages in every request and start a new conversation

    Incorrect

    That works but is the resending the app wants to avoid, and it grows token use every turn.

  • CCreate a conversation and pass its ID with every request to the agent

    Correct

    A conversation keeps the history of turns, so each request only adds the new user message.

  • DSend each follow-up with a new conversation ID

    Incorrect

    A new conversation starts without the earlier turns, so follow-ups lose their context.

Conversation state is the turn-by-turn history of a chat: create a conversation once and reference it on each turn instead of resending history.

Question 2 · choose 1

An internal help agent has both file search over HR policies and web search. For questions about leave rules it often answers from public websites. The HR team wants internal policy to be checked first and the web used only when the policies say nothing. What should you change?

  1. ARemove web search and rely on the model's own knowledge for HR answers
  2. BRaise the model's temperature so that it explores the other tool more
  3. CGive both tools identical, generic descriptions
  4. DAdd an instruction to use file search before web search for internal topics
Show the answer and why
  • ARemove web search and rely on the model's own knowledge for HR answers

    Incorrect

    That drops the fallback the team wants and swaps web results for the model's training data.

  • BRaise the model's temperature so that it explores the other tool more

    Incorrect

    Randomness doesn't encode a preference for internal content.

  • CGive both tools identical, generic descriptions

    Incorrect

    Generic descriptions make it harder for the model to tell the tools apart, not easier.

  • DAdd an instruction to use file search before web search for internal topics

    Correct

    When tools overlap, the guidance is to tell the model what each tool is for and add a decision rule such as this one.

Tool choice is driven by instructions and tool descriptions. With overlapping tools, state each tool's purpose and an explicit order of use.

Question 3 · choose 1

A prompt agent has a function tool named get_shipment_status. When a user asks about a parcel, the response contains a function call with a call_id and arguments. The tracking system lives in your own network. What must your app do next?

  1. ARun the function and send the result as function_call_output for that call_id
  2. BUpload the tracking data as a code interpreter file and ask the question again
  3. CWait for the agent service to call the tracking system on its own behalf
  4. DStart a new conversation that includes the shipment status as plain text
Show the answer and why
  • ARun the function and send the result as function_call_output for that call_id

    Correct

    Your app executes the function and submits the output for that call; the agent then uses it to finish its answer.

  • BUpload the tracking data as a code interpreter file and ask the question again

    Incorrect

    The tracking system lives in your network; a file upload isn't a live lookup of the parcel's status.

  • CWait for the agent service to call the tracking system on its own behalf

    Incorrect

    With a function tool the service never runs your code; it only asks your app to.

  • DStart a new conversation that includes the shipment status as plain text

    Incorrect

    A new conversation loses the pending call and the context of the user's question.

Function calling is a round trip: the model asks for a call, your app runs it and returns the output tied to the call_id, and the agent continues.

Question 4 · choose 1

A Foundry agent must call an internal inventory API hosted on Azure. The API publishes an OpenAPI 3.1 document and accepts only Microsoft Entra tokens. Security forbids storing any secret for this call. Which tool configuration should you use?

  1. AAn OpenAPI tool with API key authentication stored in a project connection
  2. BThe web search tool restricted to the API's host name with a site filter
  3. CAn OpenAPI tool with anonymous authentication and a private endpoint
  4. DAn OpenAPI tool that uses managed identity auth for the project's identity
Show the answer and why
  • AAn OpenAPI tool with API key authentication stored in a project connection

    Incorrect

    That keeps a secret in a connection, and the API doesn't accept keys.

  • BThe web search tool restricted to the API's host name with a site filter

    Incorrect

    Web search queries public web results; it can't call a private API's operations.

  • CAn OpenAPI tool with anonymous authentication and a private endpoint

    Incorrect

    The API rejects calls that carry no Entra token.

  • DAn OpenAPI tool that uses managed identity auth for the project's identity

    Correct

    OpenAPI tools support anonymous, API key and managed identity auth; managed identity grants the project's identity a role on the API and stores no secret.

Existing HTTP APIs with an OpenAPI 3.0 or 3.1 description plug in as OpenAPI tools. Choose the auth method the API accepts; for Entra-protected Azure APIs with no secrets allowed, that is managed identity.

Question 5 · choose 1

A team is starting a new support system. A triage agent talks to the customer and must pass control of the conversation to a billing agent or a technical agent, depending on what the customer needs; the specialist can pass it back. Which approach should they build on?

  1. AA group chat orchestration in Microsoft Agent Framework
  2. BA new workflow in the Foundry portal's visual workflow builder
  3. CA handoff orchestration in Microsoft Agent Framework
  4. DThe Connected Agents tool on the triage agent
Show the answer and why
  • AA group chat orchestration in Microsoft Agent Framework

    Incorrect

    In group chat, agents collaborate in one shared conversation; here one specialist at a time takes over the customer.

  • BA new workflow in the Foundry portal's visual workflow builder

    Incorrect

    Foundry is retiring workflows on December 1, 2026, and directs new development to Microsoft Agent Framework.

  • CA handoff orchestration in Microsoft Agent Framework

    Correct

    Handoff is the built-in pattern in which agents transfer control to each other based on context.

  • DThe Connected Agents tool on the triage agent

    Incorrect

    Connected Agents belongs to the classic Agents API and isn't available in the new Foundry Agent Service.

Agent Framework has several built-in orchestration patterns. A conversation that moves between specialists based on context is a handoff.

Question 6 · choose 1

A .NET agent built with Microsoft Agent Framework can issue refunds through a function tool. Refunds must not run until a support lead approves each one, but the agent should keep calling its other functions freely. What should you do?

  1. AAsk the model, in its instructions, to confirm with the lead before each refund
  2. BSet tool_choice to none whenever the user's message mentions a refund
  3. CRemove the refund function and email the lead the details of each refund
  4. DWrap the refund function in ApprovalRequiredAIFunction and resend the decision
Show the answer and why
  • AAsk the model, in its instructions, to confirm with the lead before each refund

    Incorrect

    An instruction isn't an enforced control; the model can still call the function.

  • BSet tool_choice to none whenever the user's message mentions a refund

    Incorrect

    That blocks every tool call in those turns, including the free ones, and never asks the lead.

  • CRemove the refund function and email the lead the details of each refund

    Incorrect

    The agent loses the ability to complete refunds after approval.

  • DWrap the refund function in ApprovalRequiredAIFunction and resend the decision

    Correct

    The run then completes with a request for approval instead of executing; the caller collects the decision and passes it back.

Human approval belongs in the tool definition, not the prompt. In Agent Framework, functions marked approval-required pause the run and return an approval request that your app answers in a new run.

Question 7 · choose 2

A deployed order agent often replies "I couldn't retrieve your order." Traces show it does call the order tool. You want evaluation results that separate tool calls that failed technically from calls that were sent wrong or badly formatted parameters. Which two evaluators should you run on the traced interactions? (Choose TWO.)

  1. ACoherence
  2. BTool Call Success
  3. CIntent Resolution
  4. DTool Input Accuracy
  5. ESimilarity
Show the answer and why
  • ACoherence

    Incorrect

    Coherence rates the logical flow of the reply, not what happened in the tool step.

  • BTool Call Success

    Correct

    Tool Call Success evaluates whether tool calls executed without technical failures.

  • CIntent Resolution

    Incorrect

    Intent Resolution checks whether the agent understood what the user wanted; here it did, and the tool step is what breaks.

  • DTool Input Accuracy

    Correct

    Tool Input Accuracy checks that call parameters are correct in grounding, type, format and completeness.

  • ESimilarity

    Incorrect

    Similarity compares response text with a reference answer and can't see tool calls.

Agent evaluators look inside the run. Tool Call Success isolates execution failures, Tool Input Accuracy isolates wrong arguments, and together they tell you which side of the tool call to fix.

Question 8 · choose 1

An operations team wants agents to investigate novel production incidents: the steps aren't known in advance, and a coordinator must plan, delegate to research, log analysis and coding agents, and adjust as findings arrive. Which Agent Framework orchestration fits?

  1. AConcurrent orchestration of the three specialist agents
  2. BSequential orchestration of the three specialist agents
  3. CGroup Chat orchestration with a round-robin manager
  4. DMagentic orchestration with a manager agent that plans
Show the answer and why
  • AConcurrent orchestration of the three specialist agents

    Incorrect

    No manager builds a plan here or changes it as findings come in.

  • BSequential orchestration of the three specialist agents

    Incorrect

    No manager tracks progress here or replans when an approach stalls.

  • CGroup Chat orchestration with a round-robin manager

    Incorrect

    A round-robin manager picks speakers in turn; it doesn't plan, track progress or replan the way the Magentic manager does.

  • DMagentic orchestration with a manager agent that plans

    Correct

    Magentic suits tasks whose solution path isn't known in advance; its manager plans, delegates, tracks progress and adapts the plan.

Magentic has the same architecture as Group Chat, with a manager that uses planning to coordinate the agents. If the scenario needs simpler coordination without complex planning, Group Chat is the lighter choice.

Question 9 · choose 1

An agent has eight tools, and reviewers suspect it often reaches for a slow general tool when a specific one would do. They want an evaluator that judges whether the most appropriate and efficient tools were chosen. Which one?

  1. AGroundedness
  2. BSimilarity
  3. CTool Selection
  4. DCoherence
Show the answer and why
  • AGroundedness

    Incorrect

    It judges the final answer, not which tools were chosen.

  • BSimilarity

    Incorrect

    Similarity compares a response with a reference text, not the tools the agent chose.

  • CTool Selection

    Correct

    Tool Selection measures whether the agent selected the most appropriate and efficient tools for a task.

  • DCoherence

    Incorrect

    Coherence rates the logical flow of replies.

Agent evaluators split tool use into several separate checks. Pick the one that matches the failure you suspect.

Question 10 · choose 1

A team wants to log the arguments of every function call its Agent Framework agent makes and mask account numbers in each function's result before the model reads it, without editing each function. Which Agent Framework feature fits?

  1. AFunction calling middleware registered on the agent
  2. BAgent run middleware that logs each run's input and output
  3. CA checkpoint manager on the agent's workflow
  4. DA rewrite of every function to log and mask its own data
Show the answer and why
  • AFunction calling middleware registered on the agent

    Correct

    Function calling middleware intercepts all function calls the agent executes so input and output can be inspected and modified.

  • BAgent run middleware that logs each run's input and output

    Incorrect

    Agent run middleware wraps whole runs; it can't change each function's result before the model reads it.

  • CA checkpoint manager on the agent's workflow

    Incorrect

    It belongs to workflows and doesn't intercept the function calls an agent makes.

  • DA rewrite of every function to log and mask its own data

    Incorrect

    That is the per-function editing the team wants to avoid.

Agent Framework middleware comes in agent run, function calling and chat client flavors, chained so each calls the next. Pick the layer that sees the data you need to change.

Question 11 · choose 1

A voice-based prompt agent calls a stock-lookup tool during live calls. Callers hear long silences and then very long answers read aloud. How should the tool design change?

  1. ARaise the tool's timeout so the agent waits quietly for the result
  2. BReturn only needed facts and speak a short progress line
  3. CReturn the full JSON payload so that the agent can read every field
  4. DGive the tool a longer description that asks for detailed answers
Show the answer and why
  • ARaise the tool's timeout so the agent waits quietly for the result

    Incorrect

    A longer silent wait is the dead air callers complain about; the guidance is a short spoken progress response when a call takes time.

  • BReturn only needed facts and speak a short progress line

    Correct

    For voice agents, keep tool output to what the turn needs and give a short spoken progress response when a call takes time.

  • CReturn the full JSON payload so that the agent can read every field

    Incorrect

    Long payloads lead to long spoken answers; return only what the agent needs for the current request.

  • DGive the tool a longer description that asks for detailed answers

    Incorrect

    The guidance keeps tool descriptions concise, and detailed answers make the spoken replies even longer.

Tool latency and response length shape a caller's experience. Design tools for voice with concise descriptions, small results and graceful handling of interruptions and empty results.

Question 12 · choose 1

A Python agent built with Microsoft Agent Framework forgets the user's name between two consecutive run calls in the same chat. What should the code do so that both calls share the conversation?

  1. ACreate an agent session and pass it to each run
  2. BRaise the model's max output tokens for each of the runs
  3. CAdd a checkpoint manager to the agent's run calls
  4. DCreate a new agent object for every message in the chat
Show the answer and why
  • ACreate an agent session and pass it to each run

    Correct

    An agent session holds conversation state, so runs in the same session see earlier turns.

  • BRaise the model's max output tokens for each of the runs

    Incorrect

    Output length doesn't preserve history.

  • CAdd a checkpoint manager to the agent's run calls

    Incorrect

    It doesn't hold chat history between an agent's runs.

  • DCreate a new agent object for every message in the chat

    Incorrect

    New agents start without the earlier turns.

In Agent Framework, sessions carry state between runs and context providers can enrich them; both are part of the framework's building blocks.

Practise domain 2 →Practise all domains →