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
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, 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:
| Vague | Explicit |
|---|---|
| "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, 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:
| Category | Findings raised | Acted on | Precision |
|---|---|---|---|
| security | 22 | 20 | 91% |
| correctness | 50 | 44 | 88% |
| maintainability | 22 | 4 | 18% |
| performance | 84 | 13 | 15% |
| All categories | 178 | 81 | 46% |
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_patternfield 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 functionalityCode 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:
| Level | Named pattern | Example |
|---|---|---|
| Critical | User input reaches a shell command unvalidated | subprocess.run(f"convert {user_filename} out.png", shell=True) |
| Critical | Delete runs with a possibly empty filter | session.query(Order).filter(*build_filters(params)).delete() |
| Major | Index into a result that can be empty | first = results[0] with no empty check |
| Major | Property access with no null guard | const name = response.data.user.name; |
| Major | Query per item in a loop (N+1): correct, but scales badly | for o in orders: o.customer = db.get_customer(o.customer_id) |
| Minor | Unused import | import 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, 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:
- 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.
- 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.
- 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, 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
| Item | Value / rule |
|---|---|
| Where criteria live | Top-level system parameter |
role: "system" entries in messages | Mid-conversation system messages: instructions added partway through, not the standing system prompt |
| Consecutive same-role messages | Combined into a single turn, not rejected |
max_tokens | An absolute ceiling only; the model may stop earlier |
Lowering temperature | A sampling setting, not a precision control: it cannot define what counts as a finding |
| Prompt failure mode A | Hardcoded brittle if/else logic → fragility, maintenance cost |
| Prompt failure mode B | Vague high-level guidance → no concrete signal ("be conservative") |
| Target altitude | Minimal set of information that fully outlines expected behaviour |
| Explicitly not recommended | Stuffing a laundry list of edge cases into the prompt |
| Preferred style | Good heuristics + explicit guardrails, not rigid rules |
| Criteria block | Report list + skip list (with reasons) + "omit anything outside the report list" |
| Finding outside the report categories | Omit it; never report it at a lower severity |
| Comment criterion | Flag only when the claimed behaviour contradicts the code |
| Categorical criteria | Encode as tool enum labels or structured outputs, not prose |
| Precision | Acted-on (true) findings ÷ all findings raised, measured per category |
| Eval set size to start | ~20 representative queries |
| LLM-judge shape that worked | One call, one prompt, 0.0–1.0 score + pass/fail grade against a rubric |
| Best feedback form | Clearly defined rules + which rule failed and why |
| Early-stage prompt leverage | A single prompt tweak moved success 30% → 80% |
| False-positive trust rule | High FP rate in one category destroys trust in all categories |
| Trust recovery move | Temporarily disable the noisy category, refine, re-enable |
| Disabled category | Shadow mode: generate and log findings, do not post; re-enable at a precision bar set in advance |
| Confidence scores | Emit for routing and calibration; never filter on self-reported confidence in the prompt |
| Severity definition | Concrete code examples per level, never prose descriptions |
Exam Traps
More wrong answers, and why each fails
| Tempting answer | Why it fails | Choose instead |
|---|---|---|
| Lower the temperature to reduce false positives | Temperature 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 positive | Explicit report and skip criteria |
| Post everything, but sort findings by confidence or collapse the noisy category | The noisy findings still ship under the same reviewer, so they keep eroding trust in the accurate ones | Disable the noisy category until its criteria are reworked |
| Delete the noisy category from the prompt for good | Loses the real defects the category catches; disabling was a temporary measure to recover trust | Rework its criteria with examples, measure, then re-enable |
| Judge the rewritten criteria by the drop in the number of findings | Count is not precision: fewer findings can mean real defects are being missed | Compare both versions on the same labelled set |
How This Is Tested
| Stem signal | Answer | Wrong-answer pattern beside it |
|---|---|---|
| Developers ignore the bot because one or two categories are noisy, while the others are accurate | Temporarily disable the noisy categories and rework their criteria | Confidence threshold; keep all categories on; delete the category |
| "Be conservative" did not help; what will? | Specific report and skip criteria | Stronger wording ("extremely conservative"); lower temperature |
| Severity labels differ between runs on the same code | Explicit severity criteria with a concrete code example per level | More prose in the definitions; a numeric risk score mapped to bands |
| Comment-accuracy findings are noisy | Flag 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-off | Reject it: write the criteria first, then route on emitted confidence | Accept the threshold as a precision fix |
| A long rule list keeps breaking as rules are added | A few strong heuristics plus guardrails | A 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
- Claude Certified Architect Foundations Exam Guide — Task Statement 4.1 — Anthropic
- Prompt Engineering Overview — Anthropic
- Building with Claude API (Skilljar) — Anthropic
- Claude Docs — Messages — Anthropic
- Features overview — Anthropic
- Models overview — Anthropic
- Anthropic Engineering — Effective Context Engineering For Ai Agents — Anthropic
- Anthropic Engineering — Multi Agent Research System — Anthropic
- Claude Docs — Claude Prompting Best Practices — Anthropic
- Anthropic Blog — Building Agents With The Claude Agent Sdk — Anthropic