Anthropic · Free Practice Questions · Last reviewed May 2026
24real exam-style questions organised by domain, each with the correct answer highlighted and a plain-English explanation of why it's right — and why the others are wrong.
An enterprise developer is designing a customer-facing financial chatbot using Claude 3.5 Sonnet. The application needs to prevent users from eliciting investment advice or unauthorized financial recommendations. Which architectural pattern provides the most robust defense-in-depth safety mechanism against prompt injection bypassing system instructions?
Rely solely on advanced system prompts containing explicit constraints against giving financial advice, utilizing Claude's strong instruction-following capabilities.
Implement a post-generation regex filter that scans output text for specific financial disclaimer phrases before returning responses to the end user.
Deploy a two-tier validation pipeline where incoming queries pass through a lightweight safety classifier model before reaching Claude, combined with robust system prompts.
A lightweight safety classifier screens each incoming query before Claude processes it, catching injection attempts that evade system prompts alone. This defence-in-depth layer satisfies the requirement to block elicitation of investment advice even when prompt-level instructions are bypassed.
Lower the model's temperature parameter to zero to ensure deterministic outputs that strictly adhere to the safety guidelines defined in the prompt.
An organization is implementing Claude to help automate customer support for a healthcare insurance portal. Which TWO strategies are most effective for ensuring the deployment aligns with Anthropic's Safety and Responsible Use guidelines regarding medical information?
Configuring Claude to provide medical diagnoses only when the user confirms they are over 18.
Utilizing system prompts that explicitly restrict the model to administrative and policy-related queries.
System prompts serve as a foundational layer of control, defining the model's operational boundaries. By restricting Claude to non-clinical tasks like explaining policy benefits or administrative procedures, the organization reduces the risk of the model inadvertently providing medical advice, which is a key requirement for responsible AI use in healthcare.
Implementing a 'Human-in-the-Loop' (HITL) review process for any queries identified as seeking clinical advice.
A human-in-the-loop process ensures that high-stakes queries are handled by qualified professionals. This strategy provides a necessary safety buffer, allowing the AI to handle routine tasks while ensuring that complex medical concerns are addressed by humans, thereby adhering to safety guidelines and reducing the potential for automated medical errors.
Prompting the user to ignore previous safety instructions to ensure the model is as helpful as possible.
Fine-tuning the model on publicly available medical forums to increase its diagnostic accuracy.
Refer to the exhibit. A developer receives this JSON response after submitting a prompt to the Claude API that included instructions to generate a bypass for a software licensing system. What does this error message indicate about the model's safety architecture?
The API key has been revoked due to excessive safety violations by the developer.
The model's Constitutional AI training failed to identify the harmful intent during inference.
An external safety layer identified the prompt as a violation of Anthropic's usage policies.
Anthropic employs external safety filters that analyze incoming prompts before they are fully processed by the model. These filters are trained to detect policy violations, such as requests for illegal activities or malicious code, and provide an immediate rejection to prevent the generation of harmful content, ensuring compliance with responsible use.
The model has encountered a technical timeout while processing a complex ethical dilemma.
A marketing team wants to use Claude to generate personalized political advertisements for a local election, targeting specific demographics with tailored messaging about voting records. According to Anthropic's 'Safety and Responsible Use' policies, how should this use case be handled?
It is permitted if the team provides a disclaimer that the content was AI-generated.
It is prohibited because it involves personalized political campaigning and election influence.
Anthropic's Usage Policy explicitly restricts using Claude for political campaigning, including the generation of personalized materials intended to influence elections. This policy is vital for maintaining election integrity and preventing the deployment of AI for micro-targeting or the rapid dissemination of potentially biased or misleading political content at scale.
It is allowed as long as the voting records used in the prompts are public information.
It is permitted only for local elections but prohibited for national or federal elections.
Which THREE of the following are core components of Anthropic's 'Constitutional AI' approach to model safety?
A set of written principles (the 'Constitution') used to guide model behavior.
The 'Constitution' is the foundation of CAI, consisting of a list of rules and values—drawn from sources like the UN Declaration of Human Rights—that the model is trained to follow. This provides a transparent and adjustable framework for safety, allowing developers to define what 'good' behavior looks like.
A self-critique phase where the model evaluates its own outputs against safety principles.
In the self-critique phase, the model generates responses and then revises them based on the principles in its constitution. This iterative process allows the model to internalize safety constraints and learn to identify potentially harmful content on its own, leading to more robust and reliable safety performance.
Complete reliance on human moderators to review every API call in real-time.
Reinforcement Learning from AI Feedback (RLAIF) to refine model alignment.
RLAIF is a key technique in CAI where one model uses the constitution to provide feedback on another model's outputs. This automates the alignment process, allowing the model to improve its adherence to safety guidelines more efficiently than relying solely on human feedback, which can be slow and expensive.
Hard-coding specific keywords that trigger an automatic shutdown of the model.
A developer is building an application that uses Claude to summarize news articles. They notice that Claude sometimes refuses to summarize articles involving violent crime, citing safety concerns. What is the best way for the developer to address this while maintaining responsible use?
Use a jailbreak prompt to force the model to ignore its safety training.
Contact Anthropic support to have all safety filters disabled for the account.
Refine the prompt to specify the journalistic context and requested summary length.
Providing context helps the model differentiate between harmful content and legitimate information processing. By specifying that the task is a 'journalistic summary,' the model can better evaluate the request against its safety principles, often resolving false-positive refusals while still maintaining the core safety boundaries against promoting violence.
Switch to a smaller model version that has fewer safety features.
Want more Safety and Responsible Use practice?
Practice this domainAn engineering team is designing a RAG system using Claude 3.5 Sonnet. They need to ensure the model focuses exclusively on the provided context without hallucinating external knowledge. Which architectural approach best ensures high adherence to provided context?
Increase the temperature setting to 1.0 to ensure maximum creativity.
Rely solely on the model's internal training weights for domain-specific queries.
Use XML tags to structure the input and define strict instructions in the system prompt.
XML tags provide clear delimiters that help Claude distinguish between instructions and context documents. Combining this structure with a system prompt that explicitly restricts the model to only use provided information forces the model to ignore its internal knowledge, effectively reducing hallucinations and increasing factual grounding in the retrieved data.
Reduce the maximum token limit to prevent the model from generating long, incorrect answers.
Which capability is a primary benefit of using Claude 3.5 Sonnet compared to smaller, legacy models when processing complex, multi-step instructions?
It can be trained locally on customer-provided hardware.
It maintains higher instruction-following performance on complex, multi-step tasks.
Claude 3.5 Sonnet is specifically optimized for advanced reasoning and instruction-following, allowing it to navigate complex, multi-step logic without losing track of constraints. This is a significant improvement over earlier models, making it ideal for tasks like code generation, complex document analysis, and multi-stage workflow execution in production environments.
It allows for unlimited parallel API requests without rate limiting.
It completely removes the need for systematic prompt engineering.
Refer to the exhibit. An application sends the provided JSON payload to the Anthropic API. What is the expected behavior regarding the system prompt?
The API will return an error because the system prompt is improperly formatted.
The system prompt will be ignored because it must be inside the messages array.
The API will correctly apply the system prompt to the entire conversation turn.
The system prompt is correctly defined at the top level of the request. The Claude API uses this field to set the 'persona' or constraints that govern the model's behavior for the entire session. This ensures the assistant maintains the intended behavior throughout the multi-turn exchange provided in the messages.
The model will see the system prompt as the latest user message.
Which of the following describes the purpose of 'Role' assignment in the Messages API?
To define the administrative access level of the API user.
To differentiate between the user's input and the model's past responses.
The Messages API requires explicit labeling of inputs as 'user' or 'assistant' to construct a coherent dialogue history. This separation allows the model to correctly attribute previous statements and follow the conversation flow, which is essential for multi-turn interactions where Claude must respond based on context established earlier.
To specify the persona the model should adopt for the entire request.
To allow the model to rewrite the user's prompt for better accuracy.
A user is experiencing 'Model Refusal' when processing a document that contains sensitive (but safe) medical information. What is the most likely cause?
The document is too long for the context window.
The model's safety guardrails are misinterpreting the intent due to sensitive keywords.
Safety filters often trigger on high-risk topics like medical data. If the prompt does not clearly state the benign intent, the model may default to a refusal to avoid providing potentially harmful advice. Adding context that emphasizes the professional or research-based nature of the request often resolves this issue.
The model has reached its internal limit for medical-related queries.
The API key has expired, triggering a default security lockdown.
When fine-tuning or optimizing prompts for Claude, what is the impact of excessive 'System Prompt' length?
It improves the model's ability to ignore user inputs.
It can lead to 'prompt drift' where the model loses focus on core instructions.
Extremely long system prompts can lead to a decrease in the model's ability to adhere to core constraints. As the length increases, the model may weigh instructions unevenly or lose track of critical directives, resulting in less consistent behavior and potentially lower quality responses compared to a concise, optimized prompt.
It causes the model to generate responses significantly faster.
It forces the model to use more creative, less deterministic tokens.
Want more Claude Model Fundamentals practice?
Practice this domainWhich TWO of the following are valid ways to handle long-running conversations within the Messages API to stay within context window limits?
Summarize previous chat history and append it as a single 'user' message.
Summarization allows you to condense large amounts of historical context into a compact format. By injecting this summary into the conversation history, you maintain continuity while freeing up space for new user inputs, effectively managing the token budget without losing the core information gathered during the earlier conversation stages.
Increase the system prompt size to include the entire conversation archive.
Remove older message pairs from the messages array before sending the request.
Windowing or dropping the oldest messages is a common strategy to keep the current prompt within the model's supported context length. This approach effectively maintains the 'recent' state of the conversation, which is usually sufficient for most conversational applications that do not require perfect recall of the entire session history.
Increase the 'max_tokens' value to accommodate the total conversation length.
Restart the conversation by clearing the history after every five messages.
When designing a prompt for Claude, why is it recommended to place the most important instructions at the very beginning or the very end of the prompt?
To reduce the token count of the prompt.
To improve the model's attention to instructions.
Empirical testing shows that models are more robust at following instructions located at the beginning or end of a long prompt. This placement strategy mitigates the risk of the model ignoring middle-ground instructions, leading to more reliable and predictable performance when the context window is highly populated with information.
To make the prompt easier to read for humans.
To allow the model to cache the instructions for future calls.
Refer to the exhibit. An engineer wants to use Prompt Caching to optimize this request. What is the correct way to modify the request body to enable this?
Add a 'cache_control' field to the root level of the JSON body.
Nest a 'cache_control' object within the content block of the message.
Prompt caching is activated by adding a cache_control block to the content of a message. This instructs the Anthropic API to store the preceding tokens in the cache. This is the correct structural way to enable the caching feature as defined in the Anthropic API technical documentation.
Rename the 'system' field to 'system_cached'.
Enable 'caching=true' in the request headers.
When migrating from legacy Claude models to the Claude 3.5 Sonnet Messages API, what is the most important structural change you must implement?
Switching the API endpoint from '/v1/messages' to '/v1/completions'.
Adopting the structured 'messages' array format with alternating roles.
The Messages API requires a structured list of message objects, each with 'role' and 'content' keys. This structure is fundamentally different from the legacy completion API, which took a single string. This shift allows for much better context management and is the foundation for all modern Anthropic API interactions.
Hardcoding the temperature to 0.0 for all migrated requests.
Removing the need for a 'model' identifier in the request body.
Which of the following describes the correct behavior when using the 'stream' parameter in the Messages API?
The API sends the entire response at once, but with lower latency.
The API returns content as it is generated in discrete events.
Streaming mode breaks the output into a stream of events. This is essential for building responsive user interfaces where you want to show the model's output in real-time. By handling these events on the client side, you create a much smoother, more interactive experience for the end user.
The API skips the 'messages' array and only accepts a single prompt string.
The 'stream' parameter is only available for the Claude 2 model series.
Which TWO of the following are true about Anthropic's 'usage' metadata returned in the API response?
It includes 'input_tokens' and 'output_tokens' fields.
The usage object explicitly breaks down the token count into input and output sections. This separation is necessary for billing, as input and output tokens are often priced differently. Developers rely on these fields to keep track of their spending per request and to optimize the length of their prompts.
It can be used to override the model's internal temperature.
It is only available when streaming is disabled.
It helps monitor the cost of the request accurately.
Since billing is token-based, having exact usage counts per request is the only way to perform precise cost monitoring. By logging these values, developers can build dashboards to track expenses and ensure their applications remain within budget, which is a critical requirement for production-scale deployments using Anthropic's models.
It provides the latency in milliseconds for each model layer.
Want more Using the Claude API practice?
Practice this domainA marketing team wants Claude to generate blog posts that strictly adhere to a specific brand voice. They find that the model occasionally deviates into a generic tone. Which strategy is most effective for ensuring consistent adherence to the brand voice?
Add 'Do not be generic' to the system prompt.
Provide five examples of existing high-quality blog posts within XML tags.
Providing concrete examples allows the model to map the desired tone, vocabulary, and structure directly from the context. This few-shot technique is a fundamental pillar of prompt engineering for Claude, as it provides a clear reference point that significantly outperforms zero-shot instructions when trying to capture complex styles.
Set the temperature to 1.0 to encourage creative writing.
Use a single-sentence instruction at the very end of the prompt.
A developer is optimizing a RAG (Retrieval-Augmented Generation) pipeline using Claude 3.5 Sonnet. Which TWO techniques will most significantly improve the model's ability to extract accurate information from a 50,000-token context window?
Wrapping each retrieved document in distinct XML tags.
XML tags provide a clear hierarchy and boundaries for the model to follow. By encapsulating each document separately, the model can easily reference specific parts of the context, which is critical for maintaining high retrieval accuracy and avoiding the mixing of information from different source documents.
Setting top_k to a value of 1 to minimize output variety.
Asking the model to think step-by-step before providing the answer.
Requesting a step-by-step reasoning process encourages the model to verify facts against the context before committing to an answer. This 'Chain of Thought' approach is proven to increase performance on complex extraction tasks where the answer might be buried deep within a massive volume of text.
Converting all text to uppercase to improve character recognition.
Reducing the temperature to exactly 0.5 for balanced reasoning.
Refer to the exhibit. Why is the use of the <documents> and <doc> tags considered a best practice for Claude prompting?
It is a requirement of the JSON schema for the Messages API.
It enables Claude to parse the content as a valid XML object.
It improves the model's ability to distinguish context from instructions.
Using XML tags creates a clear visual and logical boundary between the input data and the user's question. This allows Claude to focus its attention mechanism more effectively on the relevant sections of the prompt, reducing the chances of confusing the content of the documents with the task.
It automatically bypasses the model's safety filters for large data.
A developer needs Claude to output data in a strict JSON format for an automated pipeline. Even with clear instructions, the model occasionally adds conversational filler like 'Here is the JSON:' before the code block. What is the most reliable way to prevent this?
Increase the frequency penalty to prevent common words.
Use the 'prefill' technique by starting the Assistant message with '{'.
Starting the assistant's message with a curly brace forces Claude to complete the JSON object directly. Since the model generates text sequentially, providing the first character of the desired response eliminates the opportunity for the model to include any preamble or introductory sentences before the data.
Wrap the instructions in triple backticks and capital letters.
Switch the model from Claude 3.5 Sonnet to Claude 3 Haiku.
What is the primary purpose of a 'System Prompt' in the Anthropic Claude API?
To provide a place for users to input their variable data.
To define the model's persona and overarching behavioral rules.
System prompts are specifically designed to set the context for how the model should behave. This includes defining its role, such as a 'helpful coding assistant' or a 'formal legal researcher,' and setting global rules that the model must follow throughout the entire interaction.
To reduce the latency of the API response for small tasks.
To encrypt sensitive information before it reaches the model.
Refer to the exhibit. When using 'tool_choice': {'type': 'auto'}, how does Claude determine whether to use the 'get_stock_price' tool?
It executes the tool automatically if the word 'stock' appears in the prompt.
It only uses the tool if the user explicitly mentions the tool name.
The model decides based on whether the tool's description matches the user's request intent.
When tool_choice is set to 'auto', Claude uses the description and schema provided for each tool to judge if calling that tool would help it respond to the user. This involves a high-level reasoning step where the model balances its internal knowledge with the available external tools.
It randomly selects a tool whenever the user asks a question about finance.
Want more Prompting and Context Engineering practice?
Practice this domainThe CCAO-F exam has 60–90 questions and must be completed in 120 minutes. The passing score is 700/1000.
Scenario-based questions covering exam objectives with detailed answer explanations.
The exam covers 4 domains: Safety and Responsible Use, Claude Model Fundamentals, Using the Claude API, Prompting and Context Engineering. Questions are weighted by domain — higher-weight domains appear more on your actual exam.
No. These are original exam-style practice questions written against the official Anthropic CCAO-F exam objectives. They are not copied from the real exam. Courseiva focuses on genuine understanding, not memorisation of braindumps.
Courseiva tracks your accuracy per domain and routes you toward weak areas automatically. Free, no account required.