Skip to content
CCAR-F Prep

Task Statement 4.1·Domain 4 — 20% of exam

Prompts with Explicit Criteria to Reduce False Positives

Design prompts with explicit criteria to improve precision and reduce false positives

Jump to practice →

Official Exam Guide Objectives

The objectives below are quoted from Anthropic's Claude Certified Architect – Foundations exam guide, v1.1. Read the exam guide summary for the full blueprint.

Task 4.1: Design prompts with explicit criteria to improve precision and reduce false positives

Knowledge of

  • The importance of explicit criteria over vague instructions (e.g., "flag comments only when claimed behavior contradicts actual code behavior" vs "check that comments are accurate")
  • How general instructions like "be conservative" or "only report high-confidence findings" fail to improve precision compared to specific categorical criteria
  • The impact of false positive rates on developer trust: high false positive categories undermine confidence in accurate categories

Skills in

  • Writing specific review criteria that define which issues to report (bugs, security) versus skip (minor style, local patterns) rather than relying on confidence-based filtering
  • Temporarily disabling high false-positive categories to restore developer trust while improving prompts for those categories
  • Defining explicit severity criteria with concrete code examples for each severity level to achieve consistent classification

What You Need to Know

Vague instruction is the most expensive habit in production prompt engineering. "Be conservative." "Only report high-confidence findings." "Use your best judgement." Each reads like sound direction and none of them gives the model a boundary it can apply, which is precisely why the exam offers them as answers.

The one-line model: "be conservative" is not a criterion, it is a mood. The model has no calibrated notion of what your team considers worth reporting, so telling it to be conservative shifts an unknown threshold by an unknown amount, and what it drops is as likely to be a true positive as a false one. Telling it which categories count moves a decision boundary you control and can audit.

What works instead is explicit categorical criteria: a statement of what gets reported and what does not. Set the two side by side for a CI/CD code review pipeline:

Wrong approach:

Review this code. Be conservative. Only report high-confidence findings.

Correct approach:

Flag comments only when claimed behaviour contradicts actual code behaviour.
Report bugs and security vulnerabilities.
Skip minor style preferences and local patterns.

Nothing in the first version can be acted on. "Conservative" resolves differently depending on what the model assumes the reviewer cares about, and "high-confidence" asks for a threshold against a scale the model has no way to calibrate. The second names categories to report — bugs, security — categories to leave alone — style, local patterns — and one precise trigger for comment findings, namely a contradiction between what a comment claims and what the code does.

Explicit criteria classify consistently — vague ones don't A system prompt reading "Review this code. Be conservative. Only report high-confidence findings" is run twice against the identical snippet — a variable-naming inconsistency, userName versus user_name — and returns two different verdicts, critical on one run and unflagged on the next, because "conservative" resolves differently depending on what the model assumes the reviewer cares about. The same snippet judged against explicit categorical criteria — report bugs and security vulnerabilities, skip style preferences and local patterns, flag comments only when claimed behaviour contradicts actual code behaviour — returns the identical verdict on both runs, because there is nothing left to interpret. Vague instruction Review this code. Be conservative. Only report high-confidence findings. same snippet: userName vs user_name Run 1: critical ✕ Run 2: skipped ✕ resolves differently depending on what it assumes you care about Explicit criteria Report: bugs, security vulnerabilities. Skip: style preferences, local patterns. Flag comments only when claimed behaviour contradicts actual code behaviour. same snippet: userName vs user_name Run 1: minor ✓ Run 2: minor ✓ nothing left to interpret
1 / 6Swipe diagram ↔

Explicit criteria classify consistently — vague ones don't, step 1: Review this code. Be conservative. Only report high-confidence findings.

Turn a judgement into a test

The guide's comment example works because it converts a judgement ("is this comment accurate?") into a test ("does the claimed behaviour contradict the code?"). A stale-but-not-contradictory comment, a terse comment and an incomplete comment all pass; only a contradiction fails. You and the model can apply that test the same way twice. The same move applies to every category:

