Skip to content
CCAF Preparation

Task Statement 4.1·Domain 420% of exam

System Prompts with Explicit Criteria

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

Jump to practice →

Official Exam Guide Objectives

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.

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.

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.

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.

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.

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. The problem is that a model's self-reported confidence is poorly calibrated — it will report 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.

Confidence does have a proper job. Routing low-confidence output to human review is genuinely useful, and Task Statement 4.6 covers it. 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.

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

Deep Dive

Where the system prompt actually goes

The Messages API has no "system" role. Criteria you write for a reviewer live in the top-level system parameter of the request, alongside model, messages and max_tokens — not as the first entry in the messages array. The docs are explicit: "if you want to include a system prompt, you can use the top-level system parameter — there is no "system" role for input messages in the Messages API."

await client.messages.create({
  model: "claude-sonnet-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.

Sourceplatform.claude.com › messagesfetched 2026-07-30

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

Temperature is not a precision control

A recurring distractor is "lower the temperature to reduce false positives". temperature is documented as "Amount of randomness injected into the response", defaults to 1.0, and ranges 0.01.0; the guidance is to use values "closer to 0.0 for analytical / multiple choice, and closer to 1.0 for creative and generative tasks". Crucially, "even with temperature of 0.0, the results will not be fully deterministic." Lower temperature can tighten variance; it cannot invent a decision boundary the prompt never defined.

Sourceplatform.claude.com › messagesfetched 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 — there is no "system" role in messages
Consecutive same-role messagesCombined into a single turn, not rejected
max_tokensAn absolute ceiling only; the model may stop earlier
temperature default / range1.0; 0.01.0. Closer to 0.0 for analytical work
temperature: 0.0Still not fully deterministic — not a precision fix
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
Categorical criteriaEncode as tool enum labels or structured outputs, not prose
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
Severity definitionConcrete code examples per level, never prose descriptions

Exam Traps

Practice Scenario

Your CI/CD code review pipeline has a 40% false positive rate on 'documentation mismatch' findings, causing developers to ignore ALL review categories including accurate security findings. What is the most effective fix?

Build Exercise

Build an Explicit Criteria Code Review Prompt

Difficulty: Intermediate (2/4)

45 minutes

  1. Write a system prompt with vague instructions (be conservative, only flag important issues) and test it against 5 code snippets containing known bugs, security issues, and style nitpicks

Why: Establishing a baseline with vague instructions demonstrates the false positive problem the exam tests. You need empirical evidence that phrases like be conservative give the model no actionable decision boundary.

You should see: Inconsistent classification across the 5 snippets: some style nitpicks flagged as critical, some genuine bugs missed or marked minor, and different results if you run the same snippets twice.

  1. Rewrite the prompt with explicit categorical criteria: define exactly which issues to report (bugs, security vulnerabilities) and which to skip (style preferences, local patterns)

Why: Explicit categorical criteria are the correct approach tested on the exam. This step demonstrates that concrete categories eliminate the ambiguity that causes false positives.

You should see: The rewritten prompt has clear categories: report bugs and security vulnerabilities, skip style preferences and local patterns, flag comments only when claimed behaviour contradicts actual code behaviour.

  1. Add concrete code examples for each severity level — critical, major, minor — showing actual code patterns, not prose descriptions

Why: The exam specifically tests that code examples outperform prose descriptions for severity calibration. Prose like issues that could cause system failures forces the model to interpret, while code examples remove ambiguity entirely.

You should see: Your prompt now contains at least one code snippet per severity level, each showing the actual pattern that defines that severity, not a prose description of what that severity means.

  1. Compare false positive rates between the two versions on the same test set and document which approach produces more consistent classification

Why: Quantifying the improvement validates the explicit criteria approach and builds the evaluation skill the exam expects. You should be able to articulate why one approach outperforms the other with data, not intuition.

You should see: A clear reduction in false positives with the explicit criteria version. The vague prompt should produce 30-50% inconsistency while the explicit criteria version should be below 15%. Classification should be stable across repeated runs.

  1. Temporarily disable any category with above 25% false positive rate and document the criteria refinements needed before re-enabling

Why: The trust recovery strategy is a key exam concept: high false positive rates in one category destroy developer trust in ALL categories. Disabling problematic categories restores system-wide trust while you iterate on their criteria.

You should see: A document listing which categories exceed the 25% threshold, what specific criteria refinements are needed (e.g., add code examples for edge cases), and a re-enablement plan with target false positive rates.

Sources


Appendix A — Build Exercise Step Hints

Progressive hints revealed by the "Stuck? Get a nudge" control on each step.

Step 1. Write a system prompt with vague instructions (be conservative, only flag important issues) and test it against 5 code snippets containing known bugs, security issues, and style nitpicks

Why: Establishing a baseline with vague instructions demonstrates the false positive problem the exam tests. You need empirical evidence that phrases like be conservative give the model no actionable decision boundary.

You should see: Inconsistent classification across the 5 snippets: some style nitpicks flagged as critical, some genuine bugs missed or marked minor, and different results if you run the same snippets twice.

Stuck? Get a nudge

Step 2. Rewrite the prompt with explicit categorical criteria: define exactly which issues to report (bugs, security vulnerabilities) and which to skip (style preferences, local patterns)

Why: Explicit categorical criteria are the correct approach tested on the exam. This step demonstrates that concrete categories eliminate the ambiguity that causes false positives.

You should see: The rewritten prompt has clear categories: report bugs and security vulnerabilities, skip style preferences and local patterns, flag comments only when claimed behaviour contradicts actual code behaviour.

Stuck? Get a nudge

Step 3. Add concrete code examples for each severity level — critical, major, minor — showing actual code patterns, not prose descriptions

Why: The exam specifically tests that code examples outperform prose descriptions for severity calibration. Prose like issues that could cause system failures forces the model to interpret, while code examples remove ambiguity entirely.

You should see: Your prompt now contains at least one code snippet per severity level, each showing the actual pattern that defines that severity, not a prose description of what that severity means.

Stuck? Get a nudge

Step 4. Compare false positive rates between the two versions on the same test set and document which approach produces more consistent classification

Why: Quantifying the improvement validates the explicit criteria approach and builds the evaluation skill the exam expects. You should be able to articulate why one approach outperforms the other with data, not intuition.

You should see: A clear reduction in false positives with the explicit criteria version. The vague prompt should produce 30-50% inconsistency while the explicit criteria version should be below 15%. Classification should be stable across repeated runs.

Stuck? Get a nudge

Step 5. Temporarily disable any category with above 25% false positive rate and document the criteria refinements needed before re-enabling

Why: The trust recovery strategy is a key exam concept: high false positive rates in one category destroy developer trust in ALL categories. Disabling problematic categories restores system-wide trust while you iterate on their criteria.

You should see: A document listing which categories exceed the 25% threshold, what specific criteria refinements are needed (e.g., add code examples for edge cases), and a re-enablement plan with target false positive rates.

Stuck? Get a nudge

Appendix B — Interactive Study Prompts

Two prompts to paste into Claude. B1 drills the judgement the exam actually measures; B3 reviews the prompts you wrote for the Build Exercise above. The exam simulator between them is the interactive quiz on this page.

B1. Concept Check — Discrimination Drill

Prompt — paste into Claude

You are examining me for the Claude Certified Architect – Foundations (CCAR-F) exam, Domain 4: Prompt Engineering & Structured Output (20% of the exam), Task Statement 4.1: System Prompts with Explicit Criteria. Use British English throughout.

What this exam actually measures. Not one item on the official exam asks what something is. Every item drops you into a production system that is already misbehaving, offers four defensible engineering responses, and asks which is best. The skill being tested is proportionality: fix the root cause with the cheapest instrument that gives the guarantee the situation demands. So do not quiz me on definitions. Make me choose between options that are both defensible, then attack whatever I chose.

How to run this session.

  • One question at a time. Stop and wait. Never answer your own question, and never move on until I have committed.
  • Never reveal which option is right before I commit to one.
  • Do not praise me. A correct answer earns "Yes" and the next question. If I am right for the wrong reason, say so — that is the failure that costs marks on exam day.
  • When I am wrong, quote the exact phrase in my answer that gave it away, correct it in one sentence, and move on. One correction at a time.
  • If I write something fluent but empty, name it: "That is a restatement, not a reason."
  • Set every scenario inside one of the exam's production contexts: Structured Data Extraction (pulling fields out of unstructured documents, validating them against a JSON schema, handling edge cases, feeding a downstream system) or Claude Code for Continuous Integration (automated review on pull requests, generated tests and PR feedback, with false positives to keep down).

Session plan — about twelve questions.

Round 1 — Anchor (1 question). One concrete question to check I have actually read the material. If I cannot answer it, stop the session and tell me to read the lesson before continuing.

Round 2 — Discrimination (5 questions). Each one: describe a symptom in one of the contexts above, with a number or a log observation in it. Offer exactly two responses, both defensible. Ask me to pick one and justify it in a single sentence. Then argue the case for the option I rejected as strongly as you can, and ask whether I am holding or changing my answer. Only after I answer that, tell me which is right and why the other one is the more tempting trap.

Round 3 — Proportionality (2 questions). Take one symptom and run it twice with different stakes: once where the cost of an error is a wasted re-extraction or a noisy comment on a pull request, once where it is a payment issued against a mis-extracted total or a security defect merged to main. The right answer must change between the two. If I answer the same way both times without noticing the stakes moved, that is the finding — tell me.

Round 4 — Code review (3 questions). Present a colleague's confident proposal containing one of the trap errors listed below, written the way a teammate would write it in a pull request. Ask me what is wrong with it. Do not signal that anything is wrong.

Round 5 — Verdict. Rate me green, amber or red on each concept below. Name the single weakness most likely to cost me marks, and give me one specific next action: a section of this lesson to re-read, or a step of the Build Exercise to redo. If I am not ready for this task statement, say so plainly.

Concepts in scope

  1. Explicit categorical criteria — criteria that name what to report (bugs, security vulnerabilities) and what to skip (style preferences, local patterns), with a specific trigger for comment flags: claimed behaviour contradicting actual code behaviour. They live in the request's top-level system parameter; the Messages API has no "system" role inside messages.
  2. Why vague instruction fails — "be conservative", "use your best judgement" and "only report high-confidence findings" give the model no decision boundary it can act on, because none of them means anything fixed without domain context.
  3. False-positive trust bleed — a category wrong 40% of the time destroys developer trust in every other category, including one running at 98% accuracy. Trust is not category-specific; it bleeds across the whole output.
  4. Disable, refine, re-enable — the recovery move is to switch the noisy category off while its criteria are reworked with concrete examples, putting system-wide trust ahead of category completeness.
  5. Severity calibration by example — severity levels anchored to actual code patterns classify consistently across invocations; prose definitions such as "issues that could cause system failures" leave the model interpreting.
  6. Criteria before confidence — self-reported confidence is poorly calibrated, so it earns its keep routing uncertain findings to human review only after explicit criteria have defined what counts as a finding at all.

Trap errors to plant in Round 4

  • Offering "be conservative" or "only report high-confidence findings" as the prompt improvement, when neither gives the model an actionable boundary.
  • Reaching for a confidence threshold to fix a false-positive problem, when the criteria that define a valid finding were never written.
  • Leaving every review category switched on while iterating on the one with the high false-positive rate, so the noise keeps eroding trust in the accurate categories.
  • Lowering temperature to cut false positives, when temperature cannot invent a decision boundary the prompt never defined and 0.0 is still not fully deterministic.

Stay inside the material above. If I raise something outside it, tell me it is out of scope for this task statement and return to the drill. Begin with Round 1.

B2. Exam Simulator

Exam simulator

Question 1 of 10

Scenario · Claude Code for Continuous Integration

Your CI reviewer posts findings in five categories. "Documentation mismatch" is wrong 40% of the time; the security category runs at 98% accuracy. Developers have started collapsing the whole review comment without reading any of it. What's the most effective first step to restore confidence in the reviewer?

B3. Build Coach — Prompt Review

The Build Exercise and its hint ladder are already on this page. This prompt is for the one thing the page cannot do: review the criteria you actually wrote.

Prompt — paste into Claude

You are a staff engineer reviewing my implementation of a build exercise for the Claude Certified Architect – Foundations exam, Domain 4, Task Statement 4.1: System Prompts with Explicit Criteria. Use British English throughout.

I am building an explicit-criteria code review prompt: a vague baseline system prompt run against a small set of snippets carrying known bugs, security issues and style nitpicks, then rewritten as explicit categorical criteria with a concrete code example anchoring each severity level, measured for false positives across both versions on the same set, with any category above the threshold switched off pending refinement.

It has to satisfy all of the following:

  • The baseline classifies inconsistently in a way I can point at: a style nitpick marked critical, a genuine bug missed or marked minor, and a different answer on a repeat run of the same snippet.
  • The rewritten criteria name what to report and what to skip as categories, and carry the comment-flag trigger: claimed behaviour contradicting actual code behaviour.
  • Each severity level is anchored to a real code pattern rather than a prose description of what that level means.
  • False-positive rates are measured for both versions against the same snippets, and the explicit-criteria version is stable across repeated runs.
  • Every category above the false-positive threshold is listed with the specific refinement it needs and the target rate for switching it back on.

How to review.

  • Ask me to paste both system prompts, the test snippets, and a sample of the actual model output on each version. If I have not pasted them, ask for them and nothing else. Do not write the criteria for me, do not offer a reference prompt, and do not fill in a step I have skipped.
  • Work through the criteria above in order. For each one, quote the line of my prompt or my output that satisfies it, or say plainly that nothing does.
  • Then hunt for the failure modes below. Each is a real production failure, not a style preference.
  • Rank everything you find: (1) would fail in production, (2) would lose marks on the exam, (3) style. Give me the first item under (1) and then stop — wait for my fix before giving me the next one.
  • If my work satisfies everything, do not congratulate me. Change the requirements — a fourth category, documentation mismatch, arrives running at a 40% false-positive rate, and the team says switching it off is not an option this sprint — and make me handle it.
  • If I ask you to just write it for me, refuse once and give me the smallest nudge that would unblock me instead.

Failure modes to probe

  • Criteria that still read as judgement calls — "important", "significant", "obvious" — so the decision boundary was never actually moved.
  • A severity level defined in prose because no code example was found for it, leaving the model to interpret exactly the level that matters most.
  • The criteria sent as the first entry in messages rather than in the request's top-level system parameter.
  • A precision figure taken from a single run of each version, so nothing separates a real improvement from run-to-run variance.
  • A confidence threshold quietly doing the filtering the criteria were supposed to do, which hides the false-positive rate rather than fixing it.

Start by asking me for my prompts and output.