CCDV-F · Domain 1: Agents and Workflows · 17% of the exam
Task 1.1: Architecture and Runtime Selection
Deciding between a fixed workflow and an agent for given business, error-tolerance and audit needs, splitting work between an orchestrator and subagents, and choosing where the agent runs: a harness you host or a managed, sandboxed runtime.
Study it
Workflow or agent: orchestrators, subagents, and a hosted harness versus a managed runtime
Try each one before opening the answer. Every option is explained, with the Anthropic documentation page that proves it.
Question 1 · choose 1
An agent you built will close stale tickets and edit records in the production help-desk system with no person reviewing each step. The business can tolerate very few mistakes, and the agent's prototype was tested only against a handful of example tickets. Before it runs on production, what does Anthropic's guidance on agents recommend?
ATest it extensively in a sandboxed environment and add guardrails around the actions it can take
BRebuild it on a framework so that the prompts and tool calls are handled by a library instead of your own code
CLet it run on production and have a person read the final summary it writes at the end of each run
DGive it more tools so that it can recover from its own mistakes without needing to stop
Show the answer and why
ATest it extensively in a sandboxed environment and add guardrails around the actions it can take
Correct
Autonomy brings higher costs and the potential for compounding errors, so the guidance calls for sandboxed testing plus guardrails.
BRebuild it on a framework so that the prompts and tool calls are handled by a library instead of your own code
Incorrect
Frameworks add layers that can obscure the prompts and responses and make the agent harder to debug; they reduce no risk here.
CLet it run on production and have a person read the final summary it writes at the end of each run
Incorrect
A summary after the run catches nothing while errors compound across the many steps the agent takes on its own.
DGive it more tools so that it can recover from its own mistakes without needing to stop
Incorrect
More tools widen what the agent can do wrong; they are no substitute for testing and guardrails.
Agents operate for many turns on their own judgment. Their autonomy means higher costs and the potential for compounding errors, so Anthropic recommends extensive testing in sandboxed environments, along with appropriate guardrails, before trusting one with real systems.
Your web service hosts the Claude Agent SDK in one container and starts a query() for each user who opens a coding session. Sessions run at the same time, and users report that files created in one user's session show up in, and are overwritten by, another user's session. The options passed to query() set only the model and the allowed tools. What should you change?
ARun every session against the same folder but give each one its own session ID through the resume option
BPass each session's query() a distinct cwd, such as a folder per session
CSet max_turns lower so that each session finishes before another one starts writing
DStart a second CLI subprocess inside each session so that its tools run in a process of their own
Show the answer and why
ARun every session against the same folder but give each one its own session ID through the resume option
Incorrect
A session ID separates transcripts, not the folder the shell and file tools work in.
BPass each session's query() a distinct cwd, such as a folder per session
Correct
Concurrent sessions inherit the application's working directory by default; a distinct cwd per query() separates them.
CSet max_turns lower so that each session finishes before another one starts writing
Incorrect
Turn limits shorten runs but do not stop concurrent sessions from sharing one working directory.
DStart a second CLI subprocess inside each session so that its tools run in a process of their own
Incorrect
Each session already has its own subprocess; the processes still share a folder unless cwd differs.
Each query() spawns its own claude CLI subprocess, but by default all of them inherit your application's working directory. When sessions need separate working directories, pass a distinct cwd in the options of each session's query() call.
Your team runs an agent on Claude Managed Agents, which is in beta. The agent's bash tool must query a database at db.corp.internal, a host that is reachable only inside your company network. The environment the sessions use is:{
"name": "support-env",
"config": {
"type": "cloud",
"networking": {"type": "limited", "allow_package_managers": true}
}
}What should you change?
ACreate a self_hosted environment and run its worker inside your network
BAdd db.corp.internal to the cloud environment's allowed_hosts list
CHave the agent reach the database through the web fetch tool instead of its bash tool
DMove the bash tool from the agent definition into the environment's configuration
Show the answer and why
ACreate a self_hosted environment and run its worker inside your network
Correct
With a self-hosted sandbox, the worker runs the bash and file tool calls inside your network, where the internal host is reachable.
BAdd db.corp.internal to the cloud environment's allowed_hosts list
Incorrect
The cloud sandbox runs on Anthropic-managed infrastructure, which cannot reach a host that is not publicly routable.
CHave the agent reach the database through the web fetch tool instead of its bash tool
Incorrect
Web fetch runs on Anthropic's side, not in your sandbox, so it does not reach the internal host either.
DMove the bash tool from the agent definition into the environment's configuration
Incorrect
Tools are set on the agent, not on the environment; the environment decides only where they run.
An environment sets where an agent's tools and code run. Choose a self-hosted sandbox when the agent must reach internal services that aren't publicly routable: your worker runs the bash and file tools inside your network. The agent definition stays the same.
Your coordinator, built with the Claude Agent SDK, runs unattended in the default permission mode with no canUseTool callback. It delegates file reviews to a reviewer subagent defined in the agents option with tools ["Read", "Grep"], but every Read and Grep call the reviewer makes fails for lack of approval. Claude has also begun starting forks that copy the whole conversation, and you want only your defined subagents to run. Which TWO changes do this? (Choose TWO.)
AAdd Read and Grep to the allowed_tools option of the query
BAdd "Agent(fork)" to the disallowed_tools option of the query
CSet background to true in the reviewer's definition so that it no longer waits for approvals
DSet the reviewer's model to "inherit" so that it runs with the same permissions as the coordinator
EAdd "Agent(fork)" to the allowed_tools option so that the rule controls when forks start
Show the answer and why
AAdd Read and Grep to the allowed_tools option of the query
Correct
Listing a tool in a subagent's tools field does not pre-approve it; an allow rule does.
BAdd "Agent(fork)" to the disallowed_tools option of the query
Correct
This deny rule stops only the fork subagent type, and your other subagents still run.
CSet background to true in the reviewer's definition so that it no longer waits for approvals
Incorrect
Background runs are non-blocking; they do not approve tool calls.
DSet the reviewer's model to "inherit" so that it runs with the same permissions as the coordinator
Incorrect
The model field picks which model the subagent uses; it does not grant approvals.
EAdd "Agent(fork)" to the allowed_tools option so that the rule controls when forks start
Incorrect
An allow rule approves calls; it does not stop Claude from starting forks.
A subagent definition's tools array limits which tools the subagent can use, but listing a tool there does not pre-approve it: unattended runs need an allow rule such as allowed_tools. Forks copy the conversation instead of starting fresh, and an Agent(fork) deny rule stops them while other subagents still run.
You self-host the Claude Agent SDK on a pool of hosts, each running one long-running container that serves many agent sessions at once. Following the SDK's hosting guidance, how should you work out how many concurrent sessions one host can take?
ADivide the host's RAM by 1 GiB, since that starting point is the most memory any single session will ever need
BCount the host's CPU cores, since all the sessions on a host share one CLI subprocess and its memory
CMeasure the peak memory of a representative session at its target length, and divide the spare host RAM by it
DMeasure one idle session right after startup, since a session's memory stays flat for as long as it runs
Show the answer and why
ADivide the host's RAM by 1 GiB, since that starting point is the most memory any single session will ever need
Incorrect
The guide calls 1 GiB a floor, not the ceiling; memory grows with session length and tool activity.
BCount the host's CPU cores, since all the sessions on a host share one CLI subprocess and its memory
Incorrect
Each session runs in its own subprocess, so the RAM those processes need bounds how many a host can hold.
CMeasure the peak memory of a representative session at its target length, and divide the spare host RAM by it
Correct
Agents per host is the host RAM minus overhead, divided by the per-session RAM ceiling measured as peak RSS.
DMeasure one idle session right after startup, since a session's memory stays flat for as long as it runs
Incorrect
Memory grows with session length and tool activity, so the idle baseline understates what a session needs.
Each Agent SDK session runs in its own CLI subprocess, so a host's concurrency is bounded by how many subprocesses its RAM can hold. Size each host as the host RAM minus overhead, divided by the per-session RAM ceiling: run a representative session to your target length under the expected tool load and record its peak RSS. The 1 GiB per agent starting point is a floor, not the ceiling.
You host the Claude Agent SDK for a feature where each user request produces one report and nothing happens afterward. Which session pattern from the SDK's hosting guidance fits this workload?
ALong-running sessions: persistent containers that host many SDK processes and keep each query warm
BMulti-agent container: several SDK subprocesses in one container that work together in a shared environment
CA stateless API wrapper with no process behind it, since the SDK runs entirely in your request handler
DEphemeral sessions: a container per user task that is destroyed when the task completes
Show the answer and why
ALong-running sessions: persistent containers that host many SDK processes and keep each query warm
Incorrect
Long-running sessions suit agents that act continuously or serve ongoing traffic.
BMulti-agent container: several SDK subprocesses in one container that work together in a shared environment
Incorrect
That pattern is for agents that must collaborate closely, not for independent one-off tasks.
CA stateless API wrapper with no process behind it, since the SDK runs entirely in your request handler
Incorrect
The SDK spawns and supervises a CLI subprocess with its own shell and local state.
DEphemeral sessions: a container per user task that is destroyed when the task completes
Correct
Ephemeral sessions are the pattern for one-off tasks.
The hosting guide lists session patterns by how long a container lives relative to its sessions. Ephemeral sessions create a container for each user task and destroy it when the task completes, which fits one-off tasks; long-running sessions fit continuous or high-volume work.