Topic 5 of 5 · 4 min read
Checking work between chain steps
Goal: Place a check between two chain steps, say what it must catch, and decide whether a person or a model should run it.
A checkpoint is a deliberate pause between two chain steps where someone or something checks the output before it moves on. Because each step trusts the one before it, a mistake early in the chain is repeated, and often made to look more convincing, by every step after it.
Check yourself · 1 of 3
Why are checkpoints useful in a prompt chain?
Why it matters
Models guess, invent details and sound confident when they are wrong. In a one-shot prompt, you read the answer and judge it. In a chain, you may only read the last step. By then the wrong fact from step 1 has been outlined, drafted and polished. Anthropic's article on building effective agents shows prompt chaining with programmatic "gates" between steps, which are checks that decide whether to continue.
How to do it
- Find the risky hand-off. Look for the step where a wrong output would do the most damage later: extracted figures, a classification, a list of facts.
- Say what the check must catch. Be specific: "every number appears in the source", "the label is one of billing, bug or how-to", "no claim lacks a source".
- Choose who checks.
- A person for high stakes, judgement or anything that goes to a customer: legal wording, money, medical or safety content.
- A model for cheap, rule-like checks: format, completeness, matching a list, comparing against a source. Use a fresh prompt with the source text, not the same conversation that made the error.
- Code for exact rules: a total must equal the sum, a field must not be empty.
- Decide what happens on failure. Re-run the step, fix by hand, or stop the chain.
Before and after
Before: Step 1 extracts figures from a report. Step 2 writes a summary. Step 3 drafts an email to the board.
After: Step 1 extracts figures with the page number for each. Check: a model compares each figure to the page text and lists any that do not match; a person reviews that list. Step 2 writes the summary from the confirmed figures only. Step 3 drafts the email.
What goes wrong
- Asking the same model to mark its own homework in the same chat. It tends to defend its earlier answer. Use a new prompt with the source.
- Vague checks. "Make sure it is good" catches nothing. Name the failure.
- No check at all. The chain looks tidy and the error is hidden.
- Too many checks. A pause after every step wastes time. Put them where mistakes cost the most.
Examples
A check on extracted dates
Step 1 pulls every deadline from a contract. Check: a fresh prompt gets the contract text and the list, and answers for each date whether the contract says it. A person reads any that fail. Step 2 then builds a calendar from the confirmed list.
A check by code
Step 1 extracts line items from an invoice. Check: a short script adds the items and compares them to the stated total. If they differ, stop and show the gap to a person.
Key points
- A checkpoint is a pause between steps where output is checked before it moves on.
- Errors in early steps are repeated and polished by later steps.
- State exactly what a check must catch, such as every number appearing in the source.
- Use a person for high-stakes or judgement checks, a model or code for cheap rule-like ones.
- Check with a fresh prompt and the source, not in the same chat that made the mistake.
Common mistakes
- Reading only the final output of a chain.
- Asking the same chat to review its own work.
- Writing a check that does not say what it must catch.
- Putting every check at the end, after the error has spread.
Check yourself · 2 of 3
A chain drafts a message to a customer about a refund. Who should check the draft before it is sent?
Check yourself · 3 of 3
Which check is specific enough to be useful?
Practice items, not counted towards your mastery.
Start here
- Building effective agents (Anthropic) (opens in a new tab)ArticleFree
Describes prompt chaining as a workflow and shows where to put checks between steps.
- Prompt chaining (Prompt Engineering Guide) (opens in a new tab)CourseFree
A short worked example of splitting a document task into two linked prompts.
- Prompt engineering guide (OpenAI) (opens in a new tab)DocsFree
OpenAI's guidance on clear instructions and breaking work into smaller steps.