Study guides / CCDV-F

Quick reference

One condensed cheat-sheet per domain - the tables and rules worth re-reading right before the exam.

Explicit Criteria: Symptom → Fix

SymptomFixWhy
System prompt states a goal but no threshold ("be conservative", "flag inappropriate content")Rewrite as explicit report/skip categories plus a rule for at least one named borderline caseAn inferred threshold drifts between similar cases - explicit criteria give the model a decidable rule
Findings filtered by the model's self-reported confidence scoreFix the underlying criteria first; use confidence routing only as a secondary layer afterwardLLM self-reported confidence is poorly calibrated - confidently wrong and hesitantly right both happen
One noisy, high-false-positive category in a multi-category promptTemporarily disable that category while reworking its criteria with concrete examplesTrust isn't scoped per category - a bad category poisons trust in every category from the same prompt
Prompt keeps getting longer/more earnest-sounding to fix inconsistencyAdd concrete, checkable criteria instead of more descriptive languageLength isn't the lever - a short prompt with a decidable rule beats a long, still-vague one

Precision vs. Recall Defaults

Every classification-shaped prompt (flagging, extraction, routing, moderation) makes this trade-off whether you name it or not - name it on purpose.

BiasDefault ruleGood fit
Precision (fewer false positives)"When in doubt, don't flag"Spam filtering - anything where a false alarm wastes reviewer time
Recall (fewer missed cases)"When in doubt, flag for review"Fraud detection, safety triage - anything where a miss is costly

Name at least one concrete borderline case in the prompt and state which way to err on it - general wording about being "careful" or "thoughtful" doesn't resolve it.

tool_choice Modes

ModeBehaviorUse when
{"type": "auto"} (default)Model may call a tool or return plain textConversational agent - never when structured output must be guaranteed
{"type": "any"}Model must call some tool, picks whichInput type unknown ahead of time, multiple candidate schemas
{"type": "tool", "name": "..."}Model must call this specific toolA mandatory step with zero flexibility

Check stop_reason: tool_use means a tool was called; end_turn under auto means it wasn't - that's the gap auto doesn't close.

Schema Design & Validation Checklist

Few-Shot Prompting Checklist

Context Failure Modes → Fix

SymptomLikely causeFix
Long-running agent starts contradicting an early, correctly-established findingProgressive summarization trap - repeated summary-of-summary compounds information lossAvoid re-summarizing an already-summarized history repeatedly; summarize from source material when possible
A fact stated once early in a long session stops being honored laterLost-in-the-middle effect - mid-context content is attended to less reliablyRestate genuinely important facts near the end of the context, not just once early on
input_tokens keeps climbing across turns even though old tool output is no longer neededLarge stale tool results resent unchanged on every callTrim the specific stale tool result to a short placeholder, not the whole conversation
Context is trimmed but cache_read_input_tokens drops to near zeroTrimming/rewriting an earlier message invalidated the cache prefixTrim in batches at natural checkpoints, not every turn; keep the cache breakpoint before the volatile tail

Trimming Approaches Compared

ApproachWhat it targetsRisk
Naive sliding window (drop oldest N messages)Age of the message, regardless of contentCan discard a short, still-relevant instruction while leaving a huge stale tool result untouched
Targeted stale tool-result trimmingThe actual driver of token growthLow risk if a minimal placeholder is kept so the model still knows the step happened
Repeated whole-conversation re-summarizationEntire history compressed into a running summaryCompounding information loss across passes - the progressive summarization trap
Per-turn trimming with prompt caching enabledImmediate token savings on the current callInvalidates the cache prefix for every turn after the edit, raising cost on the next call