VagueExplicit
"Check that comments are accurate"Flag a comment only when the claimed behaviour contradicts the actual code behaviour
"Flag performance problems"Flag a database call inside a loop over a collection whose size is not bounded by a constant
"Point out security issues"Flag user input reaching a query, command or path without validation; secrets in source; a state-changing handler with no authorisation check
"Note missing error handling"Flag an await on a network or filesystem call with no surrounding try/catch or .catch(), where the caller does not handle the rejection
"Report unclear naming"Do not report: this belongs on the skip list

A criterion that still leans on a judgement word — "important", "significant", "obvious", "suspicious" — has not moved the boundary; it has only renamed the vagueness.

Writing the report and skip lists

A complete criteria block has three parts: the categories to report, the categories to skip with the reason each is skipped, and an instruction for findings that fit neither. A shortened example:

REPORT these categories only:
1. security: untrusted input reaching a query, command, path or template without validation
2. correctness: a code path that gives a wrong result or raises on a realistic input
3. data-loss: a delete or overwrite with no guard
DO NOT REPORT:
- formatting, import order, line length: the formatter owns these
- naming preferences, unless the name states something false
- a pattern used consistently elsewhere in this module, even if you would write it differently
- test-coverage gaps: a separate job owns these
- theoretical issues with no reachable code path in this repository
If a finding does not fit a REPORT category, omit it. Do not report it at a lower severity.

Two parts of that block do most of the work against false positives:

  • The skip list. A prompt that only lists what to report leaves everything else to the model's taste, and the skip list is where false positives are actually eliminated. "Local patterns" means code that follows a convention already used consistently in the same module; flagging it produces confident, correct-sounding findings the team will never act on.
  • Omit, don't downgrade. Without the last line, the model preserves an out-of-scope finding by reporting it as "low" or "minor", and the skip list quietly becomes a "report as low" list. A finding outside the report categories is omitted, not demoted.

The False Positive Trust Problem

Noise in one category does not stay in that category, and this is the part the exam presses on. Where "documentation mismatch" findings are wrong 40% of the time, developers stop reading the security findings too — even at 98% accuracy. Trust attaches to the output as a whole, so the weakest category sets the credibility of the strongest. A category that posts at low precision has negative value even though it is sometimes right.

The remedy runs against instinct: temporarily disable the high false-positive categories while their prompts are reworked. Confidence in the categories that already work returns as soon as the noise stops. The broken category is then improved against concrete code examples and switched back on once its precision justifies it.

Nothing is being given up permanently. The trade is category coverage now against the credibility of everything else, and coverage is the cheaper thing to lose. Disabling is also targeted and reversible, which a global confidence threshold is not: a threshold degrades every category at once, the accurate ones included.

A noisy category costs trust in an accurate one too Two review categories run side by side: documentation_mismatch, wrong 40% of the time, and security_vulnerability, accurate 98% of the time. As the developer reads findings from both, documentation_mismatch's bad findings pile up and its trust drops — but trust in security_vulnerability drops as well, even though its 98% accuracy figure never changed, because trust attaches to the output as a whole rather than to one category at a time. Disabling documentation_mismatch while its criteria are reworked lets trust in security_vulnerability recover. The trade is category coverage now against the credibility of everything else. documentation_mismatch 40% false positive rate security_vulnerability 98% accurate developer reads both ✕ ✕ ✕ trust — documentation_mismatch trust: low ✕ disabled — pending refinement trust — security_vulnerability trust: high ✓ trust: low ✕ trust: recovered ✓ trust bleeds across the whole output switch off the noisy category, refine it, restore it once precision earns it
1 / 6Swipe diagram ↔

A noisy category costs trust in an accurate one too, step 1: documentation_mismatch — 40% false positives. security_vulnerability — 98% accurate.

Measuring precision per category

