Lesson 5 of 15 - 12 min
Design the Checks Around the Model
A workflow can fail quietly. The instruction looked fine in testing, an odd input arrives, and a bad result goes out. Design the checks around the model step before you wire anything up. A check is a gate between steps that keeps the chain on track.
Three Kinds of Check
- Input checks run before the model: is every required field present, is the text long enough to be real, is this an input type the workflow handles. If not, stop or route to a person.
- Output checks run after. Use code for the schema and exact fields: is the output in the format you asked for, does it have every required part. Check factual claims against their source records. A second model can flag possible issues, but it can also miss them.
- Human checks: a person reviews every customer-facing draft before it's sent. Sampling is for low-risk internal outputs only.
Test the Checkers with Planted Errors
Test your checkers the same way you test the workflow: plant errors on purpose. Swap an amount, a date, a recipient, and add a claim that isn't in the source. A checker that doesn't catch planted errors isn't ready. Keep the prompt-injection caveat in mind: text in the input can try to steer a checker too, so the checks that matter most should be code, not another model.
Worked Example (Made-Up Numbers)
Dana's workflow checks that the notes have at least five lines and a client name. If not, it stops and messages her. After drafting, a script checks that every project name in the draft appears in the notes and that every invoice 14 days or more overdue is mentioned. In week three the model writes a cheerful note to a client who is two months behind on payment, and the invoice check flags the missed overdue mention. She edits the draft and adds a rule about tone for overdue accounts.
Common Mistakes
- Only testing the happy path.
- Letting the model approve its own work with no separate check.
- Skipping the stop when input is missing.
- Not planting an error to see if the checker notices.
Exercise
Write one input check, one output check and the rule for what a person reviews. Then plant three errors and see which ones get caught.
Next step: AI Workflows, Agents & Automation
Production AI workflows, agents and automation across research, content, sales and operations.
$897.
