Skip to content

4.1 System Prompts with Explicit Criteria

A system prompt holds the fixed instructions that Claude follows for every input. In a review task, explicit categorical criteria define precisely what the model should flag and what it should skip. A false positive is a finding that is wrong. Vague instructions, such as “be conservative”, “only report high-confidence findings” or “use your best judgement”, define neither. Relying on vague instructions is the single biggest mistake in production prompt engineering.

This lesson uses one made-up example throughout: a delicatessen that uses Claude to check product labels against recipe cards. Its prompt says to be conservative. Staff receive real allergen errors mixed with wrong flags about wording.

Vague instructions give the model no clear rule that it can act on to decide what to flag. “Conservative” means different things in different contexts. “High-confidence” is a subjective threshold that the model cannot calibrate.

The prompt below gives the model no criteria to apply.

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

This prompt gives concrete categories.

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

It names what to report (bugs, security) and what to skip (style, local patterns). It also names a specific trigger for comment flags: claimed behaviour that contradicts actual behaviour. The delicatessen’s version: flag labels missing a recipe-card allergen, and skip wording.

High false positive rates in one category destroy developer trust in every category, including accurate ones. Trust applies to the whole output. If the delicatessen’s wording flags are wrong 40% of the time, staff stop reading its allergen flags too, even at 98% accuracy.

The fix is to temporarily disable the categories with high false positive rates while you rework their prompts. When the wrong flags are gone, trust in the working categories returns immediately. Iterate on the failing category with concrete code examples, and enable it again only once precision (the share of its flags that are correct) improves. The delicatessen pauses its wording flags. Trust in the whole system matters more than keeping every category active.

A severity level ranks how serious a finding is. To define severity levels, you need concrete code examples, not prose descriptions.

This prose description is insufficient.

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

This code example approach is 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

The prose forces the model to interpret what “could cause system failures” means. The code example removes that ambiguity. When the model sees actual code patterns with their severity level, it classifies findings consistently from one invocation to the next. The delicatessen would show a sample label for each level.

LLM self-reported confidence is poorly calibrated. The model is often sure about wrong findings and hesitant about right ones. Confidence scores are useful for routing low-confidence findings to human review (Task Statement 4.6). They are no substitute for explicit criteria that define what counts as a valid finding. The order is explicit criteria first, confidence-based routing second. Never skip the first step. The delicatessen writes its allergen criteria, then routes low-confidence flags to a person.

Vague instructions sound reasonable. That is why the exam uses them as wrong options. The exam frequently offers “only report high-confidence findings” as a tempting answer, because keeping only high-confidence findings sounds like good engineering. Many questions also test how false positives in one category reduce trust in every category.

Six exam-style multiple-choice questions on System Prompts with Explicit Criteria. Pick an answer, then open the explanation.

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?

  • A. Add “only report high-confidence documentation issues” to the system prompt
  • B. Increase the model temperature to get more varied results and filter outliers
  • C. Disable the documentation mismatch category while its prompts are refined
  • D. Add a second model pass to verify each documentation finding before reporting
Answer & explanation

Correct: C

  • A is wrong because vague confidence instructions do not improve precision. The model has no concrete criteria for what “high-confidence” means.
  • B is wrong because temperature affects randomness, not precision. Higher temperature would increase false positives.
  • C is correct because it restores trust in all other categories immediately while you iterate on the problematic category with specific criteria. Trust recovery across all categories is the priority.
  • D is wrong because a second pass without better criteria will have the same false positive problem. Fix the criteria first.

Which of the following system prompt instructions gives the model the most actionable decision boundary for a code review task?

  • A. “Flag only where claimed behaviour contradicts the code.”
  • B. “Use your best judgement to identify important code issues”
  • C. “Be conservative and only flag issues you are highly confident about”
  • D. “Try to minimise false positives while maintaining good coverage of real issues”
Answer & explanation