Precision is the share of reported findings that were real: true positives ÷ (true positives + false positives). In a review pipeline the practical proxy is the share of posted findings developers acted on. Measure it per category, because a single overall figure hides where the noise comes from. A worked example:

CategoryFindings raisedActed onPrecision
security222091%
correctness504488%
maintainability22418%
performance841315%
All categories1788146%

Two categories are close to 90%, yet the review as a whole is right less than half the time, and performance alone supplies 84 of the 178 findings. Developers see the 46%, not the 91%. Disabling performance and maintainability leaves 72 findings at 64 acted on, about 89%.

Two refinements make the measurement useful:

  • Record a pattern per finding. A detected_pattern field naming the construct that triggered each finding (Task 4.4 covers it) shows which rule misfires inside a noisy category, so the rework targets that rule rather than the whole category.
  • Compare like with like. To show that a rewrite helped, run the old and new criteria over the same labelled examples, more than once each so run-to-run variance is visible. Changing the test set and the criteria together leaves two candidate causes for any difference, and a drop in the number of findings is not a precision gain: fewer findings is equally consistent with missing real defects.

Shadow mode and the route back

While a category is disabled, run it in shadow mode: generate its findings, log them, do not post them. The logged findings let you measure precision as you rework the criteria without exposing developers to the noise. Before switching it off, write down what bringing it back requires: the misfiring edge cases rewritten as concrete examples in the criteria, and the precision it must reach to be re-enabled. That turns re-enabling into a condition you can check rather than a judgement call made later.

Severity Calibration with Code Examples

Severity levels need concrete code examples, because prose descriptions leave the boundary to interpretation. Compare:

Prose description (insufficient):

Critical: Issues that could cause system failures or data loss
Minor: Issues that affect code readability but not functionality

Code example approach (correct):

Critical — Unsanitised user input in SQL query:
  query = f"SELECT * FROM users WHERE id = {user_input}"

Minor — Inconsistent variable naming:
  userName vs user_name in the same module

"Could cause system failures" is a judgement the model has to make afresh on every finding, and it will not make it identically twice. A worked example fixes the boundary at a specific pattern instead, and classification stops drifting between invocations because there is nothing left to weigh.

The guide asks for examples "for each severity level", and the levels in the middle are where prose fails most, because adjacent labels such as "high" and "medium" blur into each other. Anchor every level, and name the pattern beside each snippet so the model learns the construct rather than the literal identifiers:

LevelNamed patternExample
CriticalUser input reaches a shell command unvalidatedsubprocess.run(f"convert {user_filename} out.png", shell=True)
CriticalDelete runs with a possibly empty filtersession.query(Order).filter(*build_filters(params)).delete()
MajorIndex into a result that can be emptyfirst = results[0] with no empty check
MajorProperty access with no null guardconst name = response.data.user.name;
MajorQuery per item in a loop (N+1): correct, but scales badlyfor o in orders: o.customer = db.get_customer(o.customer_id)
MinorUnused importimport json never referenced

Once each level has an anchor, a useful refinement is a contrast pair: an example together with a similar-looking construct that belongs one level lower.

A code example fixes the boundary — prose leaves it open A prose severity definition — critical: issues that could cause system failures or data loss — is applied to two similar SQL query snippets and lands on two different verdicts, because "could cause system failures" is a judgement the model makes afresh each time. The exact code example from the lesson — critical, unsanitised user input in SQL query, query = f"SELECT * FROM users WHERE id = {user_input}" — anchors the boundary at a specific pattern instead, and two invocations against matching snippets return the identical verdict, because classification stops drifting once there is nothing left to weigh. Prose description Critical: issues that could cause system failures or data loss f"...WHERE id={user_input}" f"...WHERE id={order_id}" critical minor a judgement made afresh on every finding Code example Critical — unsanitised user input in SQL query: query = f"SELECT * FROM users WHERE id = {user_input}" f"...WHERE id={user_input}" f"...WHERE id={order_id}" critical ✓ critical ✓ a worked example fixes the boundary at a specific pattern
1 / 6Swipe diagram ↔

