# Quiz — Session 3 (Advanced): Claude Agent SDK

> **Program:** Applied AI — Yann Isola
> 10 MCQs (Multiple Choice Questions) — only one correct answer per question, unless otherwise stated.
> Level: preparation *Claude Certified Architect*. Correction commented at the end of the document.

---

**Q1.** In the Claude Agent SDK (Software Development Kit), which component executes the agentic loop (sending messages, executing tool calls, iterating until final response)?

- A. Class `Agent`
- B. The decorator `@tool`
- C. The `Runner`
- D. The hook `on_agent_start`

**Q2.** When defining a tool with `@tool`, where does the **description** passed to the model come from?

- A. From the function name only
- B. From the function docstring
- C. A mandatory decorator parameter `description=`
- D. It is automatically generated by the model on first use

**Q3.** How does the SDK construct the **parameters schema** of a tool?

- A. From type annotations (type hints) of the Python signature
- B. By analyzing the function body at runtime
- C. You must write the JSON (JavaScript Object Notation) schema by hand
- D. Parameters are always passed as a single string

**Q4.** What is the fundamental difference between a **handoff** and a **tool call**?

- A. The handoff is faster because it avoids a call to the model
- B. Tool call transfers the complete history, handoff only the arguments
- C. After a handoff, the target agent maintains control of the conversation; after a tool call, the calling agent takes control
- D. There is no difference: the handoff is a tool call alias

**Q5.** An **input guardrail** triggers its tripwire. What is happening?

- A. The message is automatically reformulated then returned to the model
- B. The run is interrupted and a dedicated exception (`InputGuardrailTripwireTriggered`) is thrown, to be intercepted by the application
- C. The agent automatically switches to a more secure model
- D. The guardrail is disabled for the rest of the run

**Q6.** A coordinator must be able to delegate work to subagents in the Claude execution environment. What configuration is **essential**?

- A. `max_turns` greater than 50
- B. An output guardrail on each sub-agent
- C. The `"Task"` tool present in the coordinator's `allowedTools`
- D. The same model for the coordinator and the sub-agents

**Q7.** What is the role of **context variables** (generic parameter `Agent[MonContexte]`)?

- A. Inject additional text into the system prompt
- B. Share a typed state between agents, tools, guardrails and hooks, **without** exposing it to the model
- C. Cache the model responses between two runs
- D. Store chat history persistently

**Q8.** You run five independent analyzes in parallel with `asyncio.gather(...)`. Which option prevents a single failure from canceling all four successes?

- A.`timeout=None`
-B.`return_exceptions=True`
- C.`max_turns=1`
- D. Wrap each task in an output guardrail

**Q9.** A trainer shows this delegation code: `Runner.run(agent_redacteur, "Rédige la section 2.")`. Why is this an anti-pattern?

- A. `Runner.run` cannot be called on a subagent
-B.The subagent does not share the coordinator's working memory: without a plan, tone, context and deliverable expected in the prompt, the output will be off-topic
- C. Always use `run_async` for subagents
- D. The prompt string is too short to be billed

**Q10.** A tool `initier_remboursement` can be retried after a timeout. Which architectural precaution has priority?

- A. Increase the timeout to 10 minutes
- B. Remove the tool from the list and replace it with instructions
- C. Make the tool idempotent (idempotence key) so that a retry does not trigger two refunds
- D. Entrust the tool to a more powerful model

---

## Fixed commented

| Q | Answer | Explanation |
|---|---------|-------------|
| 1 | **C** | The `Runner` orchestrates the loop: sending, detection of tool calls, execution, iteration. `Agent` is only a declarative configuration. |
| 2 | **B** | The docstring IS the description sent to the model — it's a prompt engineering artifact, it should tell when to use the tool. |
| 3 | **A** | Type hints (`str`, `int`, default values…) are converted to JSON schema. Complex types: Pydantic/`TypedDict`. |
| 4 | **C** | Handoff = transfer of control + history; the target agent continues the conversation. Tool call = one-off capacity, the caller regains control. |
| 5 | **B** | Tripwire → run interruption + dedicated exception. It is up to the application to provide the fallback response (never stack trace to the user). |
| 6 | **C** | Without `"Task"` in `allowedTools`, the coordinator cannot create subagents — it will attempt to do everything alone, silently. Classic exam trap. |
| 7 | **B** | Context variables are never serialized in the prompt: ideal for identifiers, secrets, application state. Only what the tools return reaches the model. |
| 8 | **B** | `return_exceptions=True` reports exceptions as values: we collect successes and treat failures separately. |
| 9 | **B** | “Amnesiac subagent” anti-pattern: everything the subagent needs to know (plan, tone, context, deliverable format) must be in its prompt. |
| 10 | **C** | A financial side effect repeated without idempotence = double reimbursement. The key to idempotence is structural precaution; the timeout is just a parameter. |

**Scale:** 1 point per question. ≥ 8/10: ready for this area of ​​certification. 6–7: review handoffs and guardrails. < 6: repeat the session with the exercises.