Correct: A

  • A is correct because it defines specific trigger conditions (claimed vs actual behaviour contradiction), categories to report (bugs, security), and categories to skip (style, local patterns).
  • B is wrong because “best judgement” and “important” give no concrete criteria.
  • C is wrong because “conservative” and “highly confident” are subjective thresholds with no actionable interpretation.
  • D is wrong because it describes desired outcomes without specifying the criteria to achieve them.

Your team defines severity levels for a code review system. Which approach produces the most consistent classification across invocations?

  • A. “Critical: issues that could cause system failures or data loss. Minor: issues that affect code readability.”
  • B. A decision tree that categorises by file type first, then by issue type
  • C. A confidence threshold where findings above 0.9 are critical and below 0.5 are minor
  • D. Concrete code examples for each severity level, critical through minor
Answer & explanation

Correct: D

  • A is wrong because prose descriptions like “could cause system failures” force the model to interpret ambiguous language, producing inconsistent classification.
  • B is wrong because file type is not a reliable proxy for severity. A critical SQL injection can appear in any file type.
  • C is wrong because confidence scores are poorly calibrated and do not correlate reliably with actual severity.
  • D is correct because concrete code examples remove ambiguity entirely. When the model sees actual code patterns classified at each severity, it produces consistent results.

A developer argues that adding “only report findings with confidence above 0.85” to the system prompt will reduce false positives. Why is this approach insufficient?

  • A. 0.85 is too high a threshold; 0.70 would be more appropriate
  • B. LLM self-reported confidence is poorly calibrated and unreliable
  • C. Confidence filtering only works with the Batches API, not synchronous calls
  • D. The model ignores confidence threshold instructions in system prompts
Answer & explanation

Correct: B

  • A is wrong because the issue is not the threshold value but that confidence scores themselves are unreliable for this purpose.
  • B is correct because LLM self-reported confidence is poorly calibrated. Explicit categorical criteria that define what to flag and skip are the correct first step; confidence-based routing is a secondary technique.
  • C is wrong because confidence filtering is not API-dependent. The issue is calibration quality.
  • D is wrong because the model does not ignore these instructions; it applies them inconsistently because confidence is poorly calibrated.

Your code review system has five categories. “Unused imports” has a 45% false positive rate, while the other four categories average 8%. Developers have stopped reading any review output. What should you do first?

  • A. Disable “unused imports” while its criteria are refined with real code examples
  • B. Add a confidence threshold to filter low-confidence findings across all categories
  • C. Retrain the system on more code examples to improve overall accuracy
  • D. Reduce the number of categories to only the three most reliable ones permanently
Answer & explanation

Correct: A

  • A is correct because high false positives in one category destroy trust in ALL categories. Disabling the problematic category restores trust in the four working categories immediately while you iterate on “unused imports” criteria.
  • B is wrong because confidence thresholds are poorly calibrated and would suppress valid findings in the working categories.
  • C is wrong because the problem is a single noisy category destroying trust, not overall model capability.
  • D is wrong because permanently removing categories loses functionality. The strategy is to temporarily disable, improve, and re-enable.

The hierarchy for improving precision in a production code review system is:

  • A. Confidence thresholds first, then explicit criteria if thresholds are insufficient
  • B. Few-shot examples first, then explicit criteria, then confidence thresholds
  • C. Explicit categorical criteria first, then confidence-based routing as a secondary technique
  • D. Temperature adjustment first, then criteria refinement, then confidence routing
Answer & explanation

Correct: C

  • A is wrong because it reverses the hierarchy. Confidence thresholds without explicit criteria are poorly calibrated.
  • B is wrong because few-shot examples address consistency, not precision criteria. Explicit criteria come first for precision.
  • C is correct because explicit criteria define what constitutes a valid finding. Confidence routing is useful but only after criteria are established.
  • D is wrong because temperature affects randomness, not precision. It is not part of the precision improvement hierarchy.