A code example fixes the boundary — prose leaves it open, step 1: Critical: issues that could cause system failures or data loss

Why Confidence-Based Filtering Fails

"Only report high-confidence findings" appears repeatedly as a distractor, and it is tempting because it sounds like disciplined engineering: filter on confidence, keep the strong signals. It fails for three separate reasons:

  1. It is poorly calibrated. A model's self-reported confidence will show certainty on findings that are wrong and hedge on findings that are correct, so filtering on that number discards good findings and keeps bad ones. In practice it mostly suppresses whatever the model happens to phrase tentatively.
  2. It does not encode your policy. Most false positives are not low-confidence findings. They are high-confidence findings about things the team does not care about: a consistently used local pattern gets flagged with complete certainty, and no threshold removes it.
  3. It is unauditable. When precision is still poor after a threshold change, you cannot tell what moved. With categorical criteria you can switch one category off and measure the difference.

Confidence does have a proper job. Asking the model to emit a confidence value alongside each finding is useful: it can be calibrated against labelled data and used to route low-confidence output to human review, which Task Statements 4.6 and 5.5 cover. What it cannot do is establish what qualifies as a finding, because that judgement has to exist before there is anything to be confident about. Emitting confidence for routing is good; filtering on self-reported confidence inside the prompt is the trap.

The ordering is what the exam wants: explicit criteria first, confidence-based routing second. Applying the second without the first filters an undefined set.

Criteria first, confidence second — never the reverse Applying a confidence threshold before any criteria exist filters an undefined set: a wrong finding reported at 90% confidence is kept, while a correct finding reported at only 60% confidence is discarded, because self-reported confidence is poorly calibrated — certainty on findings that are wrong, hedging on findings that are correct. Defining explicit criteria first establishes what counts as a finding at all; only once that exists does attaching a confidence score to each finding make sense, routing high-confidence findings directly and diverting low-confidence ones to human review. Confidence first only report findings above 80% confidence criteria: none defined yet wrong finding — 90% confidence kept ✕ correct finding — 60% confidence discarded ✕ confidence filters an undefined set Criteria first, then confidence Report: bugs, security vulnerabilities. Skip: style preferences, local patterns. defined finding — 90% confidence direct report ✓ defined finding — 55% confidence human review ✓ criteria first, confidence second — never the reverse
1 / 6Swipe diagram ↔

Criteria first, confidence second — never the reverse, step 1: Confidence filter only — no criteria defined yet

Deep Dive

Where the system prompt actually goes

Criteria you write for a reviewer belong in the top-level system parameter of the request, alongside model, messages and max_tokens. The Messages reference says: "Note that if you want to include a system prompt, you can use the top-level system parameter." The same reference now also lists a system-role message type (role: "system") among the entries messages accepts; the features overview describes these mid-conversation system messages as "A system instruction added partway through a conversation, without changing the top-level system prompt or the cached prefix before it." Standing review criteria are not that: they apply from the first turn, so they go in system.

await client.messages.create({
  model: "claude-sonnet-5-5",
  max_tokens: 4096,
  system: REVIEW_CRITERIA, // ← explicit categorical criteria live here
  messages: [{ role: "user", content: diff }]
});

Two related mechanics matter for a review pipeline. First, consecutive same-role messages are combined into a single turn rather than rejected, so appending criteria as an extra user message does not produce the separation you might expect. Second, max_tokens is a ceiling, not a target — "our models may stop before reaching this maximum" — so a short finding list is not evidence that your criteria suppressed output.

Sourcesplatform.claude.com › messagesplatform.claude.com › overviewplatform.claude.com › overviewfetched 2026-11-20

The "right altitude" — the two failure modes your criteria sit between

