CCDV-F : Agents & Workflows (Domain 1)
Domain 1 : Agents and Workflows
This study guide provides a deep technical analysis of Domain 1: Agents and Workflows, as defined by the Claude Certified Developer – Foundations (CCDV-F) certification blueprint. This domain accounts for 14.7% of the total exam weight and is subdivided into Agent Architecture (4.5%), Agent Construction with Claude (5.3%), and Agent Patterns and Frameworks (4.9%).
As a foundational builder credential, the CCDV-F validates the ability to bridge Claude’s core intelligence with production-ready systems. This domain specifically addresses the transition from simple linear prompting to autonomous or semi-autonomous systems capable of multi-step reasoning, tool manipulation, and state management.
Agent Architecture: Workflow vs Agent Decision Criteria
Agent architecture represents the high-level design of how an AI system approaches problem-solving. In the Anthropic ecosystem, a primary distinction is made between deterministic workflows and autonomous agents. Understanding the technical trade-offs between these two patterns is a core requirement for the minimally qualified candidate.
Workflow vs. Agent: Technical Decision Criteria
A workflow is characterized by a predefined path of execution. While it may contain branching logic, the sequence of steps is generally hard-coded by the developer. In contrast, an agent uses the model’s reasoning capabilities to determine which steps to take, which tools to call, and when a task is complete.
| Feature | Workflow-Based Architecture | Agentic Architecture |
|---|---|---|
| Control Flow | Deterministic; defined by application code. | Autonomous; determined by the LLM at runtime. |
| Predictability | High; follows known paths and logic gates. | Variable; relies on model reasoning and tool output. |
| Flexibility | Low; requires code changes for new scenarios. | High; handles ambiguous or open-ended tasks. |
| Debugging | Easier; failure points are easily isolated. | Complex; requires trace analysis and log reviews. |
| Use Case | Data extraction, linear processing, pipelines. | Research, complex troubleshooting, coding assistants. |
The decision to use an agent versus a workflow hinges on the complexity and variability of the task. If the steps required to achieve an outcome can be mapped out in advance, a workflow is preferred for its reliability and lower cost. If the path to a solution depends on the content of intermediate steps (e.g., searching for information and deciding where to look next based on the results), an agentic architecture is necessary.
Supervisor and Manager Hierarchies
Complex agentic systems often employ supervisor or manager hierarchies to maintain focus and accuracy. In these patterns, a “Manager” or “Supervisor” agent is responsible for high-level planning and delegation.
- Manager Agent: Acts as the central orchestrator. It receives the primary user intent, breaks it down into sub-tasks, and assigns those tasks to specialized subagents. It also reviews the outputs of subagents to ensure they align with the original goal.
- Specialized Subagents: These are narrow-scope agents designed to perform a specific function (e.g., a “Search Agent,” a “Code Execution Agent,” or a “Data Formatting Agent”). By isolating these capabilities, developers can provide more specific instructions and tools to each agent, reducing the risk of context bloat and hallucination.
The Role of Subagents in Task Execution
Subagents are critical for improving task execution through isolation. By delegating a specific portion of a larger prompt to a subagent, the developer can implement:
- Context Isolation: Preventing irrelevant information from a previous step from confusing the current task.
- Instruction Clarity: Allowing for more detailed, domain-specific system prompts that would otherwise exceed the effective instruction-following limit of a single large prompt.
- Tool Limitation: Providing only the specific tools required for a sub-task, which improves the model’s tool-selection accuracy.
Building Agents with Claude: SDKs and Deployment Strategies
Constructing a Claude-powered agent requires moving beyond the basic Messages API to implement loops, state management, and deployment strategies. Anthropic provides specific tools and SDKs to facilitate this process, ensuring that agents can interact with external environments reliably.
The Claude Agent SDK
The Claude Agent SDK is the primary tool for technical professionals building agentic systems. It simplifies the implementation of multi-step loops where the model receives a prompt, decides to use a tool, processes the tool’s output, and continues until a stop condition is met.
Key capabilities of the SDK include:
- Native Tool Integration: Streamlining the process of defining tool schemas and handling tool-use content blocks.
- State Management: Maintaining a record of the conversation history and tool outputs across multiple turns.
- Streaming Support: Allowing developers to process and display agent reasoning or output in real-time.
Custom Agent Loops and Harnesses
While the SDK provides a robust starting point, many production applications require custom agent loops or harnesses. A harness is the application code that wraps the model’s calls, providing the necessary environment for the agent to operate.
A typical custom loop involves:
- Input Processing: Sending the initial prompt and tool definitions to the Messages API.
- Output Analysis: Inspecting the response for
tool_useblocks. - Execution: Calling the local function or API corresponding to the tool request.
- Feedback Loop: Returning the tool output to the model in a new
tool_resultmessage. - Termination Logic: Ending the loop when the model provides a final response or reaches a predefined step limit (budget).
Deployment Models: Self-Hosted vs. Anthropic-Hosted
Architects must decide between different deployment models based on security, latency, and management requirements.
- Self-Hosted Models: The developer manages the infrastructure where the application code (and potentially the model, if using private instances) resides. This provides maximum control over data residency and environment configuration.
- Anthropic-Hosted (Managed) Models: Utilizing Anthropic’s infrastructure via the API. This model reduces operational overhead and provides easy access to the latest model versions (Opus, Sonnet, Haiku) and features like prompt caching.
Hooks for Deterministic Action and Safety
A major challenge in agent construction is preventing destructive or unintended actions. Hooks are programmatic intercepts within the agent loop that enforce safety and deterministic behavior.
- Human-in-the-Loop Hooks: Pausing execution when a high-stakes tool (e.g., “Delete Database”) is requested, requiring a human to approve or reject the action.
- Validation Hooks: Checking the arguments of a tool call before execution to ensure they meet specific criteria or types.
- Guardrail Hooks: Using separate, smaller models or hard-coded logic to inspect agent output for content policy violations before it is shown to the user or executed.
Claude Agent Design Patterns and Frameworks
Standardizing agent behavior requires the use of established patterns and abstraction frameworks. These help manage the complexity of multi-step tasks and the inherent limitations of LLM context windows.
Common Agent Design Patterns
Effective agents rely on several recurring patterns to maintain performance:
- Tool-Use Loops: The fundamental cycle of reasoning, acting, and observing.
- Sub-Agent Delegation: Breaking a monolithic task into manageable pieces for specialized agents.
- Memory Integration: Using persistent storage or specialized prompts to track information across sessions or long-running tasks.
- Extended Thinking: Leveraging models that support adaptive thinking or “effort levels” to solve complex reasoning problems before providing a final answer.
Context Window and Memory Management
Managing the context window is essential for long-running agents. As an agent acts, the history of tool calls and outputs can quickly fill the context window, leading to “context drift” or increased costs.
Technical strategies for management include:
- Pruning: Removing older or less relevant tool outputs from the message history.
- Compaction: Summarizing long stretches of conversation or tool results into a single concise block.
- Isolation: Using subagents for specific tasks so that the “Manager” agent only receives the final summary, rather than the entire raw execution trace.
- Prompt Caching: Reusing static parts of the context (like complex system instructions or large reference files) to reduce latency and costs.
Agentic Abstraction Frameworks
Several third-party and Anthropic-compatible frameworks have emerged to handle the “plumbing” of agentic systems. The CCDV-F blueprint specifically highlights:
- LangGraph: A framework focused on building stateful, multi-agent applications by representing them as graphs. It is particularly useful for complex cycles and loops that are difficult to manage in linear chains.
- PydanticAI: A framework that emphasizes type safety and structured data. It leverages Pydantic for defining tool schemas and validating model outputs, ensuring that the agent’s actions are conformant to the application’s data models.
- Strands: An agentic framework (noted in the blueprint) used for building multi-step tasks and workflows with Claude.
These frameworks provide the scaffolding for state management, retries, and orchestration, allowing developers to focus on the reasoning and tool logic of their agents.
Operating Claude Code as an AI Engineering Agent
Claude Code is a specialized implementation of an agent designed specifically for engineering workflows. It utilizes the same agentic principles—tool use, subagent delegation, and state management—to modernize codebases and automate development tasks.
- CLAUDE.md: A critical configuration component for Claude Code. It provides a hierarchy for project instructions, allowing developers to define global rules and local context for the agent.
- Claude Skills: Custom capabilities authored by the developer to extend the functionality of Claude Code, often taking the form of specific scripts or automated routines.
- Modes of Operation: Claude Code can run in several modes, including “Plan Mode” (for high-level strategy), “Headless Mode” (for CI/CD integration), and “Auto-Mode” (for autonomous task execution).
Security, Reliability, and Defending Against Prompt Injection
Because agents possess the autonomy to call tools and interact with data, they introduce unique security risks. The study guide emphasizes “secure-by-design” principles.
Prompt Injection and Jailbreak Defense
In agentic systems, prompt injection is a primary threat. Malicious text within a tool’s output or a user’s prompt could trick the agent into ignoring its instructions and performing unauthorized actions.
- Isolation of Untrusted Input: Treating any data retrieved from external tools or users as untrusted.
- Least Privilege: Ensuring the agent only has access to the tools and data strictly necessary for its task.
- Identity and Access Management (IAM): Using secure-by-design principles to manage API keys and credentials, ensuring that the agent operates under a specific security context.
Trace Analysis and Debugging
Debugging agents requires a shift from traditional unit testing to trace analysis. Because agents are non-deterministic, developers must analyze the execution trace—the sequence of thoughts, tool calls, and outputs—to identify failure modes.
Effective debugging involves:
- Isolating the Problem Origin: Determining if a failure occurred in the integration layer (e.g., a broken API call), the tool schema (e.g., ambiguous parameter descriptions), or the model output (e.g., a reasoning failure).
- Recovery Strategy Selection: Implementing retries with exponential backoff or providing more descriptive error messages to the agent so it can attempt to correct its own mistakes.
Domain 1 Key Terms Glossary
- Agent: An autonomous AI system that uses reasoning to determine its own steps, tool usage, and completion criteria.
- Workflow: A deterministic, predefined sequence of tasks and logic gates controlled by application code.
- Claude Agent SDK: A software development kit provided by Anthropic to streamline the construction of multi-step agentic loops and tool integrations.
- Subagent: A specialized agent with a narrow scope of work, typically managed by a supervisor or manager agent to improve focus and reduce context bloat.
- Context Drift: A phenomenon where an LLM loses track of the original goal or instructions due to an excessively long or noisy conversation history.
- Tool-Use Loop: The recurring cycle where an agent receives a prompt, calls a tool, observes the output, and reasons about the next step.
- Hook: A programmatic intercept used to enforce deterministic safety checks, human approvals, or validation logic within an agent loop.
- Claude Code: A command-line tool and agentic system designed for codebase modernization and software engineering tasks.
- Model Context Protocol (MCP): A standardized interface for exposing tools, resources, and prompts from backend systems to LLM host applications.
- Prompt Caching: An optimization technique that allows for the reuse of static context blocks to reduce cost and latency.
- Pruning: The act of removing older or irrelevant information from the agent’s message history to manage the context window.
- Compaction: Summarizing extensive tool results or dialogue into a concise summary to preserve space in the context window.
- Harness: The wrapper code that manages the environment, API calls, and tool execution for an AI agent.
- LangGraph: A framework for building stateful, multi-agent applications using graph-based control flows.
- PydanticAI: A framework for building agents that emphasizes type safety and structured data validation using Pydantic.
- Extended Thinking: A model capability that allows Claude to perform deep reasoning before providing a final response, often used for complex logical tasks.
- CLAUDE.md: A markdown file used to configure project-specific instructions and rules for Claude Code.
- Headless Mode: A mode of operating Claude Code without a user interface, typically used in CI/CD pipelines.
- Prompt Injection: A security vulnerability where a user or tool provides input that subverts the model’s system instructions.
- Trace Analysis: The process of reviewing the step-by-step execution history of an agent to debug reasoning or integration failures.
Domain 1 Practice Short Answer Questions
Q1: What is the primary differentiating factor between a workflow and an agent? Answer: The control flow. In a workflow, the path of execution is deterministic and defined by application code; in an agent, the path is autonomous and determined by the model’s reasoning at runtime.
Q2: Why would an architect choose to use a subagent hierarchy instead of a single monolithic agent? Answer: To improve task execution through isolation. Subagents reduce context bloat, allow for specialized instructions, and improve tool-selection accuracy by limiting the model’s scope.
Q3: Name two strategies for managing the context window in a long-running agentic session. Answer: Pruning (removing old tool outputs) and compaction (summarizing tool results or conversation history into concise blocks).
Q4: What is the purpose of a “Hook” in an agent construction loop? Answer: To enforce deterministic actions and safety, such as human-in-the-loop approvals for destructive actions or programmatic validation of tool arguments.
Q5: Which deployment model provides the maximum control over data residency and environment configuration? Answer: The self-hosted deployment model.
Q6: What framework mentioned in the blueprint is specifically designed for building stateful, cyclic multi-agent systems using graphs? Answer: LangGraph.
Q7: In the context of Claude Code, what is the function of the CLAUDE.md file? Answer: It provides a hierarchy for project instructions and rules, allowing developers to define global and local context for the engineering agent.
Q8: What is “context drift,” and how do subagents help prevent it? Answer: Context drift occurs when a model loses focus on the goal due to a cluttered history; subagents prevent it by isolating specific tasks so the manager agent only receives concise summaries.
Q9: What is the main security risk when an agent retrieves data from an external, untrusted tool? Answer: Prompt injection, where malicious text in the tool’s output subverts the agent’s system instructions.
Q10: According to the CCDV-F blueprint, what is the recommended way to handle a high-stakes, destructive action requested by an agent? Answer: Implementing a human-in-the-loop hook to pause execution until a human reviews and approves the action.
Domain 1 Architecture and Design Questions
- System Design: You are tasked with building a research assistant that must search the web, download PDFs, and summarize findings. Design a supervisor-subagent hierarchy for this task. Identify the specialized subagents needed and the tools each would require.
- Architecture Trade-offs: Compare a deterministic workflow and an autonomous agent for a customer support use case where the AI must check order status and initiate refunds. Under what specific conditions would you switch from a workflow to an agent?
- Optimization Strategy: An agentic loop is exceeding its budget due to the high volume of tool-use execution traces being sent in every turn. Propose a technical plan for context window management that uses pruning, compaction, and prompt caching to reduce costs without losing reasoning quality.
- Security Defense: Describe a multi-layered security strategy for an agent with write access to a GitHub repository. How would you defend against prompt injection coming from a pull request’s content?
- Debugging Scenario: An agent is repeatedly failing to complete a complex multi-step coding task. Describe how you would use trace analysis to determine whether the failure is due to “context drift,” poor tool descriptions, or a breakdown in model reasoning.
Leaderboard
No scores saved yet. Be the first!
25 Questions — Domain 1 : Agents and Workflows
Expand any question to reveal the correct answer and explanation.
-
1 A financial services firm requires a system to process loan applications through a specific sequence of risk assessment, identity verification, and credit scoring. Each step must be successfully completed and verified by a rule-based validator before the next begins. Which architectural pattern is most appropriate?
Consider whether the task sequence is fixed by business logic or if the AI should decide the next step.
A deterministic workflow
Workflows are preferred for predictable, code-driven steps where the sequence is predefined and requires programmatic validation at each stage.
-
✗ An autonomous agentic loop
Autonomous loops are designed for open-ended problem solving where the model decides the sequence, which introduces unnecessary non-determinism for rigid business processes.
-
✗ A single-agent supervisor hierarchy
Supervisor hierarchies are intended for decomposing complex, variable tasks among specialized subagents, not for executing linear, rule-based sequences.
-
✗ A flat tool-use loop with zero-shot prompts
While a tool-use loop can execute tasks, it lacks the structured state management and safety gates provided by a dedicated workflow architecture for multi-step validation.
-
-
2 When building a multi-agent system using the Claude Agent SDK, a coordinator agent is failing to get valid output from a 'Researcher' subagent. The coordinator's prompt is: 'Given the previous discussion, summarize the market trends.' Why does the subagent likely return a generic response or an error?
Think about how 'memory' is shared (or not shared) between different model instances in a hierarchy.
Subagents do not automatically inherit the coordinator's context window
In agentic architectures, subagents are isolated instances; relevant state and context must be explicitly packaged and passed by the coordinator.
-
✗ The Researcher subagent lacks the necessary tool permissions
While permissions matter, the specific failure to reference 'previous discussion' points to a context isolation issue rather than an access control error.
-
✗ The coordinator agent exceeded the maximum recursion depth
Recursion depth errors typically stop the loop entirely rather than causing the subagent to return a generic response based on missing information.
-
✗ The Claude Agent SDK enforces a strict single-turn policy for subagents
The SDK supports multi-turn interactions, but the underlying principle of context isolation remains the primary cause of 'memory' loss between agents.
-
-
3 In a LangGraph-based implementation, you observe that an agent frequently enters an infinite loop when a tool returns an error. What is the most robust architectural fix for this scenario?
Focus on the mechanism used to manage state transitions and loop boundaries.
Implement a max-turn counter and an error-state node in the graph
Production agents require bounded loops and dedicated nodes to handle tool failures and prevent runaway execution costs.
-
✗ Increase the model's temperature to encourage diverse retry strategies
Increasing temperature increases non-determinism and likely exacerbates looping behavior rather than providing a structured exit strategy.
-
✗ Add a line to the system prompt asking the agent not to loop on errors
Prompt instructions are probabilistic and often ignored during failure modes; programmatic constraints are necessary for reliability.
-
✗ Switch the tool to use a synchronous execution mode
The synchronicity of the tool does not address the logic of the agent's decision loop when encountering a persistent error.
-
-
4 Which scenario best justifies the use of a Supervisor/Manager hierarchy over a single-agent architecture?
Consider the complexity and the need for specialized division of labor.
A complex research task requiring parallel execution of disparate tools by specialized modules
Supervisor hierarchies excel at task decomposition and managing specialized sub-tasks that can be executed in parallel or require distinct expertise.
-
✗ A simple data extraction task from a single $10$ page PDF document
A single agent with high context capabilities is more efficient and less complex for straightforward extraction tasks.
-
✗ A user-facing chatbot that only needs to answer questions about a single product wiki
A standard RAG pattern with a single agent is sufficient for knowledge retrieval from a narrow domain.
-
✗ A low-latency application where the total token count must be minimized
Multi-agent hierarchies typically increase latency and token usage due to the overhead of inter-agent communication and task coordination.
-
-
5 When configuring Claude Code for a large repository, you want to ensure that every subagent strictly follows the project's 'no-global-variables' rule without repeating the instruction in every prompt. Where should this configuration live?
Look for the specific configuration file hierarchy mentioned in the Claude Code documentation.
In a root-level .claude/rules/ directory using glob patterns
Claude Code uses a hierarchy of rules files to enforce persistent behavioral constraints across the entire project environment.
-
✗ In the local shell's environment variables
Environment variables are not parsed as behavioral instructions by Claude Code's agentic logic.
-
✗ Inside the system prompt of the individual Claude API calls
While effective, this requires manual repetition and management, whereas rules files provide a shared, version-controlled standard.
-
✗ In the metadata section of the repository's README.md
While the agent might read the README, it is not a formal configuration path for enforcing systematic coding constraints.
-
-
6 An architect is concerned about 'Context Drift' in an agentic research system that runs for over $50$ turns. What technique from Domain 1 would most effectively mitigate this while preserving essential information?
Consider how to keep the agent's 'working memory' clean and relevant.
Periodic context compaction and summarization
Compaction reduces token bloat and focuses the model on relevant recent history and distilled findings, preventing drift.
-
✗ Using a model with a $200\text{k}$ token window
A larger window allows more data but does not prevent the model from becoming distracted by irrelevant details accumulated over many turns.
-
✗ Setting the temperature to $0.0$
Zero temperature ensures consistency but does not address the accumulation of noise in the context buffer.
-
✗ Hard-coding the system prompt at the end of every user message
This helps with instruction following but does not manage the overall size or relevance of the conversation history.
-
-
7 A developer is using PydanticAI to build a Claude agent. What is the primary advantage of using this framework for agentic workflows compared to raw API calls?
Think about the 'Pydantic' part of the name and its role in Python development.
Type-safe dependency injection and structured output validation
PydanticAI leverages Pydantic for robust schema validation and clean dependency management, ensuring agent responses match expected software contracts.
-
✗ Native support for training Claude models on local GPUs
Claude models are proprietary and accessed via API; PydanticAI is an orchestration framework, not a training library.
-
✗ Automatic translation of Python code into prompt instructions
While it uses Python, it does not magically translate general code into prompts; it provides a structure for defining how agents interact with code.
-
✗ Bypassing Anthropic's safety filters for internal testing
Safety filters are server-side and cannot be bypassed by client-side orchestration frameworks.
-
-
8 In the context of 'Agent Construction,' what is the primary role of a 'Hook' in a production Claude application?
Think about how to enforce $100\%$ compliance for critical safety or compliance steps.
To execute deterministic code before or after model calls for safety or logging
Hooks allow developers to intercept the agent loop to enforce business rules, scrub PII, or validate tool arguments programmatically.
-
✗ To increase the likelihood of the model selecting a specific tool
Tool selection is influenced by tool descriptions and 'tool_choice' parameters, not by execution hooks.
-
✗ To allow the model to modify its own system prompt dynamically
Allowing the model to modify its own system instructions is generally a security risk and not the purpose of architectural hooks.
-
✗ To reduce the latency of the initial API handshake
Hooks actually add a small amount of overhead by running additional code during the lifecycle of the request.
-
-
9 A multi-agent system is producing inconsistent results. The 'Reviewer' agent often approves 'Writer' agent outputs that contain factual errors. According to architectural best practices, which fix should be attempted first?
Consider the principle of fixing the design before reaching for infrastructure changes.
Refine the Reviewer agent's design and provide few-shot examples of incorrect vs. correct work
Design optimization through better instructions and examples is the preferred first step before changing infrastructure or increasing model size.
-
✗ Upgrade the Reviewer agent to a larger model tier immediately
Switching models is an expensive 'brute force' solution that may not fix underlying design flaws in the instruction set.
-
✗ Merge the Writer and Reviewer into a single-turn prompt
Merging the agents loses the 'independent review' benefit where the model can objectively critique output without being biased by its own generation context.
-
✗ Reduce the temperature of the Writer agent to $0.2$
This may make the Writer more consistent but does not address the Reviewer's inability to detect errors.
-
-
10 You are building an agent using the 'Strands' framework. Which feature is most critical for managing long-running, multi-step tasks that may span several hours?
What is needed if an agentic process is interrupted mid-way through a $100$ step task?
State persistence and checkpointing
Checkpointing allows the agent to resume from a known state in case of connection failure or system interruption during long tasks.
-
✗ The ability to stream token-by-token output to a UI
Streaming improves user experience but is not the primary mechanism for managing task duration or reliability over long periods.
-
✗ High-speed tokenization of local files
Tokenization speed is a minor factor compared to the logic of maintaining task state across many API turns.
-
✗ Integration with the Message Batches API
The Batch API is for non-urgent, high-volume processing and is not suitable for interactive, multi-step agentic loops.
-
-
11 When designing a supervisor hierarchy, how should 'Context Isolation' be handled when the supervisor delegates a task to a specialized subagent?
Think about the efficiency of the prompt and the focus of the subagent.
The supervisor should extract only the relevant data and pass it as a fresh prompt to the subagent
This prevents 'context bloat' and ensures the subagent is not distracted by irrelevant information from the supervisor's larger coordination history.
-
✗ The entire conversation history should be passed to maintain full situational awareness
Passing the full history leads to noise, increased costs, and higher likelihood of the subagent losing track of the specific sub-task.
-
✗ The subagent should be given access to the supervisor's database session
Sharing session state at the database level does not resolve the 'model context' issue of what information is currently in the prompt.
-
✗ Subagents should automatically query the supervisor for missing information
Relying on subagents to 'guess' what they are missing is inefficient; the coordinator should provide the necessary context upfront.
-
-
12 In an agentic workflow, a developer uses the 'Task' tool to delegate a sub-problem. What is a common anti-pattern to avoid in the subagent's response?
Consider who the 'audience' of the subagent's output actually is.
Providing the response in a conversational format intended for the end-user
Subagents should return structured data or concise findings intended for the coordinator, not conversational 'chatter' meant for a human.
-
✗ Returning a JSON-formatted object
JSON is a preferred pattern for subagent responses as it allows the coordinator to parse the results programmatically.
-
✗ Indicating that it does not have enough information
While frustrating, this is a valid response that the coordinator needs to handle by providing more context.
-
✗ Calling a tool that the coordinator also has access to
Tool overlap is common; the subagent's primary value is the reasoning applied to that tool's output within its specialized scope.
-
-
13 A developer needs to implement a 'Human-in-the-loop' (HITL) gate for an agent that processes bank transfers. Where is the most reliable place to implement this gate?
Safety critical steps require more than just instructions; they require 'hard' programmatic blocks.
In a post-tool-use hook that requires manual approval before the transfer function executes
Deterministic gates in the application code are the only way to guarantee a human reviews a high-consequence action before it is finalized.
-
✗ In the system prompt, telling Claude to 'ask for permission' before transfers
Prompts can be bypassed by the model's own reasoning or accidental context drift; they are not reliable for security/financial gates.
-
✗ In the User Message, by appending 'Wait for my okay' to every request
This is a weak control that is easily ignored or misunderstood by the model during a multi-turn interaction.
-
✗ In the tool's description field, stating that 'approval is needed'
The description helps the model understand the tool but does not prevent the model from calling it if it feels justified by the task.
-
-
14 When using LangGraph, how does the framework handle 'Non-determinism' in an agent's path through the graph?
Think about how the 'flow' of the conversation is directed based on what the model says.
By using conditional edges that evaluate the agent's output to decide the next node
LangGraph allows for dynamic routing where the path is determined at runtime based on the state or model output, accommodating agentic autonomy.
-
✗ By forcing the agent to follow a strict linear sequence of nodes
This describes a fixed workflow, not the flexible agentic orchestration that LangGraph is designed to enable.
-
✗ By running three versions of the agent in parallel and taking the majority vote
While a possible design pattern (ensemble), it is not the core mechanism LangGraph uses to handle path non-determinism.
-
✗ By automatically retrying any node that produces a different result on the second pass
Frameworks do not typically re-run nodes simply because LLMs are non-deterministic; they manage the state transition based on the results provided.
-
-
15 A developer wants to use the 'Agent SDK' to build a self-hosted agent. What is the primary architectural consideration for 'Managed agent deployment models'?
Focus on what the 'harness' needs to do to keep the agent running safely and effectively.
Ensuring the agent harness has stable, authenticated access to the Claude API and local tools
Managed deployment requires a secure runtime (harness) that handles the orchestration logic, API keys, and connection to target systems.
-
✗ Minimizing the size of the Python runtime to under $50\text{MB}$
While optimization is good, it is a minor concern compared to security, connectivity, and reliability of the orchestration harness.
-
✗ Hard-coding the IP addresses of the Anthropic API servers
Hard-coding IP addresses is a poor networking practice and does not address agent-specific architectural needs.
-
✗ Using a model with a smaller context window to save on hosting costs
Anthropic-hosted models are priced by tokens, and self-hosting refers to the orchestration code, not the model parameters themselves.
-
-
16 Which of the following represents a 'Task Decomposition' failure in a coordinator agent?
Think about the 'Manager' role�if the boss gives a bad assignment, the worker can't do a good job.
The coordinator gives a subagent a task that is too broad, leading to a vague response
Task decomposition requires breaking down a problem into small, manageable, and specific units that specialized agents can execute accurately.
-
✗ The subagent takes too long to generate a response
This is a latency issue, potentially related to model size or task complexity, but not necessarily a failure of the coordinator's decomposition logic.
-
✗ The coordinator ignores a tool that it was instructed to use
This is an instruction-following failure, not a decomposition failure.
-
✗ The subagent's API key has expired
This is a credential management / infrastructure failure.
-
-
17 What is the recommended approach for an agent to 'self-correct' its own errors in a multi-step task?
Is it easier to find your own typos or have someone else look at your work?
Passing the error and prior output to a separate 'Reviewer' instance with a fresh context
Independent review is more effective than self-correction within the same session because the model lacks the 'bias' of its own recent reasoning steps.
-
✗ Telling the model 'You made a mistake, please try again' in the next turn
This is common but less effective than independent review, as the model often repeats the same logical errors once they are in the context.
-
✗ Setting 'stop_sequences' to include common error phrases
Stop sequences end the generation; they do not help the model correct or reason about an error.
-
✗ Increasing the penalty for long-form responses
Response length penalties do not address the accuracy or correction logic of the agent.
-
-
18 A developer is implementing an agent using 'Claude Skills.' How do Skills differ from standard tool definitions in the Claude ecosystem?
Think about modularity and reusability.
Skills are reusable sets of instructions and tools that can be shared across agents and projects
Skills provide a modular way to package capabilities (like 'Code Reviewer' or 'Data Cleaner') so they can be easily invoked by different agents.
-
✗ Skills are only available when using the Claude Desktop application
Skills can be used via the API and in Claude Code, providing a consistent way to extend capabilities across interfaces.
-
✗ Skills use a proprietary binary format instead of JSON
Skills are generally defined using structured text formats (like Markdown or YAML) consistent with the rest of the ecosystem.
-
✗ Skills allow Claude to access the internet without using any tools
Claude requires tools (like a web search tool) to access the internet; Skills are a way to organize those tools and their usage instructions.
-
-
19 When constructing an agentic 'harness,' why is it important to handle the 'stop_reason' field from the Claude API?
This field tells the software what the model wants to do next: talk, use a tool, or keep going.
To determine if the agent finished its task or if it needs to call a tool or continue due to length
The 'stop_reason' indicates if the model is requesting a 'tool_use' or if it was cut off by 'max_tokens', necessitating a follow-up request.
-
✗ To measure the exact latency of the model's reasoning process
Latency is measured by timing the request-response cycle; stop_reason is about the logical state of the output.
-
✗ To identify if the user has manually terminated the session
The API does not know about user-side session termination; stop_reason is a property of the model's response generation.
-
✗ To trigger an automatic retry with a higher temperature
While a harness might retry, 'stop_reason' itself is used to interpret the *type* of response, not just to signal failure.
-
-
20 A research agent system is becoming too expensive due to high token usage. The architect notices that the agent repeatedly fetches the same large documentation pages. Which pattern would most effectively reduce cost?
Look for a feature that targets the 're-processing' of the same data.
Implement prompt caching for the frequently used documentation context
Prompt caching allows the model to reuse previously processed tokens, significantly reducing costs for static context used across many turns.
-
✗ Switch to a smaller model for the documentation fetching tool
The model used by the tool doesn't change the cost of the context provided *to* the agent in the main loop.
-
✗ Truncate the documentation to $500$ words per page
This saves tokens but likely destroys the utility of the research system by removing essential information.
-
✗ Run the agent only during off-peak hours
API pricing is generally based on volume (tokens), not time-of-day.
-
-
21 Which of the following is a key distinction between the 'Strands' framework and 'LangGraph'?
Think about 'threads' versus 'graphs'.
Strands focuses on linear agent 'threads' while LangGraph emphasizes cyclical state graphs
The frameworks take different conceptual approaches to representing the 'flow' and 'state' of agentic interactions.
-
✗ LangGraph is only for Python, while Strands is only for TypeScript
Many frameworks have multi-language support; the primary distinction is in their underlying orchestration philosophy.
-
✗ Strands requires a subscription to Anthropic's enterprise tier
Orchestration frameworks are generally open-source or separate from the model's API access tiers.
-
✗ LangGraph cannot handle tool calls
LangGraph is specifically designed to manage complex state transitions, including those triggered by tool calls.
-
-
22 An agent needs to use a tool to delete a file. To prevent accidental data loss, the architect decides to use a 'PostToolUse' hook. What should this hook do?
The hook is the 'last line of defense' before a permanent action.
Wait for a user-provided boolean 'confirm' before finalizing the deletion in the backend
Programmatic gates between the model's 'intent' to delete and the actual 'execution' of the delete are essential for safety.
-
✗ Log the deletion to a text file for later review
Logging is good for auditing but does not prevent the 'accidental' loss in the first place.
-
✗ Verify the model's confidence score is above $0.9$
Confidence scores from LLMs are notoriously unreliable for security-critical decisions.
-
✗ Tell the model to 'Be careful' before it calls the tool
This is a prompt instruction, not a programmatic hook, and can be easily ignored.
-
-
23 When designing an agent's memory system, what is the 'Context Window' tradeoff?
Does more information always make it easier to find the right answer quickly?
More context increases the agent's knowledge but also increases latency and the risk of distraction
Large context windows are powerful but come with higher compute costs (latency) and the 'needle in a haystack' problem where models lose focus.
-
✗ Smaller context windows lead to higher token costs per request
Token costs are generally linear or discounted; smaller context actually costs less per individual request.
-
✗ A larger context window allows the model to reason about things it hasn't seen yet
Context is for information the model *has* been given; it doesn't grant predictive powers over unknown data.
-
✗ The context window only matters for the initial system prompt
The window includes the system prompt, conversation history, and all tool outputs from the current session.
-
-
24 A developer is implementing a 'Supervisor' agent that needs to manage three subagents. What is the most effective way to prevent the supervisor from exceeding the Claude API rate limits?
Is this a task for the AI's reasoning or for the surrounding software infrastructure?
Implement a queue and rate-limiting logic in the orchestration harness
Rate management must be handled by the application code (harness) to ensure requests are spaced according to the provider's limits.
-
✗ Tell the supervisor agent in its prompt to 'Wait $10$ seconds' between tasks
LLMs have no internal clock and cannot reliably 'wait' or manage API-level timing constraints.
-
✗ Reduce the 'max_tokens' for every subagent request
While this reduces token volume, it does not address the 'requests-per-minute' (RPM) limit that is often the bottleneck.
-
✗ Use the Haiku model for the supervisor and Opus for the subagents
Different models have different limits, but simply switching tiers doesn't remove the need for structured rate-limiting in the software.
-
-
25 In a complex multi-agent system, the 'Coordinator' is responsible for 'Pruning' tool outputs. What does this mean in a practical architectural context?
Think about how to keep a 'cluttered' conversation focused and short.
Removing or summarizing redundant or excessive data from a tool's result before adding it to the conversation history
Pruning prevents the context from being filled with irrelevant technical details (like $500$ lines of raw logs) that distract the model and increase costs.
-
✗ Restricting the model from using certain tools during specific times of the day
This is a form of scheduling or access control, not 'pruning' of outputs.
-
✗ Identifying and deleting agent instances that are no longer needed
This is resource management / lifecycle management, not context pruning.
-
✗ Automatically correcting spelling errors in the tool's JSON response
While possible, pruning specifically refers to managing the *volume* and *relevance* of information in the context.
-