AI draft verification: Draft-Then-Verify Routing

Day 73: Draft-Then-Verify Routing
5 views
This guide focuses on AI draft verification for production systems, with practical trade-offs for reliability, security, and cost. Not every token deserves the expensive model. Draft-then-verify routes cheap drafts to an expensive gate for risky or low-confidence outputs — saving money without shipping unchecked diffs.
⚡ TL;DR: Cheap model drafts intents/plans; verifier model (or tests+critic) gates apply. Route by risk score and confidence. Tests still run regardless of model route.

AI draft verification: production guidance

python
RISKY_PATHS = ("/terraform/", "/iam/", "/payments/")

def needs_expensive_gate(intent: dict, conf: float) -> bool:
    if any(p in intent["path"] for p in RISKY_PATHS):
        return True
    return conf < 0.7
typescript
export async function draftThenVerify(goal: string) {
  const draft = await cheap.complete(goal);
  if (!needsExpensiveGate(draft)) return draft;
  const verdict = await expensive.verify(draft);
  if (!verdict.ok) throw new Error("verify_reject");
  return draft;
}
✅ Tests still run regardless of model route — verify ≠ skip CI.

Closing checklist

  • [ ] Risk-based routing
  • [ ] Expensive verify on risky paths
  • [ ] Keep deterministic tests as ground truth
  • [ ] Log which model drafted vs verified
  • [ ] Eval both paths in the suite

Series navigation

Day 72: Prompt Caching Pitfalls · Day 74: Batch Inference Overnight Last updated September 11, 2026 Related: Day 12: ReAct vs Plan-Then-Act vs Compiler Agents; IAM Access Analyzer: Verify AI-Generated Policies Before Attach; Incident ChatOps AI: Draft Change Tickets Without Auto-Remediating.

Watch: 100 Days of AI on YouTube

Short videos from CheatCoders, one AI engineering topic per day.

Open the playlist on YouTube · CheatCoders on YouTube

Deep-dive PDF

Get the expanded guide for this post — extra diagrams-style checklists, failure modes, and a production walkthrough. Free when you subscribe to CheatCoders.

Already subscribed? or open the subscribe page.


Discover more from CheatCoders

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

Leave a comment

No account needed. Name and email are optional.