Anthropic's context-engineering guidance names the exact failure modes the exam dramatises. At one extreme, "engineers hardcoding complex, brittle logic in their prompts to elicit exact agentic behavior. This approach creates fragility and increases maintenance complexity over time." At the other, "engineers sometimes provide vague, high-level guidance that fails to give the LLM concrete signals for desired outputs" — that is "be conservative" exactly. The target is "the Goldilocks zone between two common failure modes … specific enough to guide behavior effectively, yet flexible enough to provide the model with strong heuristics", and the stated goal is "the minimal set of information that fully outlines your expected behavior."

This gives you a principled reason why the exam's correct answer is never "add more rules": Anthropic explicitly does not recommend "stuffing a laundry list of edge cases into a prompt in an attempt to articulate every possible rule."

Sourceanthropic.com › effective-context-engineering-for-ai-agentsfetched 2026-07-30

Heuristics plus guardrails, not rigid rules

The multi-agent research write-up reaches the same conclusion from production: the prompting strategy "focuses on instilling good heuristics rather than rigid rules", paired with "explicit guardrails to prevent agents from spiraling out of control". The same post reports that early in development "a prompt tweak might boost success rates from 30% to 80%" — which is why criteria refinement, not model swapping or temperature fiddling, is the highest-leverage first move on a noisy review pipeline.

Anthropic also found that vague delegation is what produces junk: "Without detailed task descriptions, agents duplicate work, leave gaps, or fail to find necessary information." A category with a vague criterion behaves the same way — it produces overlapping, low-value findings.

Sourceanthropic.com › multi-agent-research-systemfetched 2026-07-30

Express categorical criteria as machine-checkable labels

Where criteria are categorical, the prompting best-practices page says to stop asking for prose: "For classification tasks, use either tools with an enum field containing your valid labels or structured outputs." A severity criterion expressed as enum: ["critical", "major", "minor"] on an extraction tool is enforced by the schema, whereas the same criterion written in prose is enforced only by the model's interpretation. Task 4.3 covers the mechanism; the point for 4.1 is that explicit criteria and enforceable enums are the same design decision at two layers.

Sourceplatform.claude.com › claude-prompting-best-practicesfetched 2026-07-30

Measure criteria changes on a small eval set

Anthropic's documented practice is to start small: "We started with a set of about 20 queries representing real usage patterns … clearly see the impact of changes", and to grade with "an LLM judge that evaluated each output against criteria in a rubric: factual accuracy, citation accuracy, completeness, source quality, and tool efficiency". A "single LLM call with single prompt outputting scores 0.0-1.0 and pass-fail grade was most consistent." Manual review still matters — "People testing agents find edge cases that evals miss."

The Agent SDK guidance ranks feedback types for you: "The best form of feedback is providing clearly defined rules for an output, then explaining which rules failed and why." That is the same instruction shape as good review criteria — say which rule fired and why — and it is stronger than an LLM judging free-form quality, which the same page calls "generally not a very robust method".

Sourcesanthropic.com › multi-agent-research-systemclaude.com › building-agents-with-the-claude-agent-sdkfetched 2026-07-30

Quick Reference

