100% Latest & Updated Anthropic CCA-F Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 370
A refusal response does not conform to an expected success JSON schema, and the app crashes. Which architecture decision would most directly meet the stated requirement?
- Validate required properties before accepting the response.
- Define a typed JSON schema or strict tool input for the operation.
- Avoid ambiguous case-near enums and validate canonical values after generation.
- Handle refusal stop reasons separately from schema-valid success results.
- Remove incompatible prefilling when using the structured-output mode.
Explanation
Correct Answer
D:Treat a refusal or other non-success stop reason as a first-class result before attempting success JSON parsing. Report an appropriate refused or incomplete state to the caller. A schema-valid success object should be parsed only when the response is actually a completed success path.
Incorrect Answers
A:Required-property validation catches incomplete success-shaped objects but cannot force a refusal to become a valid success response. A model may legitimately refuse a request and return a different stop condition. The application must route refusals through a separate outcome path.
B:Strict tool inputs help validate arguments to external operations, but the observed error comes from interpreting a response, not composing a tool request. A refused response may not contain the expected success JSON. Handle refusal status before parsing success fields.
C:Canonical enum checks prevent capitalization or value drift in a normal structured success response. They cannot resolve a refusal whose content is not the requested schema. The crash occurs because the program assumes all responses are successful structured output.
E:Message prefilling can be incompatible with some structured-output modes, but the fact pattern already describes a refusal response. Removing prefilling might prevent a separate API error yet does not teach the app to handle refusals safely. Branch on actual stop status first.
Question 371
A model hits max_tokens while emitting an array and the API consumer treats the partial JSON as complete. What should the team change first to resolve this exact failure mode?
- Avoid ambiguous case-near enums and validate canonical values after generation.
- Detect truncation and rerun or recover before accepting the record.
- Define a typed JSON schema or strict tool input for the operation.
- Constrain the output to one schema root and parse exactly one object.
Explanation
Correct Answer
B:Inspect `stop_reason` and validate the entire output before consumption. On `max_tokens`, treat the record as incomplete, then continue or rerun with a suitable limit and bounded recovery, rather than approving the truncated array.
Incorrect Answers
A:Enum capitalization controls label mapping, not an array cut off because generation hit `max_tokens`. A canonical enum can still appear in incomplete JSON.
C:A typed contract improves output shape but cannot guarantee successful completion when the token budget is exhausted. Truncation can interrupt a record regardless of declared types.
D:A single-root parser can reject malformed JSON, but the failure here includes a false success path on token-budget exhaustion. The consumer must explicitly detect `max_tokens`, not infer completion from any parseable prefix.
Question 372
A query builder exposes an invalid schema pattern with unsupported lookahead and sees 400 errors. Which safeguard or workflow change provides the missing guarantee?
- Rewrite the pattern using supported schema constructs or validate that condition in code.
- Simplify the schema to supported bounded structures before calling the model.
- Remove incompatible prefilling when using the structured-output mode.
- Authorize the action in server code after validating the schema.
Explanation
Correct Answer
A:The structured-output grammar supports only a bounded regex subset; lookahead is unsupported. Rewrite the validation pattern using supported constructs or move the complex rule into application-side validation before relying on the output.
Incorrect Answers
B:Reducing overall schema complexity can help some compiler errors, but the unsupported lookahead token itself persists unless removed. A small schema with that pattern can still return HTTP 400.
C:Prefilling is a separate structured-output incompatibility. Removing a prefill will not make regex lookahead supported in a pattern field.
D:Checking authorization after parsing cannot repair schema compilation. The request is rejected before the business action executes; the pattern needs to become valid first.
Question 373
A report field must preserve the exact original order of mandatory sections but optional schema fields move. Which response is best supported by these operational facts?
- Validate required properties before accepting the response.
- Set explicit property limits and reject unknown fields in tool handlers.
- Avoid ambiguous case-near enums and validate canonical values after generation.
- Make ordered properties required or perform deterministic consumer-side ordering.
Explanation
Correct Answer
D:Structured outputs place required properties before optional ones; make all position-sensitive section fields required, or explicitly reorder the parsed object in consumer code. Do not depend on optional-property order to preserve the required report sequence.
Incorrect Answers
A:Required-field validation prevents missing values, but it does not specify the relative display order of optional sections. An accepted schema response can still move optional fields.
B:Unknown-field filtering disallows additional properties, not reordering of declared optional fields. The same required and optional keys can be present in a different sequence.
C:Enum-case canonicalization addresses category value ambiguity, not property ordering. No enum collision is reported.
Question 374
A tool input is structurally valid but the requested action violates payment policy. Which design adjustment is most suitable under the stated constraints?
- Authorize the action in server code after validating the schema.
- Define a typed JSON schema or strict tool input for the operation.
- Set explicit property limits and reject unknown fields in tool handlers.
- Rewrite the pattern using supported schema constructs or validate that condition in code.
- Constrain the output to one schema root and parse exactly one object.
- Handle refusal stop reasons separately from schema-valid success results.
Explanation
Correct Answer
A:Schema validation only confirms input shape and types; it does not grant permission to transfer money or exceed a transaction limit. After parsing, the payment service must check caller identity, transaction ownership, permitted amounts and business policy in server-side code. Deny unauthorized operations even when JSON is perfectly formed.
Incorrect Answers
B:A strict input schema can prevent malformed arguments and unexpected fields but cannot tell whether the current user is authorized for this payment. An attacker can supply a syntactically valid account ID and amount. The backend still needs an entitlement and policy decision.
C:Unknown-field rejection reduces ambiguity and sometimes injection risks at the parser boundary. It cannot stop a structurally valid request whose amount or account violates business authorization. The requested action needs a separate server-side policy check after validation.
D:Adapting a pattern to supported schema constructs is useful for JSON Schema compatibility, but a correct validation grammar does not embody the business approval rule. A transaction may pass all type and regex checks and still be forbidden by the verified customer’s account permissions.
E:A single JSON object root eases parsing and output validation. It does not ensure that a validated request is safe to execute. The unsafe action would remain possible unless the payment handler independently authorizes the resource and monetary operation.
F:Handling refusal and truncation keeps the application from mistaking non-success model responses for valid data. This scenario already has structurally valid tool input; the missing check is business authorization. Model output stop conditions are orthogonal to enforcing payment policy.
Question 375
A classification app requests schema output but also tries to prefill the assistant message. What targeted change avoids repeating this failure?
- Simplify the schema to supported bounded structures before calling the model.
- Choose an output architecture that can preserve citations rather than forcing incompatible formats.
- Use schema-constrained structured output rather than relying on free-form JSON-style prose.
- Remove incompatible prefilling when using the structured-output mode.
- Constrain the output to one schema root and parse exactly one object.
Explanation
Correct Answer
D:Anthropic structured-output mode can reject assistant message prefilling because the constrained decoder owns the output beginning. Remove the prefilling from the Messages request while keeping the supported schema configuration. Test the call with the actual API settings instead of assuming plain JSON prompting is equivalent.
Incorrect Answers
A:Simplifying complex schemas is useful when a schema fails a supported subset, but this scenario identifies an incompatible assistant-message prefill. Even a minimal schema can conflict with that mode. Remove the incompatible prefilling rather than changing unrelated property definitions.
B:A citations-capable output architecture matters when source citation blocks conflict with strict JSON, but the present failure is prefilled assistant text while requesting schema output. The input must use a supported response mode without message prefilling; citation design is a separate constraint.
C:Schema-constrained output is already requested, so asking for it again does not repair the conflicting message prefill. The client should remove incompatible prefilling and then validate the normal structured-output response, including refusal or truncation paths.
E:A single object root is a sound output contract, but the request can still fail before generating anything when the client uses unsupported prefilling. Schema shape validation does not cure the incompatible generation configuration. Remove prefill and handle normal structured responses.
Question 376
A refund calculator returns a JSON number 12.345 for a USD settlement, and the downstream ledger stores cents as integers. The record passes a generic number schema but a handler silently rounds it. Which boundary prevents this value-scale error?
- Use an explicitly named integer minor-units field with currency, range and precision checks; reject fractional cents before booking.
- Keep the general number field and allow JavaScript floating-point conversion to choose the nearest cent silently.
- Convert the value to a natural-language amount so the model no longer has to respect an integer field.
- Store the unrounded decimal and let the UI mask its third fractional digit while ledger totals use a rounded value.
Explanation
Correct Answer
A:An integer count type alone is not enough to define what money values mean. For USD, a value with three fractional dollars has a sub-cent component and must not be silently coerced into a cent-denominated ledger. Type checks should establish the unit and precision contract before any mutation.
Incorrect Answers
B:Implicit floating-point rounding can convert an unsupported monetary amount into a valid-looking ledger value without authorization. The same request may round differently across runtimes or introduce reconciliation differences. Reject or explicitly resolve the precision violation rather than silently altering the financial instruction.
C:Prose avoids the type check instead of defining the financial schema precisely. Downstream accounting requires an unambiguous numeric value and currency unit. Natural-language text invites multiple interpretations of decimal points, symbols and rounding, so it would make the settlement boundary less reliable.
D:Display formatting changes only what the operator sees, not the value booked into the ledger. Storing one amount and displaying a rounded version can hide systematic settlement differences. A trustworthy interface uses exact integer minor units or a defined decimal representation with explicit precision validation before recording money.
Question 377
An invoice-processing service returns syntactically valid JSON, but its total is wrong because a tax calculation used the wrong base amount. The team needs safeguards against this factual error before charging a customer. Select THREE coordinated measures.
- Recompute prices, taxes and totals in deterministic application code from validated numeric line items.
- Check tax jurisdiction, currency, line-item quantities and rounding policy against authoritative business rules.
- Test boundary invoices and mismatched totals, rejecting charges that fail the independent reconciliation.
- Accept any valid JSON number as accurate once it passes a schema parser.
- Ask the model to write a longer explanation of its total without recalculating or verifying the source amounts.
- Increase the number of retry attempts until the returned JSON total changes from its first value.
Explanation
Correct Answers
A:A schema can show that total is a number, but it does not prove the arithmetic. Deterministic calculations using validated inputs make the payable amount reproducible and independently testable. The model can extract fields, while the application owns the financial computation before it permits a charge.
B:Using the wrong tax base can produce a plausible number with the correct JSON type. Business-rule validation must bind tax treatment and rounding to the specific invoice and jurisdiction. Without those inputs, even flawless addition can calculate the wrong payable amount.
C:Negative tests prove that the payment boundary refuses an internally inconsistent invoice rather than trusting valid syntax. Include tax-exempt and mixed-rate examples and compare the expected total to the submitted value. A failed reconciliation should block the charge and request correction, not silently adjust money.
Incorrect Answers
D:A structured parser checks types and syntax, not whether a model applied tax to the correct line items. The described total is already structurally valid but economically wrong. A separate calculator, business rules and reconciliation check are necessary before charging the customer.
E:A detailed narrative can be persuasive even when its arithmetic premise is mistaken. Length does not establish accurate tax treatment or invoice data provenance. Deterministic computation and independent reconciliation are needed to catch the wrong base amount.
F:Different model outputs are not evidence of which total is correct. Repeated sampling may produce several plausible amounts without resolving the tax-base error. The business system must calculate the total from authoritative values and approved rules instead of selecting a convenient generation.
Question 378
An extraction misses one required account field and the team asks the model to regenerate with no feedback. Which architecture decision would most directly meet the stated requirement?
- Regenerate the entire extraction without identifying the missing field and accept the newest output by default.
- Validate recipient permissions but leave the required account field unchecked.
- Increase sampling randomness in the hope that a required field appears on the next attempt.
- Return the precise missing-field validation error and retry only within a bounded correction policy.
Explanation
Correct Answer
D:An explicit validation result naming the missing account field lets the retry focus on the actual failure. Limit retries, preserve already-validated evidence when possible, and escalate or return incomplete if the source does not contain the field.
Incorrect Answers
A:Blind regeneration may repeat the omission and can also alter previously correct values. The consumer needs to report which required account field failed validation before deciding whether a correction attempt is warranted.
B:Recipient authorization can be critical for side-effecting workflows, but the observed defect is a missing mandatory account field in an extraction. Access checks alone cannot supply that data or demonstrate schema completeness.
C:Sampling variation does not tell the model what part of the contract it violated. Increasing randomness can make an otherwise deterministic extraction less stable while leaving the required field absent.
Question 379
A prompt retry repeats the same invalid answer until the cost limit is exceeded. What should the team change first to resolve this exact failure mode?
- Freeze verified values and constrain the retry to the failing fields where feasible.
- Send the same generic invalid-output feedback and retry without changing the retry budget or prompt constraints.
- Cap regeneration attempts and escalate persistent failures with diagnostic context.
- Validate semantic constraints and recompute totals independently before acceptance.
Explanation
Correct Answer
C:Set an attempt/token budget, capture the repeated validation failure and stop with an actionable escalation when no progress occurs. This closes the cost runaway even when the model never produces a valid answer.
Incorrect Answers
A:Freezing valid fields limits regression on a partial retry, but the system can still loop forever over the same invalid field unless attempts are bounded.
B:Repeating a generic failure message without an attempt cap or changed constraints may produce the same invalid answer indefinitely. It does not prevent the cost limit from being exhausted.
D:Independent arithmetic validation can detect wrong totals, but the observed harm is repeated generation after an invalid result. Additional checks alone can create more loops unless there is a finite retry policy.
Question 380
A PDF form extractor reports an expiry date preceding its issue date. Which safeguard or workflow change provides the missing guarantee?
- Return the exact missing-field validation error for a bounded corrective retry.
- Re-read the exact source span and correct the summary with evidence.
- Verify that both dates appear as required string properties in the JSON schema, then accept the record.
- Parse both date fields and recompute unrelated numeric totals without comparing their chronological order.
- Apply cross-field chronology checks and reject inconsistent records.
Explanation
Correct Answer
E:Validate parsed issue and expiry dates against the business invariant that expiry must not precede issuance, allowing any explicitly documented exceptions. If that predicate fails, reject or quarantine the extracted record and request evidence-backed correction. This catches semantically impossible output even when individual date strings pass the JSON schema.
Incorrect Answers
A:Returning the missing-field error is an effective strategy when the extractor omitted a required property, but here both dates are present and in the wrong order. A retry that checks only presence can repeatedly accept the same impossible interval. Add explicit cross-field validation for issue-versus-expiry chronology.
B:Reopening the source page can expose a transposition or OCR extraction error, and the corrected values should be anchored to that evidence. However, checking a span ad hoc does not provide the systematic guarantee requested; a later record could still pass with reversed dates. Enforce a deterministic chronology rule on every extracted record.
C:Presence and string typing establish a valid JSON envelope, not the meaning of the two date values. A document with issue_date 2027-01-01 and expiry_date 2026-01-01 can satisfy both property requirements. Reject the record when parsed expiry precedes issue, rather than treating schema success as factual validity.
D:Parsing dates and checking totals may catch malformed ISO strings and arithmetic errors, but neither verifies which date should come first. The specific PDF defect is cross-field time ordering, not a numeric sum. Compare the actual parsed dates with the business rule and route inconsistent entries to re-extraction or review.
Claude Certified Architect - Foundations (CCA-F) Practice Tests