All 190 practice questions with answers
Every question in the quiz with its correct answer, a short explanation and a link to the documentation. Search for a word or a question ID, or switch to By section to open one sub-skill at a time. Want to test yourself first? Play the quiz.
190 questions
D1 Advanced Agent Architecture and Orchestration 32 questions ยท 17% of exam
Agent architecture and orchestration (12)
At SummitBridge Advisory, you work as a senior software engineer. The firm's research copilot carries out analysis jobs lasting several hours across public sources on markets and industries. Its agents search for, read, and synthesize documents, build up working notes, and deliver briefs with citations to consultants. Jobs last long enough to run into context limits, and cost, accuracy, and citation quality are all the team's responsibility. Each night the copilot loads public sources into an index of embeddings, and according to consultants, the briefs leave out articles and filings published that same day. The team also spends one engineer-day per week fixing ingestion jobs and re-embedding sources that have changed. For the way the copilot gathers sources, which retrieval approach is the right one?
- A) Use a bigger embedding model on the index built nightly
- B) Re-embed new and modified sources every hour
- C) Add a stage that reranks the candidates from the nightly index
- D) Use agentic search to query sources live at run time
โ Answer: D
The problems are stale content and the upkeep of an ingestion pipeline. Agentic search reads live sources at run time, so same-day material is available and there is no index to repair or re-embed. A bigger model or a reranker cannot find documents that are not indexed, and hourly re-embedding still lags while adding upkeep.
Source: www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
At SummitBridge Advisory, you work as a senior software engineer. The firm's research copilot carries out analysis jobs lasting several hours across public sources on markets and industries. Its agents search for, read, and synthesize documents, build up working notes, and deliver briefs with citations to consultants. Jobs last long enough to run into context limits, and cost, accuracy, and citation quality are all the team's responsibility. Execution infrastructure for the copilot is looked after by a platform team of two engineers. This quarter's on-call records trace 30 of the 41 incidents to the in-house code for checkpointing, state storage, and recovery from disconnections, not to how the prompts or model behaved. Jobs spanning several hours have to withstand a client disconnecting and then resume with their progress preserved. The team is assessing a managed agent harness that offers hosted execution, management of state, and tracing of execution. What would you advise?
- A) Bring on one more platform engineer and strengthen the in-house execution stack.
- B) Shift state storage into a managed database while retaining the other in-house components.
- C) Switch to the managed harness and redirect the team's effort to prompts, evaluation, and the quality of jobs.
- D) Rewrite the checkpoint layer using the orchestration framework that the team already runs.
โ Answer: C
Most incidents come from infrastructure the team built itself, which a managed harness already provides, including state, recovery and tracing. Adopting it frees two engineers for the work specific to the product. Adding staff, swapping one component or rebuilding checkpoints leaves the team owning the same failure-prone layer.
At SummitBridge Advisory, you work as a senior software engineer. The firm's research copilot carries out analysis jobs lasting several hours across public sources on markets and industries. Its agents search for, read, and synthesize documents, build up working notes, and deliver briefs with citations to consultants. Jobs last long enough to run into context limits, and cost, accuracy, and citation quality are all the team's responsibility. The copilot is being moved onto a managed platform for agents, which has a memory feature in beta that preserves curated records from one session to the next. One engineer suggests that before each session begins, the complete working notes of every job be loaded into shared memory. Analysis for one engagement must never be influenced by notes belonging to another, and it must still be possible to resume interrupted jobs without trouble. What would you advise?
- A) Keep shared memory for lasting practices that apply across jobs, and hold the notes for each job in that job's persisted workspace.
- B) Turn the memory feature off and depend on the session transcript to bring state from one job to the next.
- C) Put every note into shared memory, labeling each record with its engagement name so it can be filtered.
- D) Load complete notes from all active jobs into shared memory, and clear each job's notes when it closes.
โ Answer: A
Shared memory is for knowledge that should apply to every job, while engagement notes belong in that job's own persisted workspace. This isolates engagements structurally and still lets an interrupted job resume. Tags depend on filtering never failing, loading all notes mixes engagements, and disabling memory gives up cross-job learning without improving resumption.
At NorthStar Hospitality, you work as a senior software engineer. A concierge agent serves guests at the company's properties in Lisbon, Osaka, and Vancouver, backed by a shared platform team and configured separately for each property. It handles questions about the property, uses booking and housekeeping tools to coordinate requests, and has to stay inside strict cost and latency budgets in all regions. A contractor suggests redesigning the concierge around a supervisor that directs four subagents in parallel, one per category of tools. Today, a single agent that holds all the tools answers an everyday question about a property in four seconds. Analysis of traffic shows that 90% of guest requests are settled with one or two tool calls that depend on each other. What would you advise?
- A) Keep using one agent, and save parallel subagents for requests made up of independent subtasks.
- B) Divide the tools between two agents running in sequence that pass every request from one to the other.
- C) Move to the design with a supervisor and four parallel subagents for all guest requests.
- D) Use a trained classifier to send every guest request to its own dedicated subagent.
โ Answer: A
Most requests need one or two dependent steps, so parallel subagents have little to run in parallel and add coordination, latency and cost. The single agent already answers quickly. Use parallel subagents only for work that divides into independent parts; the other designs add handoffs or routing to every request.
Source: www.anthropic.com/engineering/building-effective-agents
At NorthStar Hospitality, you work as a senior software engineer. A concierge agent serves guests at the company's properties in Lisbon, Osaka, and Vancouver, backed by a shared platform team and configured separately for each property. It handles questions about the property, uses booking and housekeeping tools to coordinate requests, and has to stay inside strict cost and latency budgets in all regions. A guest asks for help planning an evening, which sets off three tool calls: one looks up restaurants, one checks whether the spa is available, and one gets the weather. According to a trace, the integration executes them in sequence, and each spends one second waiting on an external service. Of a response lasting four seconds, three go to the tool phase, and no lookup uses the output of any other. What action should you take?
- A) Combine the three lookups into a single aggregate tool that returns one merged payload.
- B) Run the three calls at the same time and send back all their results in a single user message.
- C) Run the three calls at the same time and send each result back in a separate user message.
- D) Insert a cache breakpoint before the block that holds the property configuration.
โ Answer: B
The lookups do not depend on one another, so running them concurrently cuts about three seconds of waiting to about one. All results from one assistant turn should go back together in a single user message. Splitting them across messages breaks the expected tool-result format, an aggregate tool is unnecessary, and caching does not reduce external waiting.
Source: platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use
At CargoSpan Logistics, you work as a platform engineer. Shipment planning across sea, rail, and road is coordinated by the company's multi-agent system. Route planning, exception handling, and customs paperwork are delegated by a supervisor agent to worker agents, which in turn call tracking and carrier tools. Live operations in Rotterdam, Singapore, and Chicago depend on the system, and its long-running jobs have to survive both model upgrades and restarts. Partway through a job, the orchestrator swapped out a worker container, and the new one resumed the interrupted session with the whole transcript. On the first model turn after resuming, the carrier booking tool was requested; the harness said the tool was unknown, and the job stopped. The first container had connected the carrier and tracking tool servers at the time its agent process launched. Any job that resumes must have all the tools its transcript already uses. What action should you take?
- A) Set up the new container so that it connects the identical tool servers before resuming any session.
- B) Add a turn naming the tools that are unavailable and telling the model to carry on without them.
- C) Save the connections to the tools in the session transcript along with the recorded turns.
- D) Remove recorded calls to carrier tools from the transcript before the new container resumes from it.
โ Answer: A
A transcript restores the conversation, not live connections in a process. The new container must set up the same tool servers before resuming so that the tools used earlier are available. Telling the model to skip them or editing history loses capability or truth, and a live connection cannot simply be stored in a transcript.
Source: code.claude.com/docs/en/agent-sdk/mcp; code.claude.com/docs/en/agent-sdk/sessions
At CargoSpan Logistics, you work as a platform engineer. Shipment planning across sea, rail, and road is coordinated by the company's multi-agent system. Route planning, exception handling, and customs paperwork are delegated by a supervisor agent to worker agents, which in turn call tracking and carrier tools. Live operations in Rotterdam, Singapore, and Chicago depend on the system, and its long-running jobs have to survive both model upgrades and restarts. From time to time, jobs for customs paperwork fail while worker agents are calling carrier tools. Those calls contain shipper documents that are commercially sensitive, and under the compliance standard, no document text may enter the observability stack. Engineers on call still have to pin down which tool call failed and for what reason. What action should you take?
- A) Record the full payload of requests that fail, and no others, deleting those records once each incident has been reviewed.
- B) When an incident review begins, rerun the failed jobs in staging using synthetic documents.
- C) Log a single success-or-failure flag per completed job, and send a page when failures become more frequent.
- D) On every tool-call span, capture the tool name, size of arguments, class of error, latency, and number of retries as attributes.
โ Answer: D
Tool name, argument size, error class, latency and retry count are enough to locate and diagnose a failing call without capturing document text. Storing failed payloads still puts sensitive text into observability, synthetic reruns may not reproduce the fault, and one flag per job cannot identify the failing call.
Source: code.claude.com/docs/en/agent-sdk/observability; code.claude.com/docs/en/monitoring-usage
At CargoSpan Logistics, you work as a platform engineer. Shipment planning across sea, rail, and road is coordinated by the company's multi-agent system. Route planning, exception handling, and customs paperwork are delegated by a supervisor agent to worker agents, which in turn call tracking and carrier tools. Live operations in Rotterdam, Singapore, and Chicago depend on the system, and its long-running jobs have to survive both model upgrades and restarts. At CargoSpan Logistics, there are 340 tools for carriers, customs, and tracking that worker agents can call. Before any planning begins, loading all their schemas uses up one third of the context window, and as the catalog expanded, the agents became less accurate at choosing tools. What approach meets this need?
- A) Merge everything into one tool where an action parameter names which operation to run
- B) Divide the catalog evenly between two worker agents
- C) Write briefer descriptions for each tool listed in the catalog
- D) Provide a tool for searching tools, and defer loading the full catalog until tools are discovered
โ Answer: D
Tool search keeps most schemas out of context until they are needed, which saves space and narrows the choices the model sees. One giant action tool hides the same complexity, two halves are still very large, and shorter descriptions can make choosing the right tool harder.
Source: platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool
At CargoSpan Logistics, you work as a platform engineer. Shipment planning across sea, rail, and road is coordinated by the company's multi-agent system. Route planning, exception handling, and customs paperwork are delegated by a supervisor agent to worker agents, which in turn call tracking and carrier tools. Live operations in Rotterdam, Singapore, and Chicago depend on the system, and its long-running jobs have to survive both model upgrades and restarts. Three plans for routes were turned down by the supervisor agent because none of them could be parsed as JSON. The trace of delegation shows that the worker agent for route planning produced every one of them in a single turn. Each worker response on record breaks off partway through an array. For all three turns, the trace logs an identical count of output tokens, even though the three requests are for routes that differ in how many stops they have. What most likely explains this?
- A) While reading what came back from delegation, the supervisor agent lost the tail of every plan.
- B) Bad data returned by the carrier tool corrupted every one of the plans.
- C) In every plan, the worker agent for route planning wrote array syntax that was not valid.
- D) The limit set on output tokens is too low to fit a whole route plan.
โ Answer: D
Different route sizes ending at the same output token count, each partway through an array, is the sign of a fixed output cap truncating the response. The stop reason should confirm max_tokens. Data or syntax errors would not be expected to stop at an identical token count, and the recorded worker response is already incomplete before the supervisor reads it.
Source: platform.claude.com/docs/en/build-with-claude/handling-stop-reasons
At CargoSpan Logistics, you work as a platform engineer. Shipment planning across sea, rail, and road is coordinated by the company's multi-agent system. Route planning, exception handling, and customs paperwork are delegated by a supervisor agent to worker agents, which in turn call tracking and carrier tools. Live operations in Rotterdam, Singapore, and Chicago depend on the system, and its long-running jobs have to survive both model upgrades and restarts. Overnight, the supervisor agent handed the worker that handles exceptions a rerouting task for Rotterdam. Unable to solve the closure of the port, the worker sent the task back unfinished. The supervisor then handed it out again with exactly the same brief, and this loop went on until morning. In doing so it used up the token budget that CargoSpan Logistics sets aside for all of its live shipment operations. What would you advise?
- A) Have the supervisor limit how many times any task can be delegated, and send tasks that hit the limit to an operator.
- B) Make the supervisor rewrite the brief each time before delegating a returned task again.
- C) Shift all the work of rerouting into the supervisor and retire the worker that handles exceptions.
- D) Move the exception-handling worker to the latest Opus-tier model and hand it the task once more.
โ Answer: A
The loop has no stopping condition. A per-task delegation limit with escalation to an operator bounds cost and gets help for a problem the agents cannot solve. A rewritten brief or stronger model can still loop, and moving the work to the supervisor does not resolve the port closure or add a limit.
Source: code.claude.com/docs/en/agent-sdk/agent-loop; www.anthropic.com/engineering/multi-agent-research-system
You are a platform engineer employed by FieldStone Foods. Scheduled agents at the company monitor production telemetry, reconcile quality reports from suppliers, and submit exception summaries ahead of every shift. No one attends these runs, so they must fail safe and hand off to a human whenever the evidence is ambiguous. Checkpoints in long reconciliations ensure that restarting never repeats a posting that has already completed. The agent that does reconciliation works in a loop that alternates model turns with tool calls, and if the host restarts, the loop may be cut off at any moment. When a run is resumed, it has to carry on with its entire history, and a posting that has completed must never be made again. What design for persistence is the right choice?
- A) Write to a durable log each turn's tool request before executing the call and its result afterward
- B) Save only the list of completed postings, and begin the conversation again from the system prompt
- C) Save the last assistant message from every cycle, rerunning earlier tool calls to reconstruct their results
- D) Save only the session identifier, relying on the model's memory to bring back the conversation when resuming
โ Answer: A
Recording each tool request before it runs and its result afterward in a durable log preserves the full history and shows which actions were started or completed. An unfinished entry for a posting must be checked, or protected with an idempotency key, before retrying. The other designs lose history or rerun calls, and model memory is not a durable store.
Source: code.claude.com/docs/en/agent-sdk/session-storage; code.claude.com/docs/en/agent-sdk/sessions
You are a senior software engineer employed by SignalWave Media. The company has a production pipeline that tags a transcript archive, writes drafts of program notes, and produces summaries of wire feeds. It handles large volumes, editors spot-check the outputs for quality, and the team tracks changes in cost and quality on live traffic instead of waiting on offline suites. A change to a prompt was pushed by an engineer straight to all production traffic, and for six hours the quality of summaries suffered until it was rolled back. The postmortem on the incident asks for a single measure that tackles the underlying systemic cause. What would you advise?
- A) Hold a weekly session in which editors and the on-call engineer review the quality of summaries in production.
- B) Make approval from another engineer mandatory before any change to a prompt reaches production.
- C) Limit the right to deploy prompts to the two engineers with the most seniority.
- D) Send all prompt changes through an eval gate and then a canary stage before they reach all traffic.
โ Answer: D
The systemic cause is that a change could reach all users without automated testing or limited exposure. An eval gate plus a canary addresses both for every change. A weekly review is late, and extra approval or tighter permissions still allows an untested change to reach all traffic.
Source: sre.google/workbook/canarying-releases/; www.anthropic.com/engineering/demystifying-evals-for-ai-agents
Agent construction (3)
A legal-tech team wants to extract five fixed fields from every uploaded contract. The steps never vary, the fields are known in advance, and reviewers check the output. An architect proposes an autonomous agent with file, search and shell tools. What should you recommend?
- A) Five parallel subagents that each own one field and vote on the final record
- B) An open-ended agent loop with a large turn limit and a self-review step
- C) A supervisor agent that decides at run time which of the five fields to extract
- D) A single structured extraction call, adding steps only if measured quality falls short
โ Answer: D
Anthropic advises the simplest solution that works and adding agentic complexity only when it measurably helps. The path and the output are fully known here, so a single call is cheaper, faster and easier to test than any design that plans at run time.
Source: www.anthropic.com/engineering/building-effective-agents
An agent has one broad shell tool. The product now needs user confirmation before any email is sent, but the harness only sees command strings. What is the best change?
- A) Ask the model to add a comment when a command will send an email
- B) Lower the effort setting so that the agent sends fewer emails
- C) Give email sending its own typed tool that the harness can gate
- D) Search each command string for the word email before running it
โ Answer: C
A dedicated tool gives the harness an action-specific hook with typed arguments that it can gate, render and audit. String matching on shell commands is easy to evade, and a comment is not enforcement.
An agent must read 400 expense records, filter them and total a few. With standard tool use, every record passes through the model's context. Which approach cuts round trips and context use most directly?
- A) A larger output limit, so the model can write out the records it has read
- B) Programmatic tool calling, so code calls the tool and returns only the final result
- C) Parallel tool calls, so all 400 records enter the context in a single turn
- D) Tool search, so the record tool's definition is loaded only when needed
โ Answer: B
With programmatic tool calling, results go to running code that filters and aggregates them, and only the final output reaches the model. Parallel calls reduce turns but still load every record into context.
Source: platform.claude.com/docs/en/agents-and-tools/tool-use/programmatic-tool-calling
Workflow patterns (2)
A coding tool must change an unknown set of files for each request. The number of files and the edit needed in each depend on the request itself. Results must be combined into one change set. Which pattern fits?
- A) Sectioning, where a fixed list of subtasks is defined in code before any request arrives from a user
- B) Prompt chaining, where every file in the repository passes through the same steps
- C) Orchestrator-workers, where a lead model breaks the task down at run time and merges results
- D) Routing, where each request is sent to one of several prompts tuned for a file type
โ Answer: C
Orchestrator-workers is meant for tasks whose subtasks cannot be predicted in advance. Sectioning looks similar but needs predefined subtasks, and routing or chaining assumes the path is known.
Source: www.anthropic.com/engineering/building-effective-agents
A content platform screens user posts for policy violations. A missed violation is costly, single checks are inconsistent, and each check is cheap and independent. Which design raises confidence most directly?
- A) One sequential chain in which each check sees and edits the previous check's verdict in order
- B) One check per post at a higher output limit so the reasoning can run longer
- C) One lead agent that plans new kinds of checks for every post it receives
- D) Several independent checks in parallel, with a vote threshold tuned to the cost of a miss
โ Answer: D
Parallel voting runs the same task several times for diverse judgments, and the threshold balances false positives against misses. A sequential chain loses independence because later checks are anchored by earlier ones.
Source: www.anthropic.com/engineering/building-effective-agents
Multi-agent orchestration (5)
A research system answers simple factual lookups by launching ten subagents, the same number it uses for broad market studies. Costs are high and the lookups are slow. What should you change first in the lead agent's instructions?
- A) Add effort-scaling rules that match the number of subagents and tool calls to query complexity
- B) Add a rule that the lead may use only one subagent for any query of any size
- C) Add a rule that every subagent must finish within the same fixed number of seconds
- D) Add a rule that the lead must always verify each lookup with a second group of subagents before it answers
โ Answer: A
Anthropic's research system embeds scaling guidelines so that simple fact-finding uses one agent with a few calls while complex research uses many. A flat cap of one would cripple the broad studies that benefit from parallel work.
Source: www.anthropic.com/engineering/multi-agent-research-system
Subagents return long reports through the lead agent, which rewrites them into a final document. Details are lost at each rewrite, and the lead's context fills with text it only passes on. Which change addresses both problems?
- A) Have the lead ask every subagent to repeat its full report before the final rewrite is written
- B) Have subagents write results to an external store and return short references to the lead
- C) Have the lead call a larger model only for the final rewriting step
- D) Have subagents shorten reports to one sentence so the lead can hold all of them
โ Answer: B
Storing outputs outside the conversation and passing lightweight references avoids the loss of a relay through the lead and keeps its context small. One-sentence reports keep context small but discard the detail.
Source: www.anthropic.com/engineering/multi-agent-research-system
A lead researcher may exceed its context window during a long investigation. The team has seen it lose the original plan after its context was truncated. What should the design do?
- A) Repeat the plan in every subagent's final report so the lead can rebuild it
- B) Increase the number of subagents so the lead has less of its own work to plan and remember
- C) Ask the lead to keep its plan as short as possible from the first turn onward
- D) Save the plan to external memory early and read it back when the context is reset
โ Answer: D
Saving the plan to memory at the start lets the lead recover it after truncation. A short plan still disappears when the context is cut, and subagent reports are not a reliable place to keep orchestration state.
Source: www.anthropic.com/engineering/multi-agent-research-system
A startup replaces a chat answer flow with a multi-agent design and finds that token use rises about fifteen times. Answers are only slightly better, and each one is worth a few cents to the business. What should you conclude?
- A) The task's value does not justify multi-agent token cost, so a simpler design fits better
- B) The lead agent needs more subagents before the quality gain becomes visible
- C) The design is sound because multi-agent systems always cost more at the start
- D) The subagents need the full chat history so that less work is repeated
โ Answer: A
Anthropic reports that multi-agent systems use about fifteen times the tokens of chat, so they suit tasks whose value covers that cost. Adding agents or history raises cost further without changing the economics.
Source: www.anthropic.com/engineering/multi-agent-research-system
An architect relies on a custom subagent to follow a house style that was set in the main session with an output style. The subagent's reports ignore that style, although they follow the project's CLAUDE.md. What explains this?
- A) The output style is applied only after a subagent has been resumed once
- B) CLAUDE.md is loaded into the subagent, but the main session's output style is not
- C) The subagent loads both, but its smaller model drops the output style before anything else
- D) CLAUDE.md is loaded only by subagents that run in the background by default
โ Answer: B
A custom subagent starts with its own system prompt, the delegation message and the CLAUDE.md hierarchy. The main conversation's output style does not reach it, so the style must be put in the subagent definition or in CLAUDE.md.
Context management (4)
A support agent's answers get worse as its conversation grows, although the total stays below the context window limit. Old tool results make up most of the tokens and are never used again. What should you try first?
- A) Copy the whole history into the system prompt so that it has more weight on every turn
- B) Raise the output limit so that the agent can quote more of its history
- C) Switch to a model with a larger window and keep every old tool result
- D) Clear old tool results from the context and keep the recent, relevant ones
โ Answer: D
Context is a finite resource whose quality falls as low-value tokens build up. Clearing stale tool results is one of the safest forms of context reduction, while a larger window leaves the noise in place.
Source: www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
An agent loads every customer document into its prompt before starting, although each task needs two or three of them. Latency is high and relevant details are missed. Which approach follows context-engineering guidance?
- A) Send all the documents twice so that the important details are repeated
- B) Summarize all the documents into one paragraph that is sent with each task
- C) Sort the documents by length so that the shortest ones appear first in the prompt every time
- D) Keep lightweight identifiers in context and let the agent load documents when needed
โ Answer: D
Just-in-time retrieval keeps references such as paths or IDs in context and loads content through tools on demand. One paragraph for everything loses detail, and repeating documents adds noise and cost.
Source: www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
A chat service turns on server-side compaction. Its code saves only the assistant's text to history and drops the other content blocks. Long conversations keep growing and keep re-triggering compaction. What is the fix?
- A) Append the full response content, including compaction blocks, to the history
- B) Send the summary text as a new user message at the start of each request
- C) Move the saved text into the system prompt before the next request is sent
- D) Lower the compaction trigger so that the summary is produced on an earlier turn
โ Answer: A
Compaction state travels in a compaction block that must be passed back. Saving only the text drops the block silently, so the API never sees that the earlier history was already replaced.
Source: platform.claude.com/docs/en/build-with-claude/compaction
A coding agent works on one application across many sessions, each with a fresh context. New sessions often redo finished work or declare the project complete too early. Which setup best addresses this?
- A) A larger context window so that every earlier transcript fits into each new session
- B) A second agent that repeats each session and compares the two final summaries
- C) A progress log and a feature list with pass or fail status, read at the start of each session
- D) A final instruction in each session asking the agent to remember where it stopped
โ Answer: C
Structured artifacts on disk, such as a progress file, a feature list with status and git history, let a fresh session see what is done and what remains. A request to remember does not carry over to a new context.
Source: www.anthropic.com/engineering/effective-harnesses-for-long-running-agents
Durable execution (4)
A hosted Agent SDK service uses a SessionStore and can resume conversations on any node. After a move, sessions resume with the right conversation, but files the agent had created are missing. What explains this?
- A) The SessionStore writes files only when a session has ended without an error
- B) The SessionStore mirrors transcripts only, so working files need their own storage
- C) The resumed session must be started with a higher turn limit to restore files from the old node
- D) The transcript was compacted, which also removes files from the new node
โ Answer: B
A SessionStore adapter mirrors transcripts, not CLAUDE.md memory files or working-directory artifacts. Those need a mounted volume or an object-store sync.
A team treats its SessionStore as a guaranteed record and sets no alerts. During a storage outage, sessions continued normally, but some could not later be resumed in full. Which signal should the team monitor?
- A) The count of turns that each session used before it reached its limit
- B) The system messages with subtype mirror_error that report dropped batches
- C) The exit code of each container that hosted a session during the outage
- D) The number of tool calls that asked a user for permission during the outage
โ Answer: B
Mirroring is best effort. When a batch cannot be delivered, the SDK drops it, emits a mirror_error system message and continues, so alerts on that message are needed when durability matters.
Users of a project assistant return a few times a day and leave it idle for hours. The team wants low compute cost and continuity between visits. Which hosting pattern fits?
- A) Ephemeral containers that load the session from a shared store and save it back
- B) One shared container where all users continue a single common session
- C) One permanent container for each user that keeps every session in memory
- D) Ephemeral containers that start a new session each time the user returns
โ Answer: A
The hybrid pattern spins containers down when idle and hydrates them from a SessionStore when the user returns. Permanent containers waste compute, and fresh sessions lose continuity.
A service keeps many live Agent SDK sessions in memory across a pool of containers. Follow-up messages often reach a container that does not hold the session. What should the routing layer do?
- A) Start a new session on whichever container receives the follow-up message
- B) Send each message to the container that has the lowest processor use at that moment in the whole pool
- C) Pin each session to one container, for example by consistent hashing on the session ID
- D) Send each message to every container and keep the first answer that is returned
โ Answer: C
A live session is tied to one subprocess, so long-running deployments pin each session to a container. Least-loaded routing suits stateless services and breaks the link between session and process.
Managed agents (2)
A Managed Agents session must produce one compliance report that meets a strict checklist. The team wants the agent to keep revising until it passes, judged by something other than the agent itself. What should it use?
- A) A scheduled deployment that starts a new session for every checklist item
- B) A higher effort setting, so the agent checks its own report more often
- C) A user message that repeats the checklist until the report looks complete
- D) An outcome with a rubric, so a separate grader scores each iteration
โ Answer: D
Defining an outcome with a rubric starts a loop in which a grader with its own context scores the work per criterion and returns gaps for revision. Self-checks share the agent's blind spots.
Source: platform.claude.com/docs/en/managed-agents/define-outcomes
A team's outcome loops use all their iterations without finishing. The rubric says that the dataset must be high quality and look professional. What should change first?
- A) Send extra messages during the run that ask the agent to keep going
- B) Remove the rubric so that the agent can decide when the work is done
- C) Rewrite the rubric as specific criteria that can each be graded on their own
- D) Raise the iteration limit so that the grader has more chances to agree on the final result
โ Answer: C
The grader scores each criterion independently, so vague wording gives noisy results that never settle. Concrete criteria, such as a numeric price column with no empty rows, make the loop converge.
Source: platform.claude.com/docs/en/managed-agents/define-outcomes
D2 Production Integration, Reliability, and Knowledge Grounding 38 questions ยท 20% of exam
Integration reliability and grounding (14)
At SunPeak Operations, you work as a site reliability engineer. The business runs a copilot for field operations, which supports technicians as they troubleshoot inverter faults, prepare work orders, and condense sensor readings from solar sites. Both uptime and quality SLOs apply to the service, instrumentation covers it end to end, and incident response for any quality or availability regression is led by your team. Although an incident at the provider is over, the copilot keeps showing an elevated error rate for 40 more minutes. In the request log, HTTP 529 overloaded_error responses arrive in waves spaced at regular intervals, with every wave bigger than the previous one. All client instances retry failed calls using an identical deterministic backoff schedule, and the number of retries is unlimited. What most likely explains this?
- A) Recovered clients remain pinned by the connection pool to the endpoint that failed
- B) After recovery, batch jobs that had been queued empty into the interactive endpoint
- C) Clients retry in lockstep, recreating the overload each time the shared backoff interval comes around
- D) As the incident closed, the provider lowered its rate limit
โ Answer: C
Clients that share one deterministic backoff schedule retry at the same moments, so each retry round hits the recovering service together. With no retry cap, new failures join the earlier retriers and every wave grows. Jitter and a retry limit break this pattern; the other causes do not explain growing waves at fixed intervals.
Source: sre.google/sre-book/addressing-cascading-failures/; platform.claude.com/docs/en/api/errors
At SummitBridge Advisory, you work as a senior software engineer. The firm's research copilot carries out analysis jobs lasting several hours across public sources on markets and industries. Its agents search for, read, and synthesize documents, build up working notes, and deliver briefs with citations to consultants. Jobs last long enough to run into context limits, and cost, accuracy, and citation quality are all the team's responsibility. To know what needs checking before delivery, consultants want every section of a brief to carry a confidence indicator. An engineer's suggestion is to show the average cosine similarity across the passages retrieved for that section. What would you advise?
- A) Display, for every section, the average similarity score of its retrieved passages.
- B) Have the model attach to every section a percentage rating its own confidence.
- C) Display how many sources the agent read for every section.
- D) Report what proportion of each section's claims cite a passage that supports them.
โ Answer: D
Consultants need to know which claims are backed by evidence. The share of claims in a section that cite a supporting passage measures that directly and shows where to verify. Similarity shows only topical closeness, a self-rating is not a calibrated measure, and a source count does not show that any claim is supported.
Source: platform.claude.com/docs/en/build-with-claude/citations
You are a site reliability engineer employed by ShopFlow Retail. On the Claude API, the company operates a shopping assistant for its storefront, along with a batch pipeline that enriches the product catalog each night. Latency targets are tight, traffic arrives in steep peaks, and whenever limits or failures hit, the integration layer has to degrade gracefully. No payment or identity data is held by the assistant, which works only with the public catalog and order-status tools. Before answers show up on the storefront, shoppers say they see an empty response panel. Every answer contains both prose and a structured block for product cards, and the client renders cards only when it has a full card block that has passed schema validation. At present the integration sends the response in one piece once generation has finished. According to telemetry, a typical answer takes six seconds to generate in total, while the API delivers the first token in less than 500 milliseconds. Your solution has to satisfy two requirements: โข Every request begins showing output within one second. โข A product card is rendered only from a complete card block that has passed schema validation. What action should you take?
- A) Stream the answer and have the browser display each token the moment it arrives.
- B) Produce the prose and the card block through two requests made one after the other, validating the block before rendering it.
- C) Continue delivering buffered responses but shift the storefront route onto a quicker model tier.
- D) Stream the answer, showing prose as soon as it comes in while holding back the card block until it passes validation.
โ Answer: D
Streaming lets prose appear as soon as the first tokens arrive, well within one second, while buffering only the card block preserves the rule that cards render after validation. Rendering every token would expose incomplete card data. A faster model with buffering still waits for the full response, and two sequential requests add complexity without being needed.
Source: platform.claude.com/docs/en/build-with-claude/streaming
You are a site reliability engineer employed by ShopFlow Retail. On the Claude API, the company operates a shopping assistant for its storefront, along with a batch pipeline that enriches the product catalog each night. Latency targets are tight, traffic arrives in steep peaks, and whenever limits or failures hit, the integration layer has to degrade gracefully. No payment or identity data is held by the assistant, which works only with the public catalog and order-status tools. While a catalog release is under way, a badly formed tool definition makes HTTP 400 invalid_request_error responses surge in the logs of the assistant's integration layer. The middleware that handles retries regards any status other than 200 as transient, so it retries every failure five times, backing off exponentially. As the bad requests are retried and keep failing, latency alerts go off. What action should you take?
- A) Introduce jitter into the exponential backoff used for retries
- B) Raise the number of retries and lengthen the maximum backoff for all classes of error
- C) After a route fails three times in a row, fail over to a backup region
- D) Retry only server, overload, and rate limit errors, and report invalid request errors right away
โ Answer: D
A 400 invalid request error is caused by the request itself, so sending it again unchanged will fail again. Retries belong only on temporary conditions such as rate limits, overload and server errors; invalid requests should surface at once so the tool definition can be fixed. Jitter, more retries or failover still resend the same broken request.
At AutoHarbor Mobility, you work as a senior software engineer. The company's agent for vehicle-owner support reads inbound messages from owners, warranty documents, and vehicle manuals, and it is able to send responses and open service tickets. Because the agent's tool access produces real side effects and inbound content cannot be trusted, your team is responsible for both its guardrail stack and its adversarial testing. Now and then the support agent for owners replies with a promise of a service booking although no ticket gets opened. You have 40 traces that passed and nine that failed, all from the same reply flow. Each failed trace shows the warranty lookup tool timing out, after which the harness added an empty tool result without marking it as an error. Each passing trace shows the tool responding before its deadline. What most likely explains this?
- A) Sampling that is not deterministic yields differing replies even when prompts and tool results are the same.
- B) The harness hides the timeout, so the model treats an empty result as if the lookup had succeeded.
- C) In the failed traces, the model disregards tool results and relies solely on conversation context for its answer.
- D) In the failed traces, the warranty lookup tool sends back badly formed records that the model misinterprets.
โ Answer: B
The split between failing and passing traces lines up exactly with a timeout that was turned into an empty result with no error flag. The model cannot tell that apart from a completed call and continues as if it worked. The harness should return an explicit tool error. Sampling or the model ignoring results would not match this pattern so consistently.
Source: platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls
At AutoHarbor Mobility, you work as a senior software engineer. The company's agent for vehicle-owner support reads inbound messages from owners, warranty documents, and vehicle manuals, and it is able to send responses and open service tickets. Because the agent's tool access produces real side effects and inbound content cannot be trusted, your team is responsible for both its guardrail stack and its adversarial testing. Before release, every drafted reply to an owner and every drafted ticket action passes through one policy filter that applies a single global threshold. Over a month, telemetry shows that the filter stopped 130 ticket actions that were legitimate and let through four replies containing quotes from internal repair notes. When a ticket action is blocked, it can be retried with nothing lost. A reply that has been sent cannot be taken back. What is the correct conclusion?
- A) Each channel should get its own threshold: a strict one for replies and a lenient one for ticket actions.
- B) The four replies that got through show that the filter model has to be retrained before any threshold is changed.
- C) The filter should use one tighter global threshold so that more traffic is blocked on both channels.
- D) For the reply channel, the filter should give way to a stronger system prompt for drafting replies.
โ Answer: A
The two channels carry very different costs of error. A wrongly blocked ticket action can be retried with no loss, but a leaked reply cannot be recalled, so replies need a stricter threshold and actions a looser one. One global setting cannot serve both, and neither retraining nor a prompt replaces choosing thresholds by risk.
Source: platform.claude.com/docs/en/about-claude/use-case-guides/content-moderation
At BuildLine Development, you work as a senior software engineer. An extraction service at the firm processes permits, inspection reports, and construction contracts, and its output feeds project dashboards. Accuracy is a contractual obligation and throughput comes in bursts, so the team relies on online sampling and judge-based review to protect quality while keeping spend under control. Your team has written a new prompt for a judge that scores how accurate extraction is on documents sampled from production. A coworker looks over 15 of its verdicts, finds them sensible, and suggests plugging it into the gate for releases. What is your best next move?
- A) Before using it to gate anything, measure how well the judge agrees with labels from experts on a stratified sample.
- B) Have the judge score every document twice and accept it if the two scores are identical.
- C) On the same set of documents, check the new judge's scores against those from the retired one.
- D) Make the release gate's passing threshold stricter during the first month.
โ Answer: A
A judge has to be validated against trusted expert labels before it can block releases, and a stratified sample ensures that important document types and failure cases are included. Fifteen reasonable-looking verdicts are not enough, repeated scores show only consistency, an old judge is not ground truth, and a stricter threshold does not show accuracy.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
At BuildLine Development, you work as a senior software engineer. An extraction service at the firm processes permits, inspection reports, and construction contracts, and its output feeds project dashboards. Accuracy is a contractual obligation and throughput comes in bursts, so the team relies on online sampling and judge-based review to protect quality while keeping spend under control. In the final three days of every month, permit filings surge to 20 times their normal volume. Because the grading pipeline takes the same fixed fraction of all documents, the set that gets graded is mostly permits from those surge days. Inspection reports make up just 5% of the volume yet carry a contractual commitment on accuracy, and a regression affecting them went unnoticed for six weeks. What plan for sampling is the right choice?
- A) Sample a fixed percentage, drawing only from documents filed outside the surge days
- B) Use stratified sampling that sets a daily grading quota for every type of document
- C) Sample a fixed percentage of all documents and combine the grades over the whole month
- D) Increase the sampling percentage only on the surge days at the end of the month
โ Answer: B
Stratifying by document type with daily quotas guarantees that low-volume inspection reports are graded every day and that permit bursts cannot crowd them out. Percentage sampling keeps the same imbalance, excluding burst days ignores important traffic, and monthly pooling hides regressions.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
At BuildLine Development, you work as a senior software engineer. An extraction service at the firm processes permits, inspection reports, and construction contracts, and its output feeds project dashboards. Accuracy is a contractual obligation and throughput comes in bursts, so the team relies on online sampling and judge-based review to protect quality while keeping spend under control. Two expert annotators rate sampled extractions from contracts using one overall scale for completeness, and the Cohen's kappa between them is 0.31. A judge given that same scale in its prompt agrees with either annotator to about the same degree. The team is looking for a release gate it can rely on. What would you advise?
- A) Break the rubric down into checks for individual criteria, each clearly defined, and then recalibrate both the judge and the annotators.
- B) Swap the two annotators for one senior expert and treat that expert's labels as the gold standard.
- C) Take the mean of the two annotators' ratings and calibrate the judge to those averaged labels.
- D) Switch the judge to the biggest model tier on offer and run the calibration study again.
โ Answer: A
A kappa of 0.31 shows weak agreement even between experts, so the rubric is probably ambiguous. Clear criterion-level checks address that, after which both people and the judge should be recalibrated. Using one expert or an average hides the disagreement, and a bigger model cannot make an unclear target clear.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents; scikit-learn.org/stable/modules/model_evaluation.html
At BuildLine Development, you work as a senior software engineer. An extraction service at the firm processes permits, inspection reports, and construction contracts, and its output feeds project dashboards. Accuracy is a contractual obligation and throughput comes in bursts, so the team relies on online sampling and judge-based review to protect quality while keeping spend under control. According to reviewers, searches that quote a clause code or the number of a permit bring back passages that have nothing to do with them, while questions about those documents phrased in everyday language work fine. Retrieval on the index relies on embeddings only. What action should you take?
- A) Make chunks small enough that every identifier sits in a chunk of its own.
- B) Fine-tune the model that produces embeddings on the contracts held by the firm.
- C) Pair retrieval by embeddings with lexical matching using BM25, and merge the two sets of ranked results.
- D) Before embedding any lookup, expand it using paraphrases that are generated.
โ Answer: C
Embeddings capture meaning but can miss exact identifiers such as permit numbers and clause codes. BM25 matches exact terms, and merging it with embedding results keeps strong natural-language retrieval too. Tiny chunks, fine-tuning or paraphrases do not reliably provide exact matching.
At BuildLine Development, you work as a senior software engineer. An extraction service at the firm processes permits, inspection reports, and construction contracts, and its output feeds project dashboards. Accuracy is a contractual obligation and throughput comes in bursts, so the team relies on online sampling and judge-based review to protect quality while keeping spend under control. Whenever a big packet of contracts comes in, the ingestion service launches an extraction request for every document with no cap on how many run at once. Requests in the first few seconds of a burst go through, after which rate limit errors mount until the burst is over. Taken as an average over the day, usage is only 40% of each of the organization's limits. What action should you take?
- A) Apply for a higher tier large enough to cover the peak concurrency from the biggest packet.
- B) Introduce a queue of bounded size that sends requests out at the rate at which the limits steadily refill.
- C) Retry the documents that fail, using exponential backoff with jitter, until every burst is cleared.
- D) Make the prompt for each document shorter so that a burst draws fewer tokens.
โ Answer: B
Low daily use with errors during bursts shows a short-term rate problem, not a lack of total capacity. A bounded queue paced to the refill rate smooths requests and applies back-pressure. A higher tier pays for peaks, retries react after failure, and shorter prompts do not control unlimited concurrency or request rate.
You are a senior software engineer employed by SignalWave Media. The company has a production pipeline that tags a transcript archive, writes drafts of program notes, and produces summaries of wire feeds. It handles large volumes, editors spot-check the outputs for quality, and the team tracks changes in cost and quality on live traffic instead of waiting on offline suites. At present, the service that summarizes wire feeds responds to rate limit errors only once they have happened, and the resulting bursts of errors push back editors' deadlines. What the team wants is for the client to ease off before the organization hits a limit. A shared collector of metrics already receives every response from the API. What signal is the right one?
- A) The retry-after figure attached to the latest rate limit error
- B) Token counts from the usage block of every response, added up and compared with the limit for the tier
- C) The headers on responses that give the rate limit capacity still available and when it resets
- D) The number of rate limit errors over the past five minutes
โ Answer: C
Rate limit response headers report remaining capacity and reset time on responses before the limit is reached, so the client can slow down early. Retry-after appears after throttling, error counts are also reactive, and adding token totals ignores request limits and does not reliably reflect the server's current limit state.
You are a senior software engineer employed by SignalWave Media. The company has a production pipeline that tags a transcript archive, writes drafts of program notes, and produces summaries of wire feeds. It handles large volumes, editors spot-check the outputs for quality, and the team tracks changes in cost and quality on live traffic instead of waiting on offline suites. To tag the archive, the pipeline issues a small request for every segment of a transcript, and for the full length of each surge, rate limit errors keep occurring. Telemetry taken during surges puts usage of the limit on requests at 97%, of the input token limit at 35%, and of the output token limit at 25%. The instructions for tagging that all requests share are already served by prompt caching. What action should you take?
- A) Give the tagging client backoff with jitter, leaving the number of requests as it is
- B) Apply for a larger limit on input tokens before the next surge arrives
- C) Pack neighboring segments of transcripts together so that tagging uses bigger requests and fewer of them
- D) Widen prompt caching to cover the text of the transcript segment within every request
โ Answer: C
The request limit is the constraint at 97%, while both token limits have plenty of room. Combining consecutive segments sends fewer requests for the same work, staying within token capacity and output size. More input capacity or caching targets tokens, and backoff alone keeps the same number of requests.
You are a senior software engineer employed by SignalWave Media. The company has a production pipeline that tags a transcript archive, writes drafts of program notes, and produces summaries of wire feeds. It handles large volumes, editors spot-check the outputs for quality, and the team tracks changes in cost and quality on live traffic instead of waiting on offline suites. Ahead of rolling out across the whole pipeline, you test two versions of a summarization prompt using live traffic. Each is run on a separate sample of 400 traces, with the samples taken on different days, and the newer version comes out 1.6 points ahead. When the baseline, left unchanged, is scored repeatedly, results vary by 2.4 points from run to run because of noise in the infrastructure and variation in grading. What is the correct conclusion?
- A) A difference of 1.6 points falls within the band of noise that was measured, so it does not show any real gap in quality.
- B) Summaries are better with the newer version, so the rollout across the pipeline can go ahead.
- C) Because the samples come from separate days, bias from traffic is eliminated and the comparison is valid.
- D) Variation between runs shows that the grader cannot be trusted and that the scores for both versions mean nothing.
โ Answer: A
A 1.6-point difference is smaller than the 2.4-point spread seen when nothing changes, and the samples came from different days. It does not establish an improvement. Use the same or properly randomised traffic and enough repeats to estimate uncertainty. The noise result does not make the grader meaningless.
Source: www.anthropic.com/engineering/infrastructure-noise; www.anthropic.com/engineering/demystifying-evals-for-ai-agents
Reliability (10)
A client treats every 429 the same way and retries with backoff. One evening all requests fail with 429 and no retry-after header, and the error details show enforced_spend_limit_reached. Retries continue for hours. What should the client do for this case?
- A) Retry faster, because a missing header means that capacity is already available for new requests
- B) Stop retrying and alert, because access resumes only when the spend limit allows it
- C) Retry with more jitter, because the failures are caused by synchronized clients
- D) Switch every request to streaming, because spend limits apply to buffered calls
โ Answer: B
A 429 caused by a monthly spend cap is not transient and carries no retry-after header. It needs an operator or a new billing period, while ordinary rate limits should be retried as the header says.
An integration logs a 413 response for some document uploads and a 400 "prompt is too long" response for others. A developer wants one handler for both. How do the causes differ?
- A) The 413 is a context-window limit, and the 400 is an expired access token
- B) The 413 is a rate limit, and the 400 is a model that is temporarily overloaded
- C) The 413 is a request-size limit, and the 400 is input above the context window
- D) The 413 is an output limit, and the 400 is a missing tool result
โ Answer: C
The API returns 413 when the request body exceeds the size limit and a 400 invalid request error when the input tokens exceed the context window. One is fixed by smaller payloads, the other by fewer tokens.
A client has a 60-second timeout and an SDK that retries twice by default. The product owner expects every call to finish or fail within 60 seconds, but some take about three minutes. What explains this?
- A) The timeout covers only output tokens, so input processing is not counted
- B) The SDK doubles the timeout after each response that includes a tool call
- C) The server ignores client timeouts while a request is waiting in a queue
- D) Timeouts are retried, so the total wait can reach the timeout times the attempts
โ Answer: D
SDK retries include timed-out requests, so two retries can triple the wall-clock time. A strict overall deadline needs lower retries or a separate total timeout around the call.
A worker sends a request with server-side web search. Some responses end with stop_reason: "pause_turn", and the worker shows the partial text as final. What should it do instead?
- A) Send the response content back as the assistant turn so the model can continue
- B) Report a refusal, because a paused turn means the request was declined
- C) Raise the output limit, because the response was cut off by its token cap
- D) Return a tool result for the search, because the client must run the search on its own side
โ Answer: A
pause_turn means that a long-running turn was paused and can be resumed by passing the content back. It differs from max_tokens, tool_use and refusal, which each need their own handling.
Source: platform.claude.com/docs/en/build-with-claude/handling-stop-reasons
A service reads content[0].text from every response. It crashes on some HTTP 200 responses whose stop_reason is refusal. What is the right fix?
- A) Treat the response as a server error and open the shared circuit breaker
- B) Retry the same request until the response starts with a text block again
- C) Read the second content block instead, because the first one may be empty
- D) Check the stop reason before reading content and handle a refusal as its own case
โ Answer: D
A refusal is a successful HTTP response with its own stop reason and may have no usable text. Code should branch on stop_reason first. Retrying unchanged or tripping a breaker treats it as an outage.
Source: platform.claude.com/docs/en/build-with-claude/handling-stop-reasons
A nightly job submits 5,000 items to the Message Batches API and matches results to inputs by position. Some customers receive another customer's summary. What is the bug?
- A) Results are grouped by length, so the inputs must be sorted before sending
- B) Results are returned by priority, so each item needs a different model
- C) Results can arrive in any order, so they must be matched by
custom_id - D) Results arrive twice by design, so every second entry must be removed
โ Answer: C
Batch results are not guaranteed to be in input order. Each request has a custom_id that must be used to join results. Entries can also be errored, canceled or expired, so the result type must be checked.
Source: platform.claude.com/docs/en/build-with-claude/batch-processing
A batch finishes with status ended. A developer marks every item as complete and deletes the inputs. Later, several items turn out to have no answer. What should the code have done?
- A) Raised the output limit of the whole batch after it had already ended
- B) Checked each result's type and resubmitted the errored or expired items
- C) Submitted the same batch twice, so that one copy would always succeed
- D) Waited one more day, because ended batches continue to fill in results after that status
โ Answer: B
An ended batch means that processing has finished, not that every item succeeded. Individual results can be succeeded, errored, canceled or expired, and each needs its own handling.
Source: platform.claude.com/docs/en/build-with-claude/batch-processing
A platform team runs the same application on two providers and switches a shared configuration to a newly announced server-side tool. One provider rejects every request. What should the team have done first?
- A) Checked feature availability for each platform and kept configuration per provider
- B) Moved all traffic to the newest model, since tools are the same everywhere
- C) Sent the same request with a smaller prompt, since new tools need more space for this one tool
- D) Asked the failing provider to accept the same beta header under another name
โ Answer: A
Feature and model availability differ between the first-party API and cloud platforms. Availability has to be verified and configuration kept separately, with tests on each platform before rollout.
Source: platform.claude.com/docs/en/build-with-claude/overview
A service depends on a beta feature through a header. The team wants to adopt a new API version and a new model in the same release. After deployment, several request fields are rejected, and it is unclear which change is responsible. What should the team do next time?
- A) Retry rejected requests with the previous version while the new model stays live
- B) Keep all old fields in the request so that the server can ignore the unknown ones during the change
- C) Change all of them at once but send the requests through two different regions
- D) Change one of them at a time, test on a canary and keep a separate rollback for each
โ Answer: D
Separate, reversible changes make a failure attributable. A model, an API version and a beta header each alter the accepted request surface, and invalid fields return errors rather than being ignored.
A webhook consumer receives session events from Managed Agents. Some jobs run twice, because the same event is delivered again after a slow response. How should the consumer handle this?
- A) Compare the delivery time of both requests and keep the later of the two
- B) Verify the signature, deduplicate on the event ID and acknowledge quickly
- C) Parse and re-serialize the JSON before checking the signature of the event
- D) Trust only the first delivery each day and reject every later request
โ Answer: B
Retries carry the same event ID, so deduplication on it makes processing safe. The signature must be checked against the raw body, because re-serializing the JSON changes the bytes.
Structured outputs (2)
A team turns on strict tool use so that inputs always match the schema. A request succeeds, but the booked date is in the past. What should the team understand?
- A) The schema needs more optional fields so that the model can choose better values on its own
- B) The model ignored the schema, because strict mode applies only to text responses
- C) Schema validity does not check business rules, so the tool must still validate values
- D) Strict mode failed, because a valid schema would always reject dates in the past
โ Answer: C
Strict tool use guarantees the shape and types of the input. Whether a value makes sense, such as a future date, is for the tool to check and report as an error result.
Source: platform.claude.com/docs/en/build-with-claude/structured-outputs
A compliance assistant needs both source citations and a response that follows a JSON schema. The combined request returns a 400 error. What should the design do?
- A) Split the work, for example a cited answer first and a schema-based step after it
- B) Retry the request, because the two features conflict only under heavy load
- C) Enable citations on only one of the documents and keep the schema in place
- D) Put the schema in the document title so that both features stay active together in one request
โ Answer: A
Citations and structured output formats are incompatible in one request, so the API rejects the combination. Separating the steps keeps both properties. Citations also have to be enabled on all documents or none.
Source: platform.claude.com/docs/en/build-with-claude/citations
Tool integration (6)
An API wrapper exposes list_users, list_events and create_event as separate tools. Agents spend many turns combining them to schedule one meeting. Which redesign follows tool-design guidance?
- A) One generic
call_apitool that accepts any endpoint and any request body - B) Six smaller tools that each return a single field of one calendar event
- C) The same three tools with shorter names that use fewer prompt tokens
- D) One
schedule_eventtool that finds availability and books the meeting
โ Answer: D
Tools should match the task the agent needs to complete rather than mirror each endpoint. A consolidated, purpose-built tool saves turns and errors, while a generic passthrough gives the model less guidance.
Source: www.anthropic.com/engineering/writing-tools-for-agents
A log-search tool returns 60,000 tokens for broad queries. The agent then forgets earlier instructions. What should the tool do?
- A) Return an empty result for broad queries so that the context stays small
- B) Filter and paginate with sensible defaults, and say how to narrow a truncated result
- C) Return the full result and ask the agent to ignore the lines it does not need
- D) Return the result as an image so that it uses fewer text tokens
โ Answer: B
Tool responses should be token-efficient: pagination, filtering and truncation with helpful guidance let the agent refine its query. An empty result hides data and misleads the agent.
Source: www.anthropic.com/engineering/writing-tools-for-agents
A customer tool returns internal UUIDs, MIME types and image dimensions with every record. Agents copy the wrong identifiers into later calls. Which change helps most?
- A) Return meaningful fields such as names, with detailed IDs only on request
- B) Return only the identifiers so that there are fewer fields for the agent to confuse
- C) Return every field twice so that the agent can compare the two copies
- D) Return the identifiers in shorter form with their last digits removed
โ Answer: A
Agents handle natural-language names better than opaque identifiers. Returning high-signal fields, with an option for a detailed format when IDs are needed, reduces errors and tokens.
Source: www.anthropic.com/engineering/writing-tools-for-agents
An agent asks for three tools in one turn. One of them fails. The code returns results only for the two that worked, and the next request is rejected. What should the code send?
- A) Two user messages, the first with successes and the second with the failure
- B) One assistant message that removes the failed tool call from the history
- C) One user message with two results and a text note that describes the failure
- D) One user message with a result for every call, the failed one marked
is_error: true
โ Answer: D
Every tool_use block needs a matching tool_result in the next user message. A failed call is returned with is_error and a useful message, so the model can decide how to recover.
Source: platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use
A platform moves 200 tools behind tool search and marks every tool, including the search tool, with defer_loading: true. The API returns a 400 error. What is the fix?
- A) Set the tool choice to none until the first search has finished
- B) Leave the search tool and a few frequently used tools loaded
- C) Remove the descriptions, because deferred tools cannot have them
- D) Split the tools across requests so that each has fewer than fifty
โ Answer: B
The tool search tool itself must not be deferred, and at least one tool must be loaded up front. Keeping the most-used tools loaded also avoids an extra search step.
Source: platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool
A streaming agent turns on eager input streaming for a file-writing tool. Occasionally the tool runs with an incomplete file. Nothing raised an error. What did the client miss?
- A) It must raise the sampling temperature so that the input is fully generated
- B) It must disable parallel tool calls, because they cut each input in half
- C) It must send the same tool call again whenever a stream delivers partial JSON for that tool
- D) It must check the stop reason and validate the parsed input before running the tool
โ Answer: D
With eager streaming, the API does not validate the input for you. A response cut off by max_tokens can leave partial JSON, and tolerant parsers may accept it, so the client has to validate first.
Source: platform.claude.com/docs/en/agents-and-tools/tool-use/fine-grained-tool-streaming
MCP integration (2)
A request includes mcp_servers with a valid URL and name but is rejected by validation. No entry in tools mentions the server. What is missing?
- A) A local process that starts the server over standard input
- B) A separate API request that registers the server beforehand
- C) A copy of each MCP tool definition in the system prompt
- D) An MCP toolset entry in
toolsthat names the same server
โ Answer: D
The MCP connector needs both halves: the server definition and an mcp_toolset entry in tools that refers to it by name. Tool definitions are discovered from the server.
Source: platform.claude.com/docs/en/agents-and-tools/mcp-connector
A remote MCP server keeps each client's shopping cart in process memory. After it is scaled to several replicas, carts disappear at random. The current protocol is stateless. Which design fits?
- A) Keep each cart in memory and ask clients to slow down between their calls
- B) Return an explicit cart handle, store the state externally and check who owns it
- C) Store the cart in the tool description so that every replica can read it
- D) Rely on the handshake to bind each client to the replica it first reached
โ Answer: B
With a stateless protocol, any replica can serve any request, so state lives in shared storage behind an explicit handle. The handle is not proof of identity, so the server must verify that it belongs to the caller.
Source: modelcontextprotocol.io/specification/2026-07-28/basic
Knowledge grounding (4)
A knowledge base is about 60,000 tokens, changes monthly and is used with most questions. The team plans a vector database, chunking and a reranker. What simpler option should be tested first?
- A) Fine-tune a model each month on the current knowledge base
- B) Split the knowledge base into single sentences before embedding it
- C) Put the whole knowledge base in the prompt and use prompt caching
- D) Ask the model to answer from memory and cite the knowledge base
โ Answer: C
For a small knowledge base, including all of it in a cached prompt avoids retrieval errors and infrastructure. Retrieval becomes worthwhile when the material no longer fits well.
A chunk says that revenue grew by three percent over the previous quarter. Retrieval fails for a question that names the company and period, because neither appears in the chunk. Which technique targets this problem?
- A) A smaller chunk size, which keeps every number in a separate indexed passage
- B) Contextual retrieval, which adds a short explanatory context to each chunk before indexing
- C) A higher similarity threshold, which returns only the chunks that match most closely
- D) A larger output limit, which gives the model space to guess the missing company
โ Answer: B
Contextual retrieval prepends chunk-specific context, such as the document and period, before creating embeddings and the lexical index. Smaller chunks and stricter thresholds make missing context worse.
A policy assistant invents an answer when the supplied documents do not cover a question. Which instruction and design combination best reduces this?
- A) Let it say the documents do not cover the question, and require quotes that support claims
- B) Raise the output limit so that it can consider more possible answers in full
- C) Remove the documents when the question is unusual, so that it can reason freely
- D) Ask it to answer every question with confidence and to avoid uncertain wording
โ Answer: A
Allowing the model to admit missing information and grounding claims in quotes from the source are core ways to reduce hallucination. Forcing confident answers encourages invention.
Source: platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations
A request contains twelve long reports followed by a question. Moving the question to the very top made answers worse, and key evidence is still missed. Which prompt layout is recommended?
- A) The question first, then all reports as one unmarked block, then a short reminder to be accurate
- B) Reports split over several separate requests, with the question sent only in the last of them
- C) Reports first in tagged documents, the question at the end, and relevant quotes extracted before answering
- D) The question repeated between each pair of reports, with no marks to separate the documents
โ Answer: C
For long inputs, place documents near the top, mark them with tags and metadata, put the query at the end and ask for relevant quotes first. Separate stateless requests would not share the reports.
Source: platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices
D3 Observability and Production Monitoring 22 questions ยท 12% of exam
Observability and monitoring (8)
At SunPeak Operations, you work as a site reliability engineer. The business runs a copilot for field operations, which supports technicians as they troubleshoot inverter faults, prepare work orders, and condense sensor readings from solar sites. Both uptime and quality SLOs apply to the service, instrumentation covers it end to end, and incident response for any quality or availability regression is led by your team. A judge model grades 5% of the copilot's responses at SunPeak Operations. In the three weeks following a model update, the daily average score slid from 0.91 down to 0.84, yet it never dropped below the fixed alert threshold of 0.80. As a result, technicians raised the quality decline before any alert had triggered. The incident review asks for alerting that detects a lasting drift after an update while staying quiet for one-off low scores. Which design for the alert is the right choice?
- A) Trigger an alert every time a single sampled response is scored under 0.80
- B) Evaluate against a golden set one time at rollout and alert if the pass rate misses its target
- C) Compare the mean score over a rolling seven-day window with a baseline frozen before the update, and alert when the gap persists
- D) Lift the fixed threshold so that an alert triggers once the daily average drops under 0.85
โ Answer: C
A rolling seven-day mean smooths out one-off low scores, and comparing it with a frozen pre-update baseline exposes a lasting drop even while every daily value stays above a fixed floor. Per-response alerts are noisy, a one-time rollout check cannot see later drift, and a baseline-free threshold of 0.85 is just another arbitrary line that slow drift can sit above.
You are a site reliability engineer employed by ShopFlow Retail. On the Claude API, the company operates a shopping assistant for its storefront, along with a batch pipeline that enriches the product catalog each night. Latency targets are tight, traffic arrives in steep peaks, and whenever limits or failures hit, the integration layer has to degrade gracefully. No payment or identity data is held by the assistant, which works only with the public catalog and order-status tools. A canary sends 5% of the assistant's traffic to the latest generation of model, with the current generation serving everything else. Six hours in, the canary's latency and error rate match the baseline, but on an identical mix of queries its outputs are 40% shorter and it calls tools twice as often. Nothing unusual appears in complaints from shoppers. What is your best next move?
- A) Leave the canary at 5% while you examine transcripts to understand the changes in length and tool calls.
- B) Reduce the canary to 0% and drop the model migration for the current quarter.
- C) Keep ramping the canary as scheduled for as long as latency and error rate stay at baseline.
- D) Expand the canary to 50% of traffic and watch shopper complaints over one week.
โ Answer: A
Latency and error rate cannot show whether answers are still good. Output that is much shorter and twice the tool calls are real behaviour changes, so hold the exposure steady and read transcripts to judge them. Expanding trusts incomplete signals, shopper complaints are weak and slow, and cancelling the migration decides before there is evidence of harm.
You are a site reliability engineer employed by ShopFlow Retail. On the Claude API, the company operates a shopping assistant for its storefront, along with a batch pipeline that enriches the product catalog each night. Latency targets are tight, traffic arrives in steep peaks, and whenever limits or failures hit, the integration layer has to degrade gracefully. No payment or identity data is held by the assistant, which works only with the public catalog and order-status tools. One day after a change to the prompt template went out, daily spend on the ShopFlow Retail shopping assistant had doubled. Shopper traffic, output length, and the number of requests all held steady. In the usage report, cache read input tokens are close to zero, and input tokens that were not cached have doubled compared with before. What most likely explains this?
- A) With the change, the static part of the system prompt became twice as long.
- B) A loop that retries in the integration layer is submitting every shopper request two times.
- C) The change moved session content that varies ahead of the prompt prefix that stays stable.
- D) Since a recent redesign of the storefront layout, shoppers have been typing longer messages.
โ Answer: C
Prompt caching needs an identical prefix. Putting changing session data ahead of the stable content makes every request differ early on, so cache reads fall to almost zero and those tokens are billed as uncached input. Flat traffic and output rule out the other explanations, and a longer static prompt could still be cached.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
You are a site reliability engineer employed by ShopFlow Retail. On the Claude API, the company operates a shopping assistant for its storefront, along with a batch pipeline that enriches the product catalog each night. Latency targets are tight, traffic arrives in steep peaks, and whenever limits or failures hit, the integration layer has to degrade gracefully. No payment or identity data is held by the assistant, which works only with the public catalog and order-status tools. An update to the shopping assistant's prompt went live at noon. Within minutes it began recommending products that have been discontinued, and contacts to support climbed. Version control holds a tag for the earlier version of the prompt. What is your best next move?
- A) Put a filter on output that blocks any response mentioning a discontinued product.
- B) Leave the current version in place and investigate the root cause before changing anything.
- C) Revert to the earlier prompt version, preserving the faulty version together with its traces.
- D) Modify the live prompt directly to delete whichever line you think is responsible.
โ Answer: C
Customers are being harmed now and a known earlier version is available, so restore it first. Keeping the failing version and its traces preserves the evidence for root-cause analysis afterwards. Investigating first prolongs the harm, while filters or live edits are untested changes made under pressure.
You are a site reliability engineer employed by ShopFlow Retail. On the Claude API, the company operates a shopping assistant for its storefront, along with a batch pipeline that enriches the product catalog each night. Latency targets are tight, traffic arrives in steep peaks, and whenever limits or failures hit, the integration layer has to degrade gracefully. No payment or identity data is held by the assistant, which works only with the public catalog and order-status tools. Traffic to the storefront comes in steep surges during the evening, separated by quiet spells. According to dashboards, the earliest requests in every surge wait close to four seconds for the first token, whereas later ones wait about 400 milliseconds. At the start of each surge the count of cache reads is zero, rising within the first minute. All day long the prompt prefix stays unchanged and the breakpoint stays in the same position. What does this tell you?
- A) During surges, the storefront route requires a quicker tier of model.
- B) In the lulls between surges, the cached prefix reaches expiry.
- C) Concurrency at the peak goes over a rate limit, which slows down the earliest requests.
- D) Volatile content comes after the breakpoint's position, so no cache write ever happens.
โ Answer: B
Cache reads start at zero after every quiet gap and recover within a minute, which shows that the entry expired and the first requests had to write it again. Those uncached requests are slower to the first token. A stable prefix that gets reads later in the peak rules out a bad breakpoint, and nothing indicates rate limiting or a need for a faster model.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
At AutoHarbor Mobility, you work as a senior software engineer. The company's agent for vehicle-owner support reads inbound messages from owners, warranty documents, and vehicle manuals, and it is able to send responses and open service tickets. Because the agent's tool access produces real side effects and inbound content cannot be trusted, your team is responsible for both its guardrail stack and its adversarial testing. AutoHarbor Mobility and its model provider signed an agreement for zero data retention, and the company's public privacy notice assures owners that their support messages are not stored. Later, a platform engineer turned on capture of complete messages in the agent spans, so the trace backend now keeps owner messages for 90 days. A privacy review wants to know whether the deployment lives up to the notice. What is the correct conclusion?
- A) The agreement reaches telemetry stores further downstream, so its zero-retention guarantee also covers the trace backend.
- B) The agreement only restricts what the provider retains, so capturing messages in spans violates the notice on the company's end.
- C) Capturing is still acceptable so long as only the on-call group and their managers can access the traces.
- D) What spans contain counts as telemetry derived from messages and not as stored messages, so the notice is still honored as worded.
โ Answer: B
A provider's zero-data-retention agreement covers what the provider retains. It says nothing about the company's own telemetry stores, so keeping full owner messages there for 90 days contradicts a notice saying messages are not stored. Restricted access or calling the data telemetry does not change the fact that it is stored.
Source: platform.claude.com/docs/en/manage-claude/api-and-data-retention; code.claude.com/docs/en/monitoring-usage
At NorthStar Hospitality, you work as a senior software engineer. A concierge agent serves guests at the company's properties in Lisbon, Osaka, and Vancouver, backed by a shared platform team and configured separately for each property. It handles questions about the property, uses booking and housekeeping tools to coordinate requests, and has to stay inside strict cost and latency budgets in all regions. In the weekly check of 200 sampled traces, there are four in which the concierge tells a guest a housekeeping request is confirmed even though the housekeeping tool had rejected it. One colleague wants the shared prompt for the platform rewritten straight away, while a second dismisses the four as coincidental. Before anyone changes anything across the fleet, you have to find out whether this is a systemic pattern. What is your best next move?
- A) Search every stored trace for the signature of a rejection followed by a confirmation, and measure how often it happens at each property.
- B) Rewrite the platform's shared prompt immediately and check next week's sample to see whether the pattern shows up.
- C) Record the four traces as known issues and return to them if next week's sample shows the pattern again.
- D) Add those four traces to the suite of regression evals and wait for its next scheduled run.
โ Answer: A
Four cases in a sample of 200 cannot show how widespread the failure is, but the signature of a rejected call followed by a confirmation can be searched across all traces. Measuring the rate by property establishes scope before anything changes. Rewriting now, waiting a week or only adding eval cases does not answer that question.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
You are a senior software engineer employed by SignalWave Media. The company has a production pipeline that tags a transcript archive, writes drafts of program notes, and produces summaries of wire feeds. It handles large volumes, editors spot-check the outputs for quality, and the team tracks changes in cost and quality on live traffic instead of waiting on offline suites. After the retriever was modified, the route that writes program notes began making up dates of broadcasts, and the problem was spotted by editors two days afterward while sampling. The fix has gone out, and the postmortem calls for a gate that stops the problem from coming back before anything is deployed. What gate is the right choice?
- A) Widen the rotation for editor sampling so that twice as many outputs get reviewed
- B) Run an evaluation ahead of deployment that replays transcripts from the incident and fails if any date is made up
- C) Set up an alert on the dashboard for when made-up dates become more frequent in live traffic
- D) Instruct the model in the prompt to use only dates that appear in retrieved text
โ Answer: B
Replaying the incident cases before deployment and failing on a fabricated date blocks that known regression from shipping. More editor sampling and live alerts detect it only after release, and a prompt instruction guides behaviour but verifies nothing.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
Distributed tracing (4)
An organization exports Claude spans in metadata-only mode. Engineers can see latency and token counts but cannot tell why a prompt produced a poor answer. Privacy staff ask what would change with full content mode. What is the accurate answer?
- A) Only error messages would be added, since prompts are never exported in either of the modes
- B) Prompts would be exported, but the API provider would control retention in the backend
- C) Prompts and responses would be exported and kept under the backend's own access and retention rules
- D) Token counts would become exact, while the text would still remain hidden from engineers
โ Answer: C
Metadata-only exports identifiers, timing, status and token counts. Full content adds prompts and responses, and the receiving backend's access and retention settings then apply.
Source: platform.claude.com/docs/en/manage-claude/opentelemetry
A trace backend shows the system prompt and early messages missing from some very long requests, although the model clearly used them. Each affected span is marked as truncated. What is the most likely cause?
- A) The backend joined two traces and discarded the older one of the pair
- B) The span hit its content limit, and the earliest content was removed from the export
- C) The application failed to send the system prompt with its longest requests
- D) The API removed early messages before the model could process the request
โ Answer: B
Exported content has a per-span limit. When it is exceeded, the earliest content is shortened and the span is flagged as truncated. This affects the export, not what the model received.
Source: platform.claude.com/docs/en/manage-claude/opentelemetry
A team wants server-side spans for tools that the API itself runs, such as web search, and spans for its own client tools run by a tool runner. Which setup gives both?
- A) Request logging alone, because both kinds of tool appear in it
- B) SDK tracing together with API tracing, joined in the same trace
- C) API tracing alone, because it can see each client tool's process
- D) SDK tracing alone, because it can see inside every server tool
โ Answer: B
SDK tracing sees work in the application process, such as client tools. API tracing sees server-side steps, such as server tools. Used together, the API spans nest under the SDK span.
Source: platform.claude.com/docs/en/manage-claude/opentelemetry
On call, you must reconstruct everything Claude Code did for one user prompt: the prompt event, its API requests and its tool results. Which attribute should you filter on?
- A)
session.id, which separates each prompt within a session by its start time - B)
prompt.id, which links all events from handling one prompt - C)
app.version, which records the prompt that was handled - D)
user.id, which changes every time a prompt is submitted
โ Answer: B
The prompt.id attribute is shared by every event produced while handling a single prompt. A session ID covers many prompts, so it is too broad for this question.
Usage reporting (3)
A metrics bill rises sharply after Claude Code telemetry is rolled out to 4,000 developers. Per-session detail is not needed in metrics. What should you change first?
- A) Export each metric twice so that the backend can compress it
- B) Turn off all token metrics and keep the per-session attributes
- C) Add the prompt text as a label so that fewer series are created in the backend
- D) Turn off high-cardinality attributes such as session ID in metrics
โ Answer: D
Each distinct session or account label creates new time series. Cardinality controls can drop the session and account attributes from metrics while keeping the totals. Adding free text as a label makes it far worse.
Finance sees that claude_code.cost.usage differs slightly from the invoice and wants to bill departments from it. What should you advise?
- A) Treat it as an estimate for trends and use billing or cost reports for chargeback
- B) Replace it with lines of code, which match the invoice more closely over time
- C) Bill from it directly, because client-side figures are recorded before any discounts are applied
- D) Scale it each month so that it equals the invoice and bill from the scaled value
โ Answer: A
The cost metric is a client-side estimate. It is useful for monitoring trends and outliers, but authoritative charges come from the provider's billing and cost reporting.
A company wants to attribute API spend to three products that share one organization and use the same models. Which setup gives clean reporting with the least custom logging?
- A) Separate browser logins, with engineers copying totals from the console
- B) Separate workspaces and keys for each product, reported through the usage and cost API
- C) One shared key, with each product's name written into its system prompts
- D) One shared key, with spend divided by the number of users of each product
โ Answer: B
Workspaces and keys give usage and cost reports a natural grouping. Text in a prompt is not a billing dimension, and dividing by users ignores real token use.
Source: platform.claude.com/docs/en/manage-claude/usage-cost-api
Request diagnostics (2)
Average response time is stable, yet users of one feature complain about long waits before anything appears. Responses are streamed. Which measurement should you add?
- A) The mean total generation time across every feature in the whole product
- B) The total number of output tokens generated across each day of the month
- C) Time to first token at high percentiles, split by feature and by cache hit or miss
- D) The proportion of requests that returned an HTTP 200 status at the start
โ Answer: C
For streamed output, perceived waiting is the time to first token, and tail percentiles by segment reveal what a global mean hides. An initial HTTP 200 says nothing about delay.
Source: platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-latency
A regulated team must prove which Claude Code tool calls were rejected by a policy and which were approved by a user. Which source is the best fit?
- A) A list of commits from each repository, kept by the team's release manager for each audit
- B) A screenshot of each terminal, kept by the developer who ran the session
- C) A count of tokens used in each session, kept in the finance data store
- D) Exported telemetry events for tool decisions, kept in a protected log store
โ Answer: D
Telemetry events record tool decisions and their source as they happen and can be stored centrally. Commits and token counts do not show what was rejected, and screenshots are incomplete and easy to alter.
Production monitoring (5)
A support agent's error rate and latency are normal, but customers increasingly repeat their question after an answer. Nothing on the dashboard changed. What kind of signal is missing?
- A) An infrastructure signal, such as processor use on the hosts that run the agent
- B) An outcome signal, such as resolution or repeat contact, sampled from live conversations
- C) A deployment signal, such as the number of releases made in the current quarter
- D) A volume signal, such as the number of tokens that were sent on each request
โ Answer: B
Operational metrics can stay healthy while quality drops. Outcome-level signals from live traffic, such as resolution or repeat contact, measure whether the agent did its job.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
An alert fires on every single tool failure. The on-call team now ignores it, and a real outage was missed. What is the best redesign?
- A) Remove alerts on tools and rely on customers to report any outage
- B) Alert on single failures only at night, when fewer engineers are available
- C) Send each failure to more people so that someone reads every alert
- D) Alert on a sustained error rate that threatens the objective, and log single failures
โ Answer: D
Alerts should reflect user impact or fast use of the error budget and be actionable. Individual failures belong in logs and dashboards, where they help diagnosis without causing fatigue.
Costs rise slowly for a month with no errors. A prompt-assembly change was made at the start of that month. Which standing check would have caught the problem immediately?
- A) An alert on the number of requests that returned an HTTP 500 status during the past month
- B) A weekly review of the average number of words in user questions
- C) An alert on cache-read tokens falling relative to total input tokens
- D) A test that the system prompt still contains the product's name
โ Answer: C
Caching regressions are silent: requests succeed and only the bill grows. Monitoring cache-read and cache-creation tokens shows the change on the day it ships.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
A dashboard shows input_tokens of 4,000 for an agent that ran for hours with a very long history. A developer concludes that the agent lost its context. What is the correct reading?
- A) It is the size of the final answer, so the input size is not recorded anywhere in the response
- B) It is the average for each turn, so it must be multiplied by the turn count
- C) It is only the uncached part, so cache creation and cache read tokens must be added
- D) It is the limit for one request, so the rest of the history was rejected
โ Answer: C
The input_tokens field reports tokens after the last cache hit or write. Total prompt size is the sum of input, cache creation and cache read tokens.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
Live quality scores from an LLM judge drop on the same day that the judge's own model was upgraded. The application did not change. What should you do before starting an incident?
- A) Switch off the judge for a month so that the scores have time to settle down
- B) Lower the alert threshold until the new scores pass, and then close the alert
- C) Roll back the application, because a lower score always reflects the application
- D) Re-score a fixed set of earlier outputs with both judge versions to separate judge drift
โ Answer: D
A change of judge can move scores on its own. Scoring the same frozen outputs with both versions shows how much is due to the judge, so judge models and prompts should be pinned and versioned.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
D4 Advanced Debugging and Incident Response 19 questions ยท 10% of exam
Debugging and incident response (7)
At AutoHarbor Mobility, you work as a senior software engineer. The company's agent for vehicle-owner support reads inbound messages from owners, warranty documents, and vehicle manuals, and it is able to send responses and open service tickets. Because the agent's tool access produces real side effects and inbound content cannot be trusted, your team is responsible for both its guardrail stack and its adversarial testing. For an owner who has two vehicles registered, the support agent filed a service ticket under the wrong one. According to the tool log, the argument passed to open_ticket was the first vehicle's identifier. In the transcript, the owner's most recent message refers to the second vehicle, although the first one came up in an earlier turn. Retrieval logs confirm that the right warranty document, the one for the second vehicle, was fetched. What is the correct conclusion?
- A) Before the final model call that picked the vehicle, the harness had put the conversation history in a different order.
- B) In the database, open_ticket matched the vehicle identifier to the record of a different owner.
- C) The wrong warranty document came back from retrieval, which sent the ticket astray.
- D) An outdated vehicle reference was carried over between turns by the model, while the tool executed its arguments as it should.
โ Answer: D
The tool received the first vehicle's identifier and acted on exactly what it was given, while the latest message named the second vehicle and retrieval fetched the right document. The error therefore happened when the model chose the argument, carrying an older reference forward. The logs give no evidence of reordered history, a database mix-up or bad retrieval.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
At CodeHarbor Systems, you work as a staff software engineer. Within the engineering organization, a fleet of coding agents handles migrations, refactoring, code review, and first response to CI incidents. The agents run unattended on a schedule, each in an isolated worktree, under managed settings that your team defines. Code is produced faster than humans can review it, and engineering the verification pipeline falls to you. In one repository, a pair of migration agents work concurrently, each in its own worktree. Both run the integration suite, which launches a local database on a single hard-coded port. Each agent sees tests fail intermittently, yet either suite passes if its agent is the only one running. What action should you take?
- A) Run one migration after the other rather than in parallel so that the database is not shared.
- B) Use an environment override to give every worktree a separate database instance on its own port.
- C) Keep rerunning the failed tests until both suites come back completely green.
- D) Put both agents in a single shared worktree that has one checkout and one database.
โ Answer: B
The failures happen only together because both suites compete for one fixed port and database. A separate database and port for each worktree removes the shared resource and keeps parallel work. Running in sequence gives up parallelism, retries only hide the conflict, and a shared worktree increases interference.
At Atlas Learning Institute, you work as a senior software engineer. The institute operates a course tutor that is grounded in its technical library and published curriculum. The tutor is required to cite sources and to turn down any question that falls outside that specified curriculum and library. No prompt or model change ships until it clears a quality bar enforced through calibrated LLM judges and evaluation suites. Your team answers for judge reliability and retrieval quality. Following a deployment that re-chunked the content, the tutor now turns down questions about databases even though the curriculum covers those topics. If the relevant passage is pasted into the conversation, the same questions are answered correctly. For one declined question, the retrieval log shows that the chunks returned came from units with no connection to it. Every refusal uses the template for out-of-corpus questions and finishes with stop_reason end_turn. What most likely explains this?
- A) Since re-chunking, the index no longer brings up the database passages relevant to those queries.
- B) For database topics, the system prompt's rule about out-of-corpus questions is overly strict.
- C) When the team switched model tiers, the model lost what it knew about databases.
- D) The model is refusing content about databases, and the harness displays every refusal using the decline template.
โ Answer: A
The trouble started with re-chunking, the log shows unrelated chunks, and supplying the right passage fixes the answer. That points to retrieval: the model is correctly declining because the needed evidence never arrives. A pasted-passage success argues against lost knowledge or an overly strict rule, and a normal end_turn matches the decline template.
At CargoSpan Logistics, you work as a platform engineer. Shipment planning across sea, rail, and road is coordinated by the company's multi-agent system. Route planning, exception handling, and customs paperwork are delegated by a supervisor agent to worker agents, which in turn call tracking and carrier tools. Live operations in Rotterdam, Singapore, and Chicago depend on the system, and its long-running jobs have to survive both model upgrades and restarts. On the supervisor's planning calls, cache reads fall to zero without warning, and every such episode is followed by a jump in cost. The prompt is put together from tool definitions, static templates, and a block of customs context, and the compliance standard forbids saving the text of assembled prompts. The team has no way to see which segment changes between a request that hits the cache and the next one that misses. What action should you take?
- A) For every request, log a hash of each prompt segment's content, then compare a hit with the miss that follows it.
- B) Save the complete assembled prompt for every request and, after each episode, diff the saved text.
- C) Relocate the cache breakpoint to where the static templates end, leaving the segments after it out.
- D) Raise an alert when cache_read_input_tokens drops to zero, treating each such alert as a signal to roll back.
โ Answer: A
Hashes show which segment changed between a cache hit and the next miss without storing any prompt text. Saving full prompts breaks the compliance rule, moving the breakpoint before finding the cause is guesswork and caches less, and an alert shows that a miss happened but not why.
Source: platform.claude.com/docs/en/build-with-claude/cache-diagnostics; platform.claude.com/docs/en/build-with-claude/prompt-caching
You are a platform engineer employed by FieldStone Foods. Scheduled agents at the company monitor production telemetry, reconcile quality reports from suppliers, and submit exception summaries ahead of every shift. No one attends these runs, so they must fail safe and hand off to a human whenever the evidence is ambiguous. Checkpoints in long reconciliations ensure that restarting never repeats a posting that has already completed. While running overnight, the agent watching telemetry detects drift on one of the production lines. A report from the supplier that might account for it has not come in, so the agent has no way to determine the cause. Work already reconciled for the other lines has to remain in place, and there are six hours until the next shift begins. What design for escalation is the right choice?
- A) Halt all scheduled runs fleet-wide and page the shift lead to review and then restart them
- B) Make the posting for the affected line using the nearest historical figure, and note the substitution in the morning summary
- C) Keep retrying the supplier feed until the shift begins, then submit the exception summary with the affected line left out
- D) Save a checkpoint of the finished lines, hold back the affected line's posting, and page the shift lead along with the evidence gathered
โ Answer: D
The run should fail safe: keep the finished work, hold only the uncertain posting, and give a person the evidence while there is time to act. Stopping the whole fleet is far too broad, substituting a historical value invents data, and retrying until the deadline delays escalation and leaves the issue unresolved.
Source: www.anthropic.com/engineering/building-effective-agents
You are a platform engineer employed by FieldStone Foods. Scheduled agents at the company monitor production telemetry, reconcile quality reports from suppliers, and submit exception summaries ahead of every shift. No one attends these runs, so they must fail safe and hand off to a human whenever the evidence is ambiguous. Checkpoints in long reconciliations ensure that restarting never repeats a posting that has already completed. During the night a reconciliation run crashed, and the scheduler brought it back up from the most recent checkpoint. In the morning, review shows that a supplier exception summary was posted two times, while the run log contains just one run identifier. Every call that made a posting got back a synchronous response indicating success, and the run saved checkpoints at fixed intervals of time. What most likely explains this?
- A) A second run was launched by the scheduler before the first container had shut down.
- B) The last posting finished after the most recent timed checkpoint but before the crash happened.
- C) The webhook signaling completion was delivered again, which set off a second posting.
- D) The crash cut off a write in progress and left the checkpoint file corrupted.
โ Answer: B
Checkpoints are written on a timer, so a posting can succeed after the last checkpoint and be unknown to the restarted run, which then posts again. A single run identifier and synchronous success responses do not support the other explanations. Checkpoint immediately around postings and use idempotency keys.
At BuildLine Development, you work as a senior software engineer. An extraction service at the firm processes permits, inspection reports, and construction contracts, and its output feeds project dashboards. Accuracy is a contractual obligation and throughput comes in bursts, so the team relies on online sampling and judge-based review to protect quality while keeping spend under control. After a set of incorrect extracted values shows up on dashboards, the team tests every stage of the pipeline against the queries that failed. Within the window of passages, retrieval recall stands at 0.94, and in a replay that hands the correct passages directly to the model, the wrong values recur in 78 out of 90 cases. What is the correct conclusion?
- A) The generation step is producing incorrect values even when given correct passages.
- B) Chunking is breaking the answers apart across the boundaries between passages.
- C) Reranking is pushing the right passages down so that they fall outside the window.
- D) The embedding step is not retrieving the right passages.
โ Answer: A
Retrieval usually delivers the right passages, and giving the model the correct passages directly still reproduces 78 of 90 errors. The main failure is therefore in generation. Chunking, embedding or reranking cannot explain errors that remain when those stages are bypassed.
Root cause isolation (9)
Cache reads fell to zero after a refactor that builds the tools list from a set. The tools and prompt look unchanged in code review. What is the most likely cause?
- A) The tools are serialized in a different order, which changes the prefix
- B) The tools are now too short to reach any model's minimum cache length
- C) The tools are now sent after the messages, where caching is not allowed
- D) The tools now use a longer cache lifetime that disables cache reads
โ Answer: A
Caching matches an exact prefix and tools render first. Iterating a set can give a different order, so every request has new bytes. Sorting the tools restores a stable prefix.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
Two services send byte-identical prompts with the same model and key types, yet neither reads the other's cache entries. They run in different workspaces on the Claude API. What explains it?
- A) Cache entries are isolated by workspace, so each service writes its own
- B) Cache entries can be read only by the API key that first created them
- C) Cache entries are bound to the client's IP address and user agent
- D) Cache entries are shared only between requests sent in the same second by both services
โ Answer: A
On the Claude API, caches are isolated per workspace, so identical traffic split across workspaces writes and reads separate entries. This is worth checking before changing the prompt.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
An agent appends dozens of separate content blocks in one turn. On the next request nothing is read from cache beyond the system prompt, although the earlier bytes are identical. What should you suspect?
- A) The model refuses to read a cache entry that was written in the same session or workspace
- B) The tool results expired because they were larger than the system prompt
- C) The previous cache entry is beyond the lookback window from the new breakpoint
- D) The request passed the maximum number of messages that caching can support
โ Answer: C
The API looks back over a limited number of positions from a breakpoint for an earlier entry. A turn that adds many blocks can push it out of range, so an extra breakpoint partway through is needed.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
An extraction service forces a specific tool with tool_choice to get JSON. After moving to a newer model the calls return 400 errors saying that the type is not supported. What should replace forced tool use?
- A) The same forced tool, sent through the batch endpoint instead of directly
- B) Structured outputs, or automatic tool choice with a strict tool and a clear instruction
- C) The same forced tool with a lower output limit and a shorter description
- D) A second tool with the same name, so that either of the two can be forced
โ Answer: B
Some current models reject forced tool choice on every endpoint. If the call exists only to obtain JSON, structured outputs fit. Otherwise use automatic choice with strict schemas and clear instructions.
Source: platform.claude.com/docs/en/about-claude/models/migration-guide
An agent loop ends early with no error. Logs show stop_reason: "max_tokens" in the middle of a tool_use block. The harness ran the tool with whatever input it had. What should it do instead?
- A) Delete the conversation and start again with a shorter system prompt
- B) Not run the incomplete call, and retry that turn with a higher output limit
- C) Return an empty tool result so that the model can guess what happened
- D) Run the call twice so that the second run completes the missing input
โ Answer: B
A response cut off inside a tool call has incomplete input and must not be executed. The turn should be retried with more output room. Running or hiding it risks a wrong side effect.
Source: platform.claude.com/docs/en/build-with-claude/handling-stop-reasons
A question fails in a retrieval system. You paste the correct passage by hand and the answer becomes right. You then find the passage at rank 40, while only the top 10 are sent to the model. Where is the fault?
- A) In ingestion, because the passage was never added to the search index
- B) In generation, because the model could not use the correct passage
- C) In ranking, because the passage was indexed but fell below the cutoff
- D) In the user interface, because it displayed a different answer
โ Answer: C
The passage exists in the index, so ingestion worked, and the model answers correctly when it is given the passage. Ranking placed it below the cutoff, so a reranker or hybrid search is the target.
A Claude Code CI job runs to success but never uses the issue tracker. Its --mcp-config file has a server entry that lacks a required field. How should the job detect this?
- A) Check that the exit code is not zero, since invalid servers always stop a run of the job
- B) Check the git history, since a missing server prevents all new commits
- C) Check the MCP server errors reported in the session's init event and fail the job
- D) Check the length of the final answer, since it is shorter without a server
โ Answer: C
An invalid MCP entry is skipped and the run continues normally. The init event reports skipped entries, so a CI gate should fail when that list is not empty.
Source: code.claude.com/docs/en/headless
Quality falls in the same week that a prompt, a retriever and a model were all changed. The team argues about which one is to blame. What is the most efficient way to find out?
- A) Ask each owner to estimate how likely their own change is to be at fault
- B) Change all three again and see whether quality returns to the old level
- C) Wait for another week of traffic so that the averages become smoother
- D) Replay the failing cases while changing back one component at a time
โ Answer: D
Ablation on a fixed set of failing cases isolates the effect of each component. Changing everything again keeps the changes confounded, and waiting adds exposure without evidence.
A policy hook script exits with code 1 when it finds a forbidden command. Claude Code shows a hook error, but the command still runs. Why?
- A) Exit code 1 blocks only file edits, and shell commands need exit code 3
- B) Only exit code 2, or a deny decision, blocks the call, and exit code 1 does not
- C) Hooks run only after a command, so no exit code can ever prevent a call
- D) The hook ran in the wrong folder, so its exit code was replaced by zero
โ Answer: B
For PreToolUse hooks, exit code 2 is the blocking error, and other non-zero codes are normally non-blocking. A policy hook should exit with 2 or return a deny decision in its JSON output.
Source: code.claude.com/docs/en/hooks
Incident recovery (3)
A payment agent crashed after calling issue_refund but before recording the result. On restart the state is unknown. What is the safest recovery step?
- A) Call the tool again at once, because a crash means that the refund failed
- B) Ask the model to estimate from the transcript whether the refund succeeded
- C) Skip the refund permanently, because a crash means that the refund succeeded before the crash
- D) Query the refund system by the original idempotency key before deciding to retry
โ Answer: D
A crash between an action and its record leaves an uncertain outcome. The external system is the source of truth, and an idempotency key makes both the check and a retry safe.
During a provider overload, every client retries at once and the queue grows. Background jobs compete with customer chats for the same limit. Which response protects customers best?
- A) Move the background jobs ahead of chats so that the queue clears sooner during the overload
- B) Retry all work at the same fixed interval until the overload has ended
- C) Send each chat twice so that at least one copy of it is answered
- D) Pause or slow background work and use capped, jittered retries for chats
โ Answer: D
Load shedding by priority keeps capacity for interactive users, and capped, jittered retries avoid synchronized waves. Fixed intervals and duplicates increase the load during an overload.
A postmortem for a leaked internal note concludes that the model made a mistake and that the prompt was made stricter. A reviewer asks for a stronger corrective action. Which is best?
- A) Add a deterministic output check and a regression test built from the incident
- B) Add a warning in the interface that answers may contain internal notes
- C) Add a reminder for on-call staff to read more transcripts each week
- D) Add a second sentence to the prompt that repeats the rule in capital letters at the very end
โ Answer: A
Durable corrective actions change the system: a control that blocks the failure and a test that keeps it from returning. Prompt wording, reminders and warnings depend on good behaviour.
D5 Evaluation Engineering and Quality Assurance 23 questions ยท 12% of exam
Evaluation engineering (8)
At AutoHarbor Mobility, you work as a senior software engineer. The company's agent for vehicle-owner support reads inbound messages from owners, warranty documents, and vehicle manuals, and it is able to send responses and open service tickets. Because the agent's tool access produces real side effects and inbound content cannot be trusted, your team is responsible for both its guardrail stack and its adversarial testing. A sample of the agent's messages is graded one at a time for helpfulness, and over the quarter the average score did not change. Over that same period, reopened service tickets went up by 40%. What you need is a metric on live traffic that shifts whenever the agent does not resolve an owner's problem. Which one is right?
- A) The average helpfulness score of individual messages over all conversations sampled
- B) A score measuring how many words the agent's replies share with approved templates
- C) A grade for each whole conversation on whether the issue was resolved and no ticket was reopened
- D) A retrieval precision measure for the manual passages cited by the agent
โ Answer: C
The goal is whether the owner's issue is resolved, which is a property of the whole conversation and its outcome. A conversation-level resolution grade tied to no reopened ticket moves when that fails. Message helpfulness already stayed flat while reopenings rose, and word overlap or retrieval precision measure other things.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
At CodeHarbor Systems, you work as a staff software engineer. Within the engineering organization, a fleet of coding agents handles migrations, refactoring, code review, and first response to CI incidents. The agents run unattended on a schedule, each in an isolated worktree, under managed settings that your team defines. Code is produced faster than humans can review it, and engineering the verification pipeline falls to you. CodeHarbor Systems is adding to the fleet's review pipeline an AI reviewer that looks for injection flaws. A platform engineer wants it switched on right away as a mandatory check for merging, on the grounds that the volume of generated code leaves no room for a trial. The decision on how this reviewer joins the pipeline is yours. What is your best next move?
- A) Publish the reviewer's findings as comments for advice only, and make it a merge check after a week passes without complaints
- B) Let a second AI reviewer rule on what the first one finds, and begin gating once both models agree
- C) Run it silently on pull requests that have already been merged, and score what it finds against judgments humans make blind
- D) Turn it on as a mandatory merge check, then drop any category of finding that attracts complaints
โ Answer: C
A new gate should be measured before it can block or influence work. Silent runs on merged pull requests, scored against blind human judgments, give precision and recall without bias or disruption. No complaints is not evidence of accuracy, two models agreeing can share the same mistake, and gating first turns developers into the test.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
At Atlas Learning Institute, you work as a senior software engineer. The institute operates a course tutor that is grounded in its technical library and published curriculum. The tutor is required to cite sources and to turn down any question that falls outside that specified curriculum and library. No prompt or model change ships until it clears a quality bar enforced through calibrated LLM judges and evaluation suites. Your team answers for judge reliability and retrieval quality. At Atlas Learning Institute, tutoring conversations cover an entire semester module, and a single session hits the context limit. The conversation has to stay continuous for the tutor, and the team would prefer not to manage the history on the client side. What approach meets this need?
- A) Start a new conversation every time a student asks a question
- B) Have the client cut the earliest turns from every request
- C) Keep the complete transcript in the memory tool
- D) Have the server compact the earlier parts of the conversation history
โ Answer: D
Server-side compaction summarises earlier history as the limit approaches, keeping continuity without the client managing messages. Starting fresh loses context, client truncation is the bookkeeping the team wants to avoid and drops content, and a memory tool is meant for saved information, not as automatic transcript management.
Source: platform.claude.com/docs/en/build-with-claude/compaction
At Atlas Learning Institute, you work as a senior software engineer. The institute operates a course tutor that is grounded in its technical library and published curriculum. The tutor is required to cite sources and to turn down any question that falls outside that specified curriculum and library. No prompt or model change ships until it clears a quality bar enforced through calibrated LLM judges and evaluation suites. Your team answers for judge reliability and retrieval quality. In a calibration exercise, the judge for citations is checked against labels from experts across 500 sampled answers from the tutor. The two agree on 94% of cases in raw terms, while Cohen's kappa comes out at 0.06. Experts rated 96% of the answers acceptable. What is the correct conclusion?
- A) The agreement is largely down to chance, and the judge has not been shown to work on the few answers that fail.
- B) The judge has been validated, since raw agreement over 90% justifies using it to gate releases.
- C) The labels from the experts cannot be relied on, so another round of annotation has to come before any conclusion.
- D) Kappa gives a misleading picture when data is skewed, so the decision should rest on raw agreement.
โ Answer: A
When 96% of cases are acceptable, a judge that nearly always says acceptable can reach high raw agreement by chance. A kappa of 0.06 shows almost no agreement beyond that, so its ability to catch failures is unproven. Test it on more failing examples; the numbers alone do not show that the experts are unreliable.
Source: scikit-learn.org/stable/modules/model_evaluation.html; www.anthropic.com/engineering/demystifying-evals-for-ai-agents
At Atlas Learning Institute, you work as a senior software engineer. The institute operates a course tutor that is grounded in its technical library and published curriculum. The tutor is required to cite sources and to turn down any question that falls outside that specified curriculum and library. No prompt or model change ships until it clears a quality bar enforced through calibrated LLM judges and evaluation suites. Your team answers for judge reliability and retrieval quality. Over one month of iterating on the prompt, the pass rate on the golden set climbed from 80% to 100%. During that month, an engineer pasted 12 questions from the golden set into the prompt as worked examples of citation, so test items leaked into the very system being tested. Reports from production about incorrect citations did not change all month. What action should you take?
- A) Before the next release goes out, recalibrate the judge model using new labels from humans.
- B) Isolate the questions that were copied and build a new held-out set from queries the system has not seen.
- C) Add 12 new questions to the set, keeping the copied ones in for continuity.
- D) Make a perfect score on the current golden set the new bar for release.
โ Answer: B
Once test questions appear in the prompt, the system is being tested on examples it has seen, so the 100% score is inflated. Isolate those items and measure with a fresh held-out set. Recalibrating the judge or raising the threshold does not remove leakage, and keeping the copied items keeps the score contaminated.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents; scikit-learn.org/stable/modules/cross_validation.html
At Atlas Learning Institute, you work as a senior software engineer. The institute operates a course tutor that is grounded in its technical library and published curriculum. The tutor is required to cite sources and to turn down any question that falls outside that specified curriculum and library. No prompt or model change ships until it clears a quality bar enforced through calibrated LLM judges and evaluation suites. Your team answers for judge reliability and retrieval quality. Two years ago, the golden set was drawn from the curriculum as it stood then. Since that time, Atlas Learning Institute has introduced 40 new courses; this quarter, reports of wrong answers have doubled, and they cluster in those new courses. Throughout all recent releases the suite's pass rate stayed at 97%, and none of the failing queries in production corresponds to any task in the suite. What action should you take?
- A) Draw a new golden set from present-day traffic and pin the baseline again.
- B) Use the rate of complaints from production, not the offline suite, to gate upcoming releases.
- C) Check the retrieval index and the prompt for leaked questions from the suite, and isolate any matches.
- D) Counter saturation by adding more difficult questions drawn from the original courses.
โ Answer: A
The test set no longer represents what students ask: new courses are missing, which explains a high pass rate alongside more wrong answers. Resample from current traffic and set a new baseline, since old and new scores are not directly comparable. Harder old questions or a leak check do not restore coverage, and complaints arrive only after release.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
At Atlas Learning Institute, you work as a senior software engineer. The institute operates a course tutor that is grounded in its technical library and published curriculum. The tutor is required to cite sources and to turn down any question that falls outside that specified curriculum and library. No prompt or model change ships until it clears a quality bar enforced through calibrated LLM judges and evaluation suites. Your team answers for judge reliability and retrieval quality. Sampling for quality reveals that when retrieval finds no relevant passage, the tutor still gives smooth answers based on what the model already knows. Students have no way of telling these answers, which lack grounding, apart from grounded ones. What action should you take?
- A) Fine-tune the model so that it refuses anything not covered by the curriculum.
- B) Turn on structured citations, and decline any question that no retrieved passage backs up.
- C) Put an instruction in the system prompt that bans answering without sources.
- D) Reduce the sampling temperature whenever retrieval returns weak scores.
โ Answer: B
The tutor must cite sources and stay within the corpus. Structured citations show which passage supports an answer, and declining when none does stops unsupported answers reaching students. Fine-tuning or a prompt sentence alone does not give a verifiable check, and temperature does not create grounding.
Source: platform.claude.com/docs/en/build-with-claude/citations; platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-hallucinations
At BuildLine Development, you work as a senior software engineer. An extraction service at the firm processes permits, inspection reports, and construction contracts, and its output feeds project dashboards. Accuracy is a contractual obligation and throughput comes in bursts, so the team relies on online sampling and judge-based review to protect quality while keeping spend under control. Whenever a reviewer changes an extracted field, project dashboards record it as a correction. Over the quarter the rate of corrections dropped from 4% to 2.8%, and a product manager wants to present that drop as an improvement in quality. During the same quarter, two big clients switched to an export workflow in which fields are never shown for anyone to review. What is your best next move?
- A) Weight every correction according to the value of its document and report that weighted figure instead.
- B) Present the drop as an improvement in quality and continue using correction rate as the main metric.
- C) Have a judge grade random samples taken from the start and end of the quarter, and directly compare the accuracy measured in each.
- D) Swap the correction rate for a tally of extraction timeouts and service errors.
โ Answer: C
Corrections are recorded only when someone reviews fields, so removing review for two large clients can lower the rate without better accuracy. Grading comparable random samples from the start and end of the quarter measures accuracy independently of that behaviour. Reweighting or changing to technical error counts does not fix the bias.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
Eval design (8)
A search agent's eval contains only questions that need a web search. After tuning, the agent scores 98% but now searches for everything, even simple arithmetic. What is missing from the eval?
- A) A stricter format check, so that search results are shown more neatly
- B) More cases that need a search, so that the score can rise closer to 100% in the next release
- C) Cases in which the agent should not search, so that both directions are tested
- D) A longer time limit, so that the agent can finish each of its searches
โ Answer: C
One-sided evals produce one-sided optimization. Testing where a behaviour should occur and where it should not prevents an always-search policy from scoring perfectly.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
An agent's score improves only when trials run one after another on the same machine. In separate containers the gain vanishes. Transcripts show it reading files left by earlier trials. What is the problem?
- A) The separate containers use a different tokenizer from the machine
- B) Separate containers are slower, so the agent has less time to think
- C) The model learns permanently from each trial that runs on the machine during the eval
- D) Shared state between trials leaks information and makes scores unreliable
โ Answer: D
Each trial should start from a clean environment. Leftover files, caches or git history can inflate results or cause correlated failures that say nothing about the agent's ability.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
A coding-agent eval checks that the agent called read_file, then edit_file, then run_tests. A new agent solves the tasks correctly by another route and fails. How should the grader change?
- A) Grade the final outcome, such as tests passing, and not one fixed sequence
- B) Fail both agents, because different routes cannot be fairly compared
- C) Score the number of tool calls, because fewer calls are always better in production
- D) Add the new route as the only sequence that the grader will accept
โ Answer: A
Rigid path checks penalize valid solutions that the designers did not anticipate. Outcome grading is more robust, with transcript checks reserved for requirements that really matter.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
A team compares its current model with a candidate using reference answers that the current model wrote. The candidate scores lower, although reviewers often prefer its answers. What is the flaw?
- A) The candidate was tested first, so the second model had an advantage
- B) The references reward imitating the current model, so they bias the comparison
- C) The reviewers saw both answers, so their opinions cannot be compared
- D) The references are too long, so the candidate runs out of output tokens
โ Answer: B
When gold answers come from the incumbent, similarity scoring measures imitation. Human-verified references, rubrics or blind pairwise judgments are fairer for a migration decision.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
In an eval run, 6% of cases time out because of rate limits, and the runner scores them as wrong answers. The candidate was tested at a busier hour than the baseline. How should the results be handled?
- A) Keep them as wrong answers, because users would also have seen a failure
- B) Remove all cases from that hour for the baseline but not the candidate
- C) Record infrastructure failures separately and rerun them before comparing scores
- D) Score them as correct for both models, so that neither is disadvantaged
โ Answer: C
Infrastructure failures mixed with wrong answers attribute plumbing problems to the model. They should be classed separately, retried and reported, so that the comparison reflects model behaviour.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
A fraud classifier eval has 97 legitimate cases and 3 fraudulent ones. A prompt that always answers legitimate scores 97%. Which change gives the most useful measurement?
- A) Remove the three fraud cases, so that the classes are no longer mixed
- B) Run the same cases ten times, so that the accuracy is more stable
- C) Add fraud cases and report precision and recall for the fraud class
- D) Report accuracy to two decimal places, so that small gains are visible
โ Answer: C
With skewed classes, accuracy rewards the majority answer. Balanced coverage with precision and recall shows whether the classifier finds fraud without too many false alarms.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
An internal benchmark reuses bug fixes from a public repository. A model scores very high but performs poorly on private code. Which explanation should be tested first?
- A) The model may recall the public fixes, so private or new cases should be used
- B) The public repository has too many tests, so failures are over-counted
- C) The private code is written in longer files, so no benchmark can measure it with fair accuracy
- D) The benchmark was run at night, so the model had more capacity available
โ Answer: A
Tasks that can be answered from memory measure recall rather than ability. Private, fresh or altered tasks reduce contamination and show whether the skill transfers.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
A single-turn eval shows 95% quality, yet customers complain that the agent loses track after several corrections. Which eval addition targets this?
- A) Multi-turn conversations with a simulated user who corrects and changes details
- B) A speed test that measures how quickly the first answer is generated
- C) A check that each first answer contains the customer's name and greeting
- D) More single-turn questions that are longer and use more technical vocabulary than before
โ Answer: A
Failures that appear over several turns need multi-turn evaluation, often with a simulated user and a check of the final state. Longer single-turn questions do not exercise state changes.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
LLM-as-judge (2)
A pairwise judge prefers the first answer in 68% of comparisons. When the two answers are swapped, it still prefers whichever is first. What should the team do?
- A) Always place the newer system first, so that the bias is constant
- B) Run each pair in both orders and count only consistent preferences
- C) Use the judge only for long answers, where order matters less
- D) Ask the judge to ignore order, and then keep the single-order setup
โ Answer: B
This is position bias. Evaluating both orders, or randomizing and balancing them, cancels it and exposes inconsistent pairs. An instruction alone does not show that the bias is gone.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
A judge must decide whether an answer is supported by documents, but some cases lack enough evidence to decide. It guesses in those cases. What should the prompt allow?
- A) A longer answer, so that the judge can justify either of its guesses
- B) A fail by default, so that every unclear case blocks the release
- C) A pass by default, so that the pipeline is not slowed by doubt
- D) An "unknown" result when the evidence is not enough to decide
โ Answer: D
Giving the judge a way to return an unknown result reduces invented verdicts. Those cases can be sent to a person or excluded explicitly instead of distorting the score.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
Eval metrics (2)
A background research agent may try a task five times, and only one good result is needed. A second agent sends messages to customers and gets one try each time. Which pair of measures fits them?
- A) pass@1 for both agents, since repeated trials never affect reliability
- B) Mean answer length for the research agent, and pass@5 for the customer agent
- C) pass^5 for the research agent, and pass@5 for the customer agent's messages
- D) pass@5 for the research agent, and consistency such as pass^k for the customer agent
โ Answer: D
pass@k measures whether at least one of k attempts works, which suits retryable work. pass^k measures whether every attempt works, which suits customer-facing reliability.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
A team tries forty prompt variants on the same 100-case test set and ships the best one. Its production quality matches the original prompt. What most likely happened?
- A) Choosing the best of many on one set overfitted it, so a held-out set is needed
- B) The original prompt was cached in production, so the new one never ran there
- C) The test set was too easy, so every one of the variants received the same score
- D) The production model ignores prompts that were selected from a large group
โ Answer: A
Selecting the maximum of many noisy scores on one set favours lucky variants. Tuning on one split and confirming once on an untouched held-out split gives an honest estimate.
Quality gates (3)
A release gate runs the full eval suite, which takes nine hours, so engineers skip it for small prompt edits. Two regressions have reached users. What is the best redesign?
- A) A fast, required smoke suite on each change, with the full suite on a schedule and before release
- B) A single manual demo that a senior engineer approves before each small change
- C) A rule that engineers must wait nine hours for every change, however small the edit
- D) An optional suite that engineers can run when they think that a change is risky
โ Answer: A
Tiered gates match cost to risk: a quick required check catches common regressions on every change, and the full suite protects releases. An optional gate is the situation that already failed.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
A prompt change improves the average score by three points but lowers the pass rate on safety cases from 100% to 96%. The gate looks only at the average. How should the gate be changed?
- A) Remove the safety cases, because they make the average harder to interpret
- B) Accept the change, because a gain on the average outweighs a smaller loss
- C) Increase the weight of the general cases so that the average becomes steadier over several releases
- D) Add a separate, non-negotiable threshold for safety cases alongside the average
โ Answer: D
Critical slices need their own thresholds, because an average lets gains elsewhere hide an unacceptable regression. Weighting general cases more would hide it further.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
A team reads only the aggregate score of its eval and never opens transcripts. A surprising 15-point drop appears after a harness update. What should be done before blaming the model?
- A) Roll back the model, because a large drop cannot come from a harness update on its own
- B) Run the suite again with fewer cases, so that the result arrives sooner
- C) Read failing transcripts to see whether the failures are real or a grader fault
- D) Raise the pass threshold, so that only very strong answers are counted
โ Answer: C
Reading transcripts shows whether failures are fair. Surprising results are often caused by graders, parsing or environment changes, and aggregate scores cannot reveal that.
Source: www.anthropic.com/engineering/demystifying-evals-for-ai-agents
D6 Cost and Latency Optimization at Scale 16 questions ยท 8% of exam
Cost and latency optimisation (6)
At SummitBridge Advisory, you work as a senior software engineer. The firm's research copilot carries out analysis jobs lasting several hours across public sources on markets and industries. Its agents search for, read, and synthesize documents, build up working notes, and deliver briefs with citations to consultants. Jobs last long enough to run into context limits, and cost, accuracy, and citation quality are all the team's responsibility. In copilot jobs at SummitBridge Advisory, model calls run one after another, with every call relying on the result of the tool step before it. Between calls, agents spend periods reading retrieved sources that last longer than the cache's default lifetime. According to job telemetry, in a typical job the 40,000-token prefix of instructions and tools gets written to the cache 11 times but is read only twice. Tokens spent on cache creation make up 62% of what the jobs cost. What action should you take?
- A) Send copilot jobs through the Batch API on a schedule that runs nightly.
- B) Place an additional cache breakpoint following every tool result within the job context.
- C) Execute the copilot jobs entirely on a model from the Haiku tier.
- D) Ask for the longer cache lifetime on the prefix containing the instructions and tools.
โ Answer: D
The default cache lifetime is five minutes, so long reading gaps let the prefix expire and it is written again and again. A one-hour lifetime on the stable prefix keeps it alive across those gaps; its writes cost more, but far fewer are needed and reads are cheap. Batch processing does not suit dependent sequential calls, more breakpoints do not stop expiry, and a smaller model changes quality without fixing the cache.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
At SummitBridge Advisory, you work as a senior software engineer. The firm's research copilot carries out analysis jobs lasting several hours across public sources on markets and industries. Its agents search for, read, and synthesize documents, build up working notes, and deliver briefs with citations to consultants. Jobs last long enough to run into context limits, and cost, accuracy, and citation quality are all the team's responsibility. Telemetry for the quarter divides the copilot's work into two kinds of job. Daily summaries of the market make up 80% of job volume and 70% of what is spent on the model, and in 98% of runs they take an identical path through retrieval and drafting. A prototype built as a fixed workflow produces a summary for one third of what the agent costs. In-depth custom briefs, by contrast, fork across sources in unpredictable ways, and consultants score the versions written by the agent higher than the scripted drafts used before. Finance is demanding that model spend fall by 40% with no loss of quality that consultants can detect. What would you advise?
- A) Keep both kinds of job on the agent and impose a strict limit on turns for the summaries.
- B) Shift both kinds of job to a deterministic workflow and live with the difference in brief quality.
- C) Leave both kinds of job with the agent but send the summaries to a smaller tier of model.
- D) Move the daily market summaries onto a fixed workflow, with in-depth briefs staying on the agent.
โ Answer: D
Summaries follow a predictable path and account for most of the spend, so a fixed workflow at about a third of the cost saves roughly 0.70 x 2/3, or about 47% of total spend, which meets the 40% target. In-depth briefs branch unpredictably and benefit from the agent, so they stay on it. Moving everything hurts brief quality, while a turn cap or smaller model has no evidence of meeting both goals.
Source: www.anthropic.com/engineering/building-effective-agents
At SummitBridge Advisory, you work as a senior software engineer. The firm's research copilot carries out analysis jobs lasting several hours across public sources on markets and industries. Its agents search for, read, and synthesize documents, build up working notes, and deliver briefs with citations to consultants. Jobs last long enough to run into context limits, and cost, accuracy, and citation quality are all the team's responsibility. At SummitBridge Advisory, one brief is produced in a single conversation spanning five days, and as its history lengthens, spend on input tokens rises day after day. Leadership imposes two requirements: token spend has to be halved, and cache reads have to remain high from one intervention to the next. What would you advise?
- A) Remove the thinking blocks of previous turns before sending each request.
- B) Turn on compaction on the server side while leaving the cached prefix of the system prompt where it is.
- C) On each request, have the client trim away the earliest messages down to a fixed cap.
- D) Halfway through every day, switch the job to a model from a smaller tier.
โ Answer: B
Server-side compaction summarises older history, reducing the tokens that grow each day, while an unchanged cached system prompt prefix keeps being read from cache. Trimming old messages on every request keeps shifting the history and breaks cache matches. Removing thinking blocks does not control the main growth, and switching models mid-conversation loses the cache.
Source: platform.claude.com/docs/en/build-with-claude/compaction; platform.claude.com/docs/en/build-with-claude/prompt-caching
At NorthStar Hospitality, you work as a senior software engineer. A concierge agent serves guests at the company's properties in Lisbon, Osaka, and Vancouver, backed by a shared platform team and configured separately for each property. It handles questions about the property, uses booking and housekeeping tools to coordinate requests, and has to stay inside strict cost and latency budgets in all regions. A single route in the concierge handles both quick questions about amenities and opening hours and involved planning of itineraries spanning all three properties. One fixed configuration applies deep reasoning to everything, so questions about hours are held up by reasoning they have no use for. The NorthStar Hospitality platform team wants fast answers to short requests, with itinerary planning on that same route retaining its full depth of reasoning. What approach meets this need?
- A) Train a classifier that sends short requests to a model from a smaller tier
- B) Cut down the system prompt used for questions about hours and amenities
- C) Set a single, lower fixed level of effort for the entire route
- D) Use adaptive thinking so that the depth of reasoning adjusts to what each request requires
โ Answer: D
Adaptive thinking lets the model spend more reasoning on hard requests and little on simple ones within the same route. A single lower effort level would weaken itinerary planning, a shorter prompt does not control reasoning depth, and a classifier with a second model adds a separate routing system that the requirement does not need.
Source: platform.claude.com/docs/en/build-with-claude/thinking; platform.claude.com/docs/en/build-with-claude/effort
You are a senior software engineer employed by SignalWave Media. The company has a production pipeline that tags a transcript archive, writes drafts of program notes, and produces summaries of wire feeds. It handles large volumes, editors spot-check the outputs for quality, and the team tracks changes in cost and quality on live traffic instead of waiting on offline suites. Next quarter, SignalWave Media intends to migrate its fleet of summarizers from the Sonnet-tier generation now in use to the latest one. Ahead of the migration, Finance wants a forecast of spending. Cached prefixes in prompts are something the summarizer depends on, and tokenization of text works differently in the latest generation. What approach to forecasting is the right one?
- A) Project next quarter's figure from what the summarizer cost over the previous two quarters
- B) Make the forecast based on the first complete week of live traffic once the migration is done
- C) Replay a sample of the summarizer's traffic on the new generation, measuring cache reads and token usage
- D) Take today's token counts and multiply by the ratio of prices between the two generations
โ Answer: C
The new generation can tokenize the same text differently and its caching behaviour affects cost, so replay representative traffic and measure both token use and cache reads. History and simple price ratios assume usage stays the same, and waiting for live traffic gives no forecast before migration.
Source: platform.claude.com/docs/en/build-with-claude/token-counting; platform.claude.com/docs/en/about-claude/models/migration-guide
You are a senior software engineer employed by SignalWave Media. The company has a production pipeline that tags a transcript archive, writes drafts of program notes, and produces summaries of wire feeds. It handles large volumes, editors spot-check the outputs for quality, and the team tracks changes in cost and quality on live traffic instead of waiting on offline suites. Every so often, drafting of program notes fails with errors about rate limits that point to the limit on output tokens. A completion averages 300 tokens, and according to hourly telemetry, output token volume stays well under the limit in every single hour of the day. As soon as a batch of wire stories comes in, the pipeline begins a draft for each one of them at once. What most likely explains this?
- A) The limiter only replenishes capacity when each new minute begins, so it turns away traffic arriving partway through a minute.
- B) All the drafts for a wire batch start simultaneously, which pushes usage past the limit inside a single minute.
- C) Reads from cache on the prefix that drafts share are counted against the limit on output tokens.
- D) On every request, the limiter sets aside output capacity based on the value of max_tokens.
โ Answer: B
Hourly totals average away short spikes. Starting every draft as soon as a batch arrives can use more output capacity than the limit allows in a short period, even when the hourly total is low. The API uses a continuously refilling token bucket, and max_tokens does not count toward the output tokens per minute limit; only tokens actually generated do. Cache reads are input, not output. Pace the drafts with a queue.
Prompt caching (3)
A request ends with unique retrieved rows. Automatic caching is on, and each response shows large cache writes but almost no reads. What should you change?
- A) Send each request twice, so that the second copy reads the first one's cache at a lower price
- B) Put an explicit breakpoint at the end of the shared part, before the unique rows
- C) Move the unique rows to the very start, so that they are written only once
- D) Use a one-hour lifetime, so that the unique rows can be reused for longer
โ Answer: B
Automatic caching marks the last cacheable block, which is unique here, so every request pays to write content that is never read. The breakpoint belongs at the end of the stable, shared portion.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
Requests that share a prefix start about two minutes apart all day. An engineer proposes the one-hour cache lifetime to be safe. What should you advise?
- A) Use both lifetimes on the same block, so that the cheaper one is chosen each time
- B) Turn caching off, because reads this frequent cost more than uncached input
- C) Keep the five-minute lifetime, because each read refreshes it and writes cost less
- D) Use one hour, because a five-minute entry always ends five minutes after its write
โ Answer: C
A cache read refreshes the entry's timer at no extra cost, so steady traffic keeps a five-minute entry alive. The one-hour write costs more and helps when gaps run from five minutes to an hour.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
An assistant switches to a cheaper model for easy turns within one long conversation. Total cost rises. What is the most likely reason?
- A) Caches are model-specific, so each switch reprocesses the long history uncached
- B) Cheaper models use a higher output price once a conversation is very long
- C) The cheaper model repeats the whole conversation in each of its answers
- D) Switching models resets the rate limit, so more requests are sent each hour to the cheaper one
โ Answer: A
Prompt caches belong to one model. Moving a long conversation between models loses cached reads, which can outweigh the cheaper price. A subagent with a short context suits the cheaper model better.
Source: platform.claude.com/docs/en/build-with-claude/prompt-caching
Model choice (2)
A team reports that a small model costs 80% less per request. However, it needs three retries on average and a human fixes one answer in five. Which measure should guide the choice?
- A) Cost per successfully completed task, including retries and human repair
- B) Cost per input token, because the same prompt is sent to both models
- C) Cost per minute, because the small model returns its answers faster
- D) Cost per request, because it can be read directly from the usage report for each model
โ Answer: A
The business pays for completed tasks, so retries, extra turns and human effort belong in the comparison. A cheap request that rarely finishes the job is not cheap.
Source: platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence
An architect plans a three-model cascade to save money on an agent. Which simpler option should be measured first on the same tasks?
- A) One small model with a very long prompt that describes every edge case
- B) A fine-tuned model for each step, so that no routing step is required
- C) Three capable models that all answer, with the shortest answer kept
- D) One capable model at a lower effort level with caching kept intact
โ Answer: D
Lower effort on one capable model is simpler than a cascade, keeps a single cache and often matches or beats it. It should be measured before routing complexity is added.
Source: platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligence
Effort and latency (2)
A chat route sets maximum effort for every message. Users find it slow, and evals show the same quality at a lower level. What should the team do?
- A) Keep maximum effort but reduce the output limit until replies are short enough to seem fast
- B) Lower effort on that route and keep higher effort where evals show a gain
- C) Lower effort on every route in the product, whatever the evals show
- D) Keep maximum effort and hide the delay with a longer welcome message
โ Answer: B
Effort trades thoroughness for tokens and latency and should be tuned by route with evidence. Cutting the output limit truncates answers, and a global change can harm routes that need depth.
Source: platform.claude.com/docs/en/build-with-claude/effort
A page waits for a 900-word answer before showing anything. The user needs only a verdict first and details later. Which change improves perceived latency most with little risk to quality?
- A) Stream the answer and ask for the verdict first, followed by the details
- B) Add a longer system prompt that explains why speed matters to the user
- C) Raise the output limit so that the full answer is generated in one piece
- D) Send the request three times and show the answer that is returned first
โ Answer: A
Streaming shows text as it is generated, and placing the verdict first delivers the useful part immediately. Duplicated requests triple cost, and a bigger limit does not speed up generation.
Source: platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-latency
Spend control (3)
An agentic loop should finish its work gracefully within roughly 60,000 tokens instead of being cut off. Which control makes the model itself aware of the limit?
- A) A lower
max_tokens, which the model can see and plan around on each turn during a run - B) A monthly spend limit, which the model reads before each of its tool calls
- C) A task budget, which shows the model a countdown so that it can pace its work
- D) A shorter timeout, which tells the model how many seconds it has left
โ Answer: C
A task budget gives the model a token target for the whole loop, so it can wrap up gracefully. max_tokens is an enforced per-response ceiling that the model does not know about.
Source: platform.claude.com/docs/en/build-with-claude/task-budgets
A scheduled claude -p job sometimes runs far longer than planned. The team wants a hard stop on cost for each run and a record of what it spent. Which approach fits?
- A) Limit the number of lines in the prompt and count the files that changed
- B) Run the job at night and compare the invoice at the end of the month
- C) Ask in the prompt for a cheap run and read the final sentence of the text
- D) Set a maximum budget flag and record the cost field from the JSON output
โ Answer: D
The command line supports a per-run budget cap, and JSON output includes an estimated total cost. A request in the prompt is not enforced, and a monthly invoice cannot stop a run.
Source: code.claude.com/docs/en/headless
An agent resends 200 old tool results on each of its 80 turns. Output is small, yet input spend dominates. Caching is already working. Which further change reduces input tokens most directly?
- A) Clear one tool result on every turn so that the prefix changes each time
- B) Ask the agent to write shorter answers so that the old results shrink
- C) Clear stale tool results in larger, infrequent steps to limit cache disruption
- D) Raise the effort level so that the agent finishes after a longer thought
โ Answer: C
Clearing old results removes tokens from every later request. Doing it in larger steps matters, because each clearing changes the prefix and causes a cache rewrite, so clearing on every turn can cost more.
Source: www.anthropic.com/engineering/effective-context-engineering-for-ai-agents
D7 Runtime Guardrails and Production Security 21 questions ยท 11% of exam
Guardrails and security (8)
At ForgeRiver Manufacturing, you work as a platform engineer. Plant engineering teams use Claude agents that reach maintenance manuals, parts inventory, and work-order tools over the company's remote MCP servers. Your team is responsible for deploying and authenticating MCP, governing the tool catalog, managing agent identity, and maintaining the managed configuration that plant teams inherit. Fleet-wide rollouts of any change must leave running integrations intact. One of the plant engineering teams is asking for an agent that downloads firmware notes available to the public and executes diagnostic scripts supplied by vendors. From the workstation hosting this agent, the plant control network is also reachable. The agent has to be able to run scripts and retrieve content from the public web, but no script it executes may reach the control network. What approach meets this need?
- A) Monitor the network, log each outbound connection, and send the team an alert after every run
- B) Execute inside a sandbox that restricts the filesystem and permits network access only to an allowlist of approved hosts
- C) Add a rule to the system prompt that names the control network hosts as off-limits destinations
- D) Have an engineer review every script before the agent is allowed to execute it
โ Answer: B
A sandbox with filesystem limits and a network allowlist enforces the boundary technically: scripts can run and fetch approved public content, but have no route to the control network. Monitoring only reports after the fact, a prompt rule does not bind what a script does, and manual review can miss behaviour and enforces nothing at run time.
Source: code.claude.com/docs/en/sandboxing; code.claude.com/docs/en/agent-sdk/secure-deployment
At ForgeRiver Manufacturing, you work as a platform engineer. Plant engineering teams use Claude agents that reach maintenance manuals, parts inventory, and work-order tools over the company's remote MCP servers. Your team is responsible for deploying and authenticating MCP, governing the tool catalog, managing agent identity, and maintaining the managed configuration that plant teams inherit. Fleet-wide rollouts of any change must leave running integrations intact. Model calls from all the plant agents pass through one shared circuit breaker, which trips once the count of unsuccessful responses within a rolling window exceeds a threshold. A single team releases a prompt template for which most requests come back with stop_reason refusal. As a result the breaker trips, cutting off model access for the agents of all other teams. What would you advise?
- A) Place an individual circuit breaker for every plant team ahead of the shared endpoint
- B) Let only server, overload, and rate limit errors count toward tripping the breaker, and deal with refusals within each request path
- C) Increase the trip threshold to the point where workloads with many refusals stop setting it off
- D) Let refusals trip the breaker only when retrying the refused request fails as well
โ Answer: D
A circuit breaker should react to signs that the service itself is unhealthy, such as rate limits, overload and server errors. A refusal is a successful API response about one request's content, so it belongs in that request's own handling. Splitting breakers or raising the threshold leaves the wrong signal being counted.
Source: platform.claude.com/docs/en/build-with-claude/refusals-and-fallback; platform.claude.com/docs/en/api/errors
At ForgeRiver Manufacturing, you work as a platform engineer. Plant engineering teams use Claude agents that reach maintenance manuals, parts inventory, and work-order tools over the company's remote MCP servers. Your team is responsible for deploying and authenticating MCP, governing the tool catalog, managing agent identity, and maintaining the managed configuration that plant teams inherit. Fleet-wide rollouts of any change must leave running integrations intact. While working on the migration to a stateless design, you examine how the fleet's code handles authentication. Previously, an agent's access token was checked a single time during the initialization handshake, and all subsequent requests over that connection were trusted. Under the new transport there is no handshake, and a request from any agent can be served by any replica. What authentication design fits?
- A) Drop tokens and have the gateway check callers against an allowlist of plant network addresses
- B) Once a first request has authenticated, issue a session token that all replicas accept
- C) Check tokens only for requests that call tools capable of changing work orders
- D) Carry the credential inside each request and validate the token on every one
โ Answer: D
Without a handshake or a fixed connection, each request can reach any replica, so each request has to carry its credential and be validated by whichever replica receives it. A network allowlist does not identify the agent, a locally honoured session token adds shared trust that can outlive revocation, and checking only write tools leaves other requests unauthenticated.
Source: modelcontextprotocol.io/specification/2026-07-28/basic/authorization
At ForgeRiver Manufacturing, you work as a platform engineer. Plant engineering teams use Claude agents that reach maintenance manuals, parts inventory, and work-order tools over the company's remote MCP servers. Your team is responsible for deploying and authenticating MCP, governing the tool catalog, managing agent identity, and maintaining the managed configuration that plant teams inherit. Fleet-wide rollouts of any change must leave running integrations intact. With the fleet now migrated to workload identity federation, you archive the federation rule belonging to a conveyor-monitoring agent that has been retired. For another eight minutes the agent's Claude API calls keep succeeding, after which authentication errors begin. The agent's host was not modified at any point in that window. What most likely explains this?
- A) The identity provider's issuer continued to sign tokens against the rule after it was archived
- B) The SDK renewed the token locally without ever contacting the exchange endpoint
- C) A static API key left behind on the host took precedence over the federation credentials
- D) An access token minted before archiving remained valid until its lifetime ran out
โ Answer: A
Archiving a federation rule stops new token exchanges, but a short-lived access token that was already issued can keep working until it expires. That matches a fixed period of continued success followed by authentication errors with nothing changed on the host. A static key would not stop working, and a token renewed without the exchange endpoint is not how this flow works.
Source: platform.claude.com/docs/en/manage-claude/workload-identity-federation; platform.claude.com/docs/en/manage-claude/wif-reference
At ForgeRiver Manufacturing, you work as a platform engineer. Plant engineering teams use Claude agents that reach maintenance manuals, parts inventory, and work-order tools over the company's remote MCP servers. Your team is responsible for deploying and authenticating MCP, governing the tool catalog, managing agent identity, and maintaining the managed configuration that plant teams inherit. Fleet-wide rollouts of any change must leave running integrations intact. During a session meant only for looking up documentation, a maintenance manual that had been tampered with caused a plant agent to invoke close_work_order on 14 orders that were still open. Under the managed configuration, each session is granted every plant tool. Both the lookup workflow and the work-order workflow have to stay available to plant teams. What action should you take?
- A) Restrict the managed configuration so lookup sessions receive read-only tools and work-order sessions receive the write tools.
- B) Include a line in the managed system prompt that demands confirmation ahead of any destructive tool call.
- C) Pull close_work_order from the tool catalog until the collection of manuals passes another scan.
- D) Delete the tampered document from the manual library and scan the remaining manuals again so that every workflow stays available.
โ Answer: A
The root weakness is that a read-only lookup session was given write tools. Scoping tools by session type means injected text in a lookup cannot close orders, while both workflows keep working. A prompt instruction can be overridden by injected content, removing the tool breaks the work-order workflow, and removing one manual does nothing against the next tampered one.
At ForgeRiver Manufacturing, you work as a platform engineer. Plant engineering teams use Claude agents that reach maintenance manuals, parts inventory, and work-order tools over the company's remote MCP servers. Your team is responsible for deploying and authenticating MCP, governing the tool catalog, managing agent identity, and maintaining the managed configuration that plant teams inherit. Fleet-wide rollouts of any change must leave running integrations intact. Plant teams want human approval added to the catalog of work-order tools, which consists of read_inventory, update_work_order_notes, dispatch_field_crew, and purge_completed_orders. A complete version history is retained for note edits, while dispatching immediately sends a crew out to a site. Once orders are purged, there is no way to restore them. Engineers are already complaining of fatigue from confirmation prompts. What would you advise?
- A) Require approval for dispatching and purging, and log note edits so they can be reviewed afterward
- B) Require approval for purging alone, and examine dispatches in an audit held weekly
- C) Require approval for each of the four tools in the catalog
- D) Require approval for any tool that performs a data write
โ Answer: A
Approval should sit where an action is hard or impossible to undo: dispatch has an immediate real-world effect and purge cannot be reversed. Note edits keep full history, so logging them is enough and avoids more confirmation fatigue. Gating only purge leaves dispatch unprotected, and gating everything or all writes worsens the fatigue.
Source: platform.claude.com/docs/en/managed-agents/permission-policies
At AutoHarbor Mobility, you work as a senior software engineer. The company's agent for vehicle-owner support reads inbound messages from owners, warranty documents, and vehicle manuals, and it is able to send responses and open service tickets. Because the agent's tool access produces real side effects and inbound content cannot be trusted, your team is responsible for both its guardrail stack and its adversarial testing. In an adversarial test, instructions planted inside an owner's message led the agent to quote warranty records back to whoever sent it. The team now proposes splitting the design in two. One component, which has no tools, reads the untrusted messages. A second component holds the tools; it gets nothing but a structured summary whose fixed fields are checked against length limits and enumerations, and it never sees the raw messages. Leadership wants to know which feature of this split shuts down the exploit route that was demonstrated. What is the correct conclusion?
- A) No model context anywhere in the pipeline receives the injected text anymore.
- B) A component capable of calling tools no longer shares a context with the injected instructions.
- C) It is no longer possible for the structured summary to contain anything an attacker has influenced.
- D) Every injected instruction is now detected and stripped out by the reading component.
โ Answer: B
The split separates exposure to untrusted text from the power to act. The component that reads injected text has no tools, and the component with tools receives only validated fields, never the raw message. Injected text still reaches the reader and fields can still be influenced by an attacker, so the design limits the path rather than detecting or removing every injection.
Source: code.claude.com/docs/en/agent-sdk/secure-deployment; platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks
At AutoHarbor Mobility, you work as a senior software engineer. The company's agent for vehicle-owner support reads inbound messages from owners, warranty documents, and vehicle manuals, and it is able to send responses and open service tickets. Because the agent's tool access produces real side effects and inbound content cannot be trusted, your team is responsible for both its guardrail stack and its adversarial testing. Under a proposed policy on autonomy, the agent could send replies and open service tickets without any review, with human sign-off required only for recommendations on warranty payouts. The agent may be reading untrusted messages from owners alongside warranty records at the moment any of these actions fires. Before approval, a security architect disputes the policy. What is the correct conclusion?
- A) As long as a human reviews payout recommendations, the policy holds up.
- B) The policy breaks down only if tools for executing code are given to the agent at a later point.
- C) Because replies are not reviewed, injected instructions have a direct route for sending warranty data outside.
- D) The chief risk lies in how many tickets are created, not in data escaping through replies.
โ Answer: C
The agent can read untrusted input, access private warranty records and send messages out, all in one session. With replies unreviewed, an injection could put records straight into a reply. Reviewing payouts does not cover that channel, and code execution is not needed for the data to leak.
Prompt injection (2)
An agent can read a user's private mailbox, browse untrusted web pages and send HTTP requests to any host. Which change breaks the most dangerous combination while keeping its research ability?
- A) Restrict outbound requests to an allowlist so that private data cannot be sent elsewhere
- B) Add a sentence telling the agent to ignore any instructions it finds on a web page
- C) Use a larger model that is better at noticing when a web page has been tampered with by an attacker
- D) Show the user a summary of the pages that were visited after the session has ended
โ Answer: A
Private data, untrusted content and an outbound channel together allow exfiltration. Removing the open channel limits damage even if an injection succeeds. Instructions and stronger models lower the odds but enforce nothing.
A team plans to stop injection with an input classifier that catches 98% of known attacks. The agent can delete customer records without approval. What should the security review conclude?
- A) The classifier is useful, but high-impact actions still need privilege limits or approval
- B) The classifier should be removed, because a control that can miss is of no use
- C) The classifier is enough, because two percent of attacks is a small remaining share of all traffic
- D) The classifier should run after deletion, so that it does not slow down the agent
โ Answer: A
Attackers can keep trying until one attempt passes, so a probabilistic filter cannot be the only barrier in front of an irreversible action. Least privilege and approval limit the damage when it misses.
Runtime guardrails (4)
A project denies Read(./.env). A reviewer shows that a Python script run by the agent can still open the file. What should be added for real enforcement?
- A) An allow rule for Python, so that its file access can be tracked by name
- B) A second Read rule, so that the same path is listed twice in the settings file
- C) A note in CLAUDE.md, so that the agent knows which files are private
- D) OS-level sandboxing, so that the file is blocked for child processes as well
โ Answer: D
Permission rules cover the built-in file tools and recognized commands, not arbitrary subprocesses. Sandboxing enforces filesystem limits at the operating-system level for commands and their children.
A settings file allows Bash(git push *) and denies Bash(git push --force *). A developer argues that the allow rule wins because it is listed first. How are the rules evaluated?
- A) Allow rules are checked first, and deny rules apply only when none match
- B) The first rule in the file that matches wins, so the force push is allowed
- C) The longest rule that matches wins, but only for rules in the same category of permission
- D) Deny rules are checked first, then ask, then allow, so the force push is denied
โ Answer: D
Rules are evaluated in the order deny, ask, allow, and the first match in that order decides. Position in the file and specificity do not change it. Text patterns on commands can still be evaded, so branch protection should back this up.
A PreToolUse hook returns "allow" for a command, but a managed deny rule matches the same command. What happens?
- A) The call is blocked, because a hook's allow does not bypass deny rules
- B) The call runs once, and the deny rule applies from the next call onward
- C) The call is paused until an administrator edits the managed settings
- D) The call runs, because hooks are always evaluated after every rule
โ Answer: A
Hook decisions do not bypass permission rules. A matching deny rule blocks the call whatever the hook returned, which preserves deny-first precedence. Hooks can tighten policy but not loosen it.
A security hook calls a remote policy service. When the service is slow, the hook times out and the command runs anyway. The team needs it to fail closed. What should it do?
- A) Ask the agent to wait until the policy service has answered
- B) Configure the hook so that its failure blocks the action
- C) Raise the output limit so that the hook has time to respond
- D) Move the hook to run after the tool, where it can undo the call
โ Answer: B
By default a timed-out hook does not block the call. A hook that enforces policy should be set to block on failure. A PostToolUse hook runs after the action and cannot undo it.
Source: code.claude.com/docs/en/hooks
MCP security (4)
An MCP proxy uses one static client ID with a third-party provider. A user who already consented clicks a crafted link, and an attacker's client obtains access with no new consent screen. Which control is required?
- A) A longer expiry for the provider's consent cookie, so that users log in less often
- B) A shared client ID for all attackers, so that their requests can be grouped in logs and reviewed later
- C) A redirect address matched by wildcard, so that new clients can register easily
- D) Per-client consent stored by the proxy and checked before forwarding to the provider
โ Answer: D
This is the confused deputy problem. The proxy must keep its own per-user, per-client consent and check it before the third-party flow, and it must match redirect URIs exactly. A cookie at the provider cannot distinguish the proxy's clients.
Source: modelcontextprotocol.io/docs/tutorials/security/security_best_practices
An MCP server accepts any valid token from the company's identity provider, including tokens issued for other services. Why is this a problem?
- A) The server must accept only tokens issued for it, so it has to check the audience
- B) The server must accept tokens from all services so that tools stay compatible with each other
- C) The server must accept only tokens that were stored in a tool description
- D) The server must accept only tokens that are older than its current session
โ Answer: A
Without audience validation, a token stolen from or issued for another service works here too. The MCP guidance says servers must not accept tokens that were not explicitly issued for them.
Source: modelcontextprotocol.io/docs/tutorials/security/security_best_practices
A hosted MCP client follows metadata URLs supplied by remote servers. One server supplies http://169.254.169.254/ as its metadata address. What is the attack, and which control fits?
- A) Clickjacking on the consent page, so prevent the page from being framed
- B) SSRF against cloud metadata, so block private ranges and use an egress proxy
- C) Prompt injection into the model, so add a warning to the system prompt
- D) Token replay against the provider, so shorten the lifetime of each token and log its use
โ Answer: B
The address is a link-local cloud metadata endpoint, so following it can leak credentials. Enforcing HTTPS, blocking private and link-local ranges, checking redirects and using an egress proxy address SSRF.
Source: modelcontextprotocol.io/docs/tutorials/security/security_best_practices
At first connection, an MCP server asks for admin:*, although most users only read data. What is the better scope design?
- A) Ask for every scope at the start so that users never see a second consent request
- B) Use one wildcard scope and rely on the agent to avoid the actions it does not need at that moment
- C) Start with minimal read scopes and request more when a privileged action is first used
- D) Remove scopes completely and rely on the network location of each of the clients
โ Answer: C
Progressive, least-privilege scopes limit what a stolen token can do and make consent meaningful. Broad scopes expand the blast radius and hide intent in the audit trail.
Source: modelcontextprotocol.io/docs/tutorials/security/security_best_practices
Secrets and identity (2)
A CI system stores a long-lived API key in hundreds of pipelines. A security review asks for short-lived credentials tied to each workload. Which approach fits?
- A) One new long-lived key for each pipeline, rotated by hand at the end of every year
- B) A developer's personal login, copied to each pipeline and refreshed on demand
- C) Workload identity federation, exchanging the pipeline's identity token for a short-lived one
- D) The same key encoded in base64, so that it is not readable in the pipeline's logs
โ Answer: C
Federation lets a workload present an identity token from its platform and receive a short-lived access token, so there is no stored key to leak. A leftover API key in the environment can take precedence, so it must be removed.
Source: platform.claude.com/docs/en/manage-claude/workload-identity-federation
A shared Agent SDK container serves several customers. One customer's project notes appear in another customer's session. Which set of changes addresses the cause?
- A) A shorter session length, so that notes have less time to move between customers
- B) A prompt that tells each session to ignore notes that belong to some other customer
- C) A larger container with more memory, so that all the sessions can run at the same time
- D) Separate working and config directories per tenant, with filesystem settings and auto memory off
โ Answer: D
By default the SDK reads settings and memory files from disk, which can leak in a shared container. Per-tenant directories and disabling setting sources and auto memory isolate them. A prompt does not.
Data protection (1)
A hospital's application has a zero-data-retention arrangement for API calls. A developer adds a feature that stores session history on the provider's side. What should happen before launch?
- A) Ask users to leave their names out of the messages that they send to the feature
- B) Assume that it is covered, since an arrangement always applies to all provider features and accounts
- C) Encrypt the prompts with a password that is included in the same API request
- D) Check whether that feature is eligible, since the arrangement does not cover every feature
โ Answer: D
Eligibility differs by feature, and stateful features may retain data by design. It has to be verified, along with the application's own logs and traces, before regulated data is sent.
Source: platform.claude.com/docs/en/manage-claude/api-and-data-retention
D8 Agent Fleet Operations for Software Delivery 19 questions ยท 10% of exam
Agent fleet operations (7)
At CodeHarbor Systems, you work as a staff software engineer. Within the engineering organization, a fleet of coding agents handles migrations, refactoring, code review, and first response to CI incidents. The agents run unattended on a schedule, each in an isolated worktree, under managed settings that your team defines. Code is produced faster than humans can review it, and engineering the verification pipeline falls to you. When Finance checked the cost dashboard for the fleet against the monthly bill, the dashboard turned out to show under half of what was really spent. Its data comes from OpenTelemetry metrics exported by every agent session. To turn telemetry on, each engineer sets an environment variable in their own shell profile. The runner that launches scheduled agents does not load any shell profile, and three engineers who came on board this quarter have never set it. What action should you take?
- A) Define the telemetry variables in the environment block of the managed settings that are deployed to all machines.
- B) At each month's end, rescale the figures on the dashboard so they agree with the invoice.
- C) Reconstruct the dashboard using logs from scheduled jobs in place of the exported metrics.
- D) Remind engineers to add the variable to their shell profiles and use a checklist to track who has done it.
โ Answer: A
Spend is missing because telemetry depends on each person's shell profile, which scheduled runners and new engineers do not have. Managed settings apply the variables centrally to every session that uses them. Scaling figures hides the gap, rebuilding from scheduled logs misses interactive use, and reminders do not cover the runner.
At CodeHarbor Systems, you work as a staff software engineer. Within the engineering organization, a fleet of coding agents handles migrations, refactoring, code review, and first response to CI incidents. The agents run unattended on a schedule, each in an isolated worktree, under managed settings that your team defines. Code is produced faster than humans can review it, and engineering the verification pipeline falls to you. For five weeks in a row the merge queue at CodeHarbor Systems has been falling further behind, and a director suggests doubling the number of agents so that fixes ship sooner. Review capacity, counting both people and AI, is already maxed out. What would you advise?
- A) Empty the queue by merging without review any change whose risk score falls under an agreed level
- B) Grow calibrated review capacity first, keeping the fleet that generates code at its present size
- C) Group the waiting pull requests into weekly releases that humans review in bulk
- D) Go ahead with the expansion and give the additional agents items from the backlog
โ Answer: B
Review is the bottleneck, so generating more only lengthens the queue. Increase review capacity that has been checked for accuracy before increasing output. Skipping review or batching changes weakens quality control, and adding agents makes the backlog worse.
At CodeHarbor Systems, you work as a staff software engineer. Within the engineering organization, a fleet of coding agents handles migrations, refactoring, code review, and first response to CI incidents. The agents run unattended on a schedule, each in an isolated worktree, under managed settings that your team defines. Code is produced faster than humans can review it, and engineering the verification pipeline falls to you. Over three runs of the migration, the team grew the fleet from four agents to eight and then 16. According to telemetry, the number of merged changes barely moved, the depth of the review queue doubled with every run, and the share of changes reverted climbed from 2% to 9%. The next migration begins in a week. What would you advise?
- A) Halt migrations until the queue for review is empty, then restart with the fleet at the same size.
- B) Expand the fleet to 32 agents for the upcoming migration.
- C) Use fewer agents and give each one a bigger task that follows module boundaries.
- D) Stay at 16 agents but assign every pull request an additional reviewer.
โ Answer: C
More agents did not raise merged output; they doubled the review queue and raised reverts, so review and coordination are the limit. Fewer agents with larger tasks that follow module boundaries produce fewer pieces to review and less overlap. A pause alone changes nothing on restart, more agents worsen it, and a second reviewer per change adds load.
Source: code.claude.com/docs/en/agent-teams; www.anthropic.com/engineering/multi-agent-research-system
At CodeHarbor Systems, you work as a staff software engineer. Within the engineering organization, a fleet of coding agents handles migrations, refactoring, code review, and first response to CI incidents. The agents run unattended on a schedule, each in an isolated worktree, under managed settings that your team defines. Code is produced faster than humans can review it, and engineering the verification pipeline falls to you. The fleet accesses the latest model generation via two different provider platforms, with the agents split evenly between them. The two platforms are configured differently: reasoning mode, the surface for structured output, and default limits on requests all have settings specific to each platform. Under the migration plan, canary and quality gates are run on only one platform, after which both halves switch over at once. A reviewer raises a concern about the plan. What would you advise?
- A) Before the migration begins, bring both halves together on one platform.
- B) Run the canary along with its gates on each platform separately before either half switches over.
- C) On the second platform, add a period of monitoring after the switch, with rollback happening automatically.
- D) Switch the gated platform over first, then copy the configuration that passed there onto the other one.
โ Answer: B
Because the platforms are configured differently, a pass on one does not show that the other will behave the same way. Each needs its own canary and gates before cutting over. Consolidating is a much larger change, post-cutover monitoring detects problems only after exposure, and copied settings may not map across platforms.
Source: platform.claude.com/docs/en/build-with-claude/overview; platform.claude.com/docs/en/about-claude/models/migration-guide
At NorthStar Hospitality, you work as a senior software engineer. A concierge agent serves guests at the company's properties in Lisbon, Osaka, and Vancouver, backed by a shared platform team and configured separately for each property. It handles questions about the property, uses booking and housekeeping tools to coordinate requests, and has to stay inside strict cost and latency budgets in all regions. An auditor follows a single unauthorized change to a housekeeping schedule through the layers of the concierge system. The platform's audit shows the tool call was made under the identity of the Vancouver instance, and a matching request appears in the MCP server's log. In the housekeeping database, however, the write is logged against one database account shared by the MCP servers of all properties. It must become possible to attribute the final write to the workload that performed it. What would you advise?
- A) Note the name of the property in a comment column with every housekeeping write
- B) Issue a separate database credential to each property's MCP server and log the account for each write
- C) Turn on detailed logging of requests on every MCP server and keep those logs for a year
- D) In incident reviews, match writes in the database to tool calls by comparing request timestamps
โ Answer: B
A shared account makes every server look the same to the database. A separate credential for each property's server, recorded with each write, ties the write to the workload at the point it happens. Comments can be set by the writer, server logs do not change database identity, and timestamp matching is guesswork when requests overlap.
Source: modelcontextprotocol.io/docs/tutorials/security/security_best_practices
At NorthStar Hospitality, you work as a senior software engineer. A concierge agent serves guests at the company's properties in Lisbon, Osaka, and Vancouver, backed by a shared platform team and configured separately for each property. It handles questions about the property, uses booking and housekeeping tools to coordinate requests, and has to stay inside strict cost and latency budgets in all regions. On Monday, the dashboard shared by the platform shows that three times as many booking tool calls as before are failing across the concierge fleet. No release went out from the platform team that day. Grouping the failures by property, you see that Osaka accounts for 94% of them, and that the property's team switched on a new workflow for room upgrades on Monday morning. In Lisbon and Vancouver, failure rates are in line with the week before. What most likely explains this?
- A) Passing noise in the infrastructure behind the booking tool
- B) A configuration change at the property level in Osaka's workflow for room upgrades
- C) A regression in the platform code shared by every property
- D) A change in how the model tier serving all the regions behaves
โ Answer: B
The failures are concentrated in one property and began the day that property changed its configuration, while the other properties stayed normal and no platform release went out. A shared code regression or model change would be expected to affect all regions, and random backend noise would not line up this closely with Osaka.
At NorthStar Hospitality, you work as a senior software engineer. A concierge agent serves guests at the company's properties in Lisbon, Osaka, and Vancouver, backed by a shared platform team and configured separately for each property. It handles questions about the property, uses booking and housekeeping tools to coordinate requests, and has to stay inside strict cost and latency budgets in all regions. Compliance demands a full audit trail covering each housekeeping and booking tool call made by the concierge, tied to the agent instance that made it. One colleague suggests relying on the organization's administrative audit feed as the sole source of records. What would you advise?
- A) Turn on the administrative audit feed in all workspaces and use it as the record of tool calls
- B) Record every tool call, along with the agent's identity, in the audit pipeline of the concierge platform
- C) Each day, rebuild a picture of tool activity from the organization's reports on usage and cost
- D) Keep the administrative feed's data for longer and search it for events relating to tool calls
โ Answer: B
The requirement is a record of every tool call attributed to the agent instance, so capture it where the application makes the call and knows the identity. An administrative audit feed records organisation administration events and should not be assumed to hold application tool calls. Usage reports are aggregates, and longer retention cannot add events that were never recorded.
Source: platform.claude.com/docs/en/manage-claude/compliance-activity-feed; code.claude.com/docs/en/agent-sdk/observability
Automation in CI (2)
A CI job needs Claude Code's findings as an array that matches a fixed schema. Parsing free text has proved unreliable. Which approach fits?
- A) Use JSON output with a JSON schema and read the structured output field if present
- B) Use text output and split it into lines wherever a bullet character is found in the answer
- C) Use JSON output and search the result text for the first square bracket
- D) Use an interactive session and copy its final table into the job's log file
โ Answer: A
claude -p with JSON output and a JSON schema returns the data in structured_output. The field can be missing if a run ends without valid output, so the script must check for it.
Source: code.claude.com/docs/en/headless
A CI job runs claude -p on pull requests from forks. A fork adds a hook to .claude/settings.json, and the hook executes on the runner. Which choice reduces this risk most directly?
- A) Use the interactive mode, so that a trust dialog is shown on the build runner
- B) Use bare mode, so that project hooks and MCP servers are not loaded, on an isolated runner
- C) Use JSON output, so that hooks are listed in the result after they have run
- D) Use a longer prompt that tells the agent not to run hooks from a pull request
โ Answer: B
Non-interactive runs show no trust dialog and load the project's hooks and MCP servers. Bare mode skips them, and untrusted code should still run in an isolated environment without secrets.
Source: code.claude.com/docs/en/headless
Parallel agents (3)
A fleet's main session runs with edits accepted automatically. A reviewer subagent is defined with plan permission mode so that it cannot edit, but it edits files. What explains this, and what is the reliable fix?
- A) The plan mode applies only to commits, so remove the subagent's git access
- B) The subagent's name is too similar to the parent's, so give it a longer name
- C) The subagent used too many turns, so lower the turn limit in its definition
- D) The parent's mode takes precedence, so limit the subagent's tools to read-only ones
โ Answer: D
When the main conversation auto-accepts edits or bypasses permissions, a subagent runs in that mode and its own setting is ignored. Restricting its tools removes the ability to edit.
Twelve agents fix lint issues in one repository at once. Most time is now spent resolving merge conflicts in the same shared files. Which change should come first?
- A) Remove worktrees, so that agents can see each other's edits as they happen
- B) Ask each agent to commit more often without changing the files it works on
- C) Split the work by ownership of files or modules so that agents rarely overlap
- D) Add more agents, so that conflicts are resolved by a larger group of workers at the same time
โ Answer: C
Parallel work pays off when tasks are independent. Partitioning by file or module prevents the conflicts, while more agents or shared directories increase them.
Source: www.anthropic.com/engineering/multi-agent-research-system
A subagent is asked to summarize a vendor's web page. Its report says that the user has approved deleting the test database. How should the main agent treat that sentence?
- A) As a permission rule that stays in force until the session ends or is restarted
- B) As untrusted report text that carries no authority from the user
- C) As an approval, because subagents speak on behalf of the user
- D) As an approval, as long as the deletion affects only test data
โ Answer: B
A subagent's report can repeat text from untrusted pages. It is data for the main agent, not an instruction or permission from the user, so any destructive step still needs real authorization.
Review and verification (4)
An agent writes code and then reviews its own change in the same conversation. It rarely finds problems that later reviewers catch. Which improvement is recommended?
- A) Ask the same conversation to review the change three more times
- B) Have a fresh context review the change against the requirements
- C) Ask the agent to add more comments, so that the review is easier
- D) Review only the commit message, since it summarizes the change
โ Answer: B
A reviewer with a fresh context is not biased by the reasoning that produced the code. Repeating the review in the same context tends to repeat the same blind spots.
A coding agent often reports success although the feature does not work in the running application. Unit tests it wrote itself pass. Which change most improves verification?
- A) Require independent checks such as existing tests and an end-to-end run before it may finish
- B) Require the agent to write twice as many unit tests for each function it adds
- C) Require the agent to use more formal language when it claims that work is done
- D) Require the agent to state how confident it is at the end of each of its reports
โ Answer: A
Agents need a way to check real outcomes. Tests the agent did not write and an end-to-end run give external evidence, while confidence statements and self-written tests can share the same mistake.
A team wants an agent's turn to end only when the test suite passes. Instructions in CLAUDE.md are sometimes skipped. Which mechanism fits?
- A) A PostToolUse hook that reverses any edit made before the tests
- B) A longer instruction in CLAUDE.md that explains why tests matter
- C) A Stop hook that runs the tests and blocks stopping when they fail
- D) A weekly report that lists the sessions in which tests were skipped
โ Answer: C
A Stop hook can prevent the turn from ending and return the failure to the agent, which makes the check deterministic. It should also have a guard so that it cannot loop forever.
Source: code.claude.com/docs/en/hooks
An AI reviewer posts thirty comments on each pull request. Developers now ignore all of them, including a real security finding. What should the fleet owner do?
- A) Post the same comments in two places so that developers see them twice
- B) Measure precision by category and post only those that meet an agreed bar
- C) Block every merge until each comment has been answered by a developer
- D) Turn the reviewer off permanently, since its findings are not being read by most developers
โ Answer: B
Low precision trains people to ignore a tool. Measuring by category lets accurate ones, such as security, stay visible. Blocking on noisy findings adds friction without improving trust.
Fleet operations (3)
A fleet will run the same migration across 600 repositories. A trial on one repository succeeded. What is the safest next step?
- A) Run a small, varied pilot, refine the instructions, then widen in stages with stop rules
- B) Run the one successful repository again ten times to confirm the first result
- C) Run all 600 at once, because a successful trial shows that the prompt is correct
- D) Run 300 at once, then run the remaining 300 whatever the first half shows
โ Answer: A
A single success does not represent varied repositories. A staged rollout with a diverse pilot, measured failure rates and stop conditions limits damage while the instructions improve.
Source: code.claude.com/docs/en/headless
A repository's CLAUDE.md has grown to 900 lines. Agents ignore important rules near the end. What should the maintainers do?
- A) Split the file into 900 separate files that are all loaded in each session
- B) Write the whole file in capital letters so that every rule looks important
- C) Repeat the important rules at the top, the middle and the end of the same file
- D) Keep it short, move task-specific material to skills, and enforce hard rules with hooks
โ Answer: D
Long instruction files dilute attention. Essential guidance should stay concise, occasional procedures belong in on-demand skills, and rules that must always hold need deterministic enforcement.
Source: code.claude.com/docs/en/memory
A scheduled agent must file a report at 02:30 local time in a region with daylight saving. Once a year the report is missing, and once a year it is filed twice. What is the best fix?
- A) Schedule in UTC or outside the changeover hours, and make filing idempotent
- B) Schedule two agents at 02:30 so that at least one of them always runs
- C) Schedule it as before and ask an operator to check the reports each year after the changeover
- D) Schedule it at 02:31 so that it does not fall exactly on the half hour
โ Answer: A
Local times around the changeover can be skipped or occur twice. UTC or a safe hour avoids the gap, and an idempotent filing step prevents duplicates from any cause.
Source: platform.claude.com/docs/en/managed-agents/scheduled-deployments
No questions match your search.