ItemValue / rule
Where criteria liveTop-level system parameter
role: "system" entries in messagesMid-conversation system messages: instructions added partway through, not the standing system prompt
Consecutive same-role messagesCombined into a single turn, not rejected
max_tokensAn absolute ceiling only; the model may stop earlier
Lowering temperatureA sampling setting, not a precision control: it cannot define what counts as a finding
Prompt failure mode AHardcoded brittle if/else logic → fragility, maintenance cost
Prompt failure mode BVague high-level guidance → no concrete signal ("be conservative")
Target altitudeMinimal set of information that fully outlines expected behaviour
Explicitly not recommendedStuffing a laundry list of edge cases into the prompt
Preferred styleGood heuristics + explicit guardrails, not rigid rules
Criteria blockReport list + skip list (with reasons) + "omit anything outside the report list"
Finding outside the report categoriesOmit it; never report it at a lower severity
Comment criterionFlag only when the claimed behaviour contradicts the code
Categorical criteriaEncode as tool enum labels or structured outputs, not prose
PrecisionActed-on (true) findings ÷ all findings raised, measured per category
Eval set size to start~20 representative queries
LLM-judge shape that workedOne call, one prompt, 0.0–1.0 score + pass/fail grade against a rubric
Best feedback formClearly defined rules + which rule failed and why
Early-stage prompt leverageA single prompt tweak moved success 30% → 80%
False-positive trust ruleHigh FP rate in one category destroys trust in all categories
Trust recovery moveTemporarily disable the noisy category, refine, re-enable
Disabled categoryShadow mode: generate and log findings, do not post; re-enable at a precision bar set in advance
Confidence scoresEmit for routing and calibration; never filter on self-reported confidence in the prompt
Severity definitionConcrete code examples per level, never prose descriptions

Exam Traps

More wrong answers, and why each fails

Tempting answerWhy it failsChoose instead
Lower the temperature to reduce false positivesTemperature changes how much output varies between runs, not which findings the prompt defines as reportable; a finding that is consistently wrong is still a false positiveExplicit report and skip criteria
Post everything, but sort findings by confidence or collapse the noisy categoryThe noisy findings still ship under the same reviewer, so they keep eroding trust in the accurate onesDisable the noisy category until its criteria are reworked
Delete the noisy category from the prompt for goodLoses the real defects the category catches; disabling was a temporary measure to recover trustRework its criteria with examples, measure, then re-enable
Judge the rewritten criteria by the drop in the number of findingsCount is not precision: fewer findings can mean real defects are being missedCompare both versions on the same labelled set

How This Is Tested

Stem signalAnswerWrong-answer pattern beside it
Developers ignore the bot because one or two categories are noisy, while the others are accurateTemporarily disable the noisy categories and rework their criteriaConfidence threshold; keep all categories on; delete the category
"Be conservative" did not help; what will?Specific report and skip criteriaStronger wording ("extremely conservative"); lower temperature
Severity labels differ between runs on the same codeExplicit severity criteria with a concrete code example per levelMore prose in the definitions; a numeric risk score mapped to bands
Comment-accuracy findings are noisyFlag only when the claimed behaviour contradicts the actual behaviour"Check comments carefully"; drop comment checks entirely
A proposal to report only findings above a confidence cut-offReject it: write the criteria first, then route on emitted confidenceAccept the threshold as a precision fix
A long rule list keeps breaking as rules are addedA few strong heuristics plus guardrailsA bigger rule list, or the same list as a decision tree

None of the official sample questions belongs to this task statement, but one option in sample question 3 (Task 5.2, escalation calibration) is the confidence trap in another setting. Option B reads: "Have the agent self-report a confidence score (1-10) before each response and automatically route requests to humans when confidence falls below a threshold." The official explanation rejects it because "LLM self-reported confidence is poorly calibrated—the agent is already incorrectly confident on hard cases", and keys option A, "Add explicit escalation criteria to your system prompt with few-shot examples", as the fix that "directly addresses the root cause: unclear decision boundaries." The same ordering applies in code review: explicit criteria first.

Practice Scenario

Your CI reviewer's prompt says "Flag anything that could be a problem, but don't nitpick." Developers dismiss most of its comments as style preferences, yet last week it missed a race condition in a payment handler. The team has agreed that it cares about bugs, security defects and data-loss risks. What's the most effective first step?

Practice Questions

Exam simulator

Question 1 of 13

Scenario · Claude Code for Continuous Integration

Your CI reviewer's prompt says "Check that error handling is appropriate." It flags every catch block that does not log, including deliberate ones inside the retry helper and in tests that assert on exceptions. Developers dismiss 60% of its error-handling findings, and two teams have started ignoring the bot. What change would most effectively improve precision?

Sources