You are responding to an adversarial input pattern in which users include text claiming admin authority and instructing the model to bypass safety restrictions.Which combination of controls most effectively mitigates this attack pattern?
Answer(s): B
Self-declared administrative authority inside a prompt is untrusted data, not authenticated identity or authorization evidence. Option B correctly combines independent controls across the model, runtime, authorization, and monitoring layers.Prompt instructions establish that user content cannot override system policy. Runtime classifiers detect known and generalized attempts to bypass controls. Tool permissions are enforced outside the model and must derive from authenticated identity, role, and approved scope---not statements contained in the conversation. Audit logging records the actor, attempted override, classifier result, tool requests, and final disposition for investigation and control improvement.Anthropic recommends input screening, hardened system prompts, safe handling of untrusted content, narrowly scoped permissions, red-team testing, and continuous monitoring. Mitigate Jailbreaks and Prompt InjectionsOption A depends entirely on model behavior and provides no containment if the model fails. Option C removes the protections the attacker is attempting to defeat. Option D commits a fundamental authorization error by accepting an unverified claim as privilege elevation.The strongest design also rate-limits repeated attempts, escalates suspicious activity, validates outputs, and requires human confirmation for consequential actions.Study Guide references/topics: Direct prompt injection; untrusted user content; runtime classifiers; non-model authorization; scoped tools; audit logging; defense in depth.
You are diagnosing a Claude Code session whose subagent uses 50,000 tokens of context before the engineer types a single message.Which root cause is most likely?
Claude Code constructs the model context before the first user message. That initial context can include the system prompt, project instructions, subagent configuration, MCP server instructions, and tool definitions expressed as JSON schemas. When numerous MCP servers expose many tools and Tool Search is disabled, those schemas must be loaded upfront. A large collection of verbose tool descriptions and parameter schemas can therefore consume tens of thousands of tokens before the engineer enters any text.Tool Search is specifically designed to prevent this form of context inflation. With Tool Search enabled, Claude initially receives only server instructions and compact tool-identification information; full tool schemas are deferred until a relevant tool is discovered and required. Anthropic consequently describes Tool Search as the mechanism for keeping MCP context consumption low as integrations scale.Keyboard layouts, font rendering, and display scaling operate outside the language-model context and cannot generate API input tokens. Likewise, model behavior does not silently reserve 50,000 tokens for personal preferences. The diagnostic action is to inspect configured MCP servers and tool counts, determine whether Tool Search has been disabled, and remove or defer unnecessary definitions.Study Guide references/topics: [MCP Tool Search and context scaling](https://docs.anthropic.com/en/docs/claude-code/mcp); MCP server configuration; subagent context budgeting; tool-schema optimization.
Your organization is deploying a Claude-based document classification system to categorize incoming legal contracts. During testing, you discover that the model occasionally misclassifies complex hybrid contracts (e.g., a contract that is both a service agreement and licensing agreement). Your stakeholders want accuracy above 95% before production launch.Which evaluation and optimization strategy best addresses this issue while providing evidence to stakeholders?
This answer demonstrates rigorous evaluation practices: creating representative test data for the failure mode, measuring performance with appropriate metrics (precision/recall/F1 are standard for classification), implementing targeted optimizations (few-shot examples and tool use are documented techniques for multi-label scenarios), and validating improvements with the same test set to prevent metric manipulation. Option A misuses temperature for a systematic accuracy problem. Option C skips pre-deployment validation, violating governance and risk management practices. Option D lacks systematic validation. The correct approach follows industry best practices for testing and optimization before production.
You are identifying the highest-impact optimization for a deployment whose token cost is dominated by a long, repeated system prompt and a large retrieved context per request.Which optimization most directly targets the dominant cost driver?
Answer(s): C
Option C addresses both components responsible for the excessive cost. Anthropic prompt caching allows stable, repeatedly submitted prompt material---such as system instructions, tool definitions, and reusable background information---to be placed in a consistent prefix. After that prefix is written to the cache, qualifying subsequent requests can reuse it at the lower cache-read cost instead of repeatedly processing the same content at the standard input-token rate.Retrieval must be optimized separately. Supplying an entire document collection or excessively deep search results increases cost, consumes context capacity, and may reduce answer quality by surrounding the relevant evidence with distracting material. Retrieval should select the smallest set of authoritative passages that provides sufficient evidence for the current query. This typically requires relevance scoring, deduplication, metadata filtering, reranking, and explicit token-budget limits.Increasing retrieval depth or expanding the repeated system prompt directly worsens the identified cost driver. Moving every request to a heavier model changes the unit economics but does not correct inefficient context construction. The recommended optimization therefore combines prefix caching with query-specific context pruning, followed by evaluation to confirm that reduced context does not lower task accuracy.Study Guide references/topics: [Prompt caching](https://docs.anthropic.com/en/docs/build-with-claude/prom-t-caching); [effective context engineering](https://www.anthropic.com/engineering/effective-contex--engineering-for-ai-agents); retrieval precision; token-cost analysis; cache-prefix stability.
A team manager wants all engineers working on the same repository to share identical MCP server definitions without manual synchronization.Which configuration approach satisfies this requirement?
Project-scoped configuration is the appropriate mechanism for repository-specific settings that must remain consistent across collaborators. Claude Code recognizes `.claude/settings.json` as the shared project settings file and `.mcp.json` as the project-level MCP server configuration. When these files are committed to source control, every engineer receives the same definitions through the repository's normal clone, pull, review, and versioning workflow.Anthropic's scope hierarchy distinguishes project configuration from user and local configuration. Files under the user scope apply to one engineer and are not automatically shared. Operating-system environment variables are also workstation-specific and require separate configuration management. Managed settings can be distributed centrally, but they are primarily intended for organization-wide security policies and controls that must be enforced by administrators; they are less appropriate when the configuration belongs specifically to one repository.Shared configuration should contain server definitions and environment-variable references, but not plaintext credentials. Each engineer can resolve required secrets through an approved local secret mechanism while retaining identical server names, transports, arguments, and non-sensitive settings. Project MCP servers also remain subject to workspace trust and approval controls before execution.Study Guide references/topics: [Claude Code configuration scopes](https://docs.anthropic.com/en/docs/claude-code/settings); project-scoped MCP servers; `.mcp.json`; repository-based operational standardization; secure secret separation.
Post your Comments and Discuss Anthropic CCAR-P exam prep with other Community members:
Our website is free, but we have to fight against AI bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the CCAR-P content, but please register or login to continue.