AI Agents & RAG

Verified against Claude Agent SDK · 2026-07-25

Force an autonomous agent to plan in checkpoints instead of running long and silently drifting

A prompt for decomposing a long-horizon autonomous task into verifiable checkpoints with independently checkable success criteria per step, plus a periodic drift check that re-reads the original goal — so a small early misinterpretation gets caught before it compounds across dozens of technically-successful-looking steps.

Claude Agent SDKGPT-5.1AutoGPT-style agentsLangGraph4 fillable variables

The prompt

Ready to copy — highlighted parts are example details you can swap.

You are decomposing a long-horizon autonomous task into a checkpointed plan before execution starts, because a task with no intermediate checkpoints only reveals whether it went right or wrong at the very end, after every step's cost is already spent.

GOAL
Review 40 vendor contracts and produce a spreadsheet flagging every contract with an auto-renewal clause that doesn't require 60+ days notice to cancel

RESOURCE AND TIME BUDGET
Under 200 tool calls and under 90 minutes of runtime

AVAILABLE TOOLS/ACTIONS
read_file(path), extract_text(pdf), write_row(spreadsheet, row_data), flag_for_review(contract_id, reason)

DECOMPOSITION RULES
- Break the goal into steps small enough that each one has an independently checkable success criterion — not "research the topic" (unverifiable), but something like "find and quote the specific clause that defines the termination notice period" (verifiable: either the clause was found and quoted, or it wasn't).
- Order steps by dependency, not by convenience — a step that needs another step's output listed before that output exists is a plan that will stall or improvise mid-run.
- For each step, state what "done" looks like as something checkable against real evidence — a specific number was found, a specific file was modified and the diff shown, a specific test passed — never "seems reasonable" or "looks complete," since those aren't verifiable by anything other than the same judgment that might already be drifting.

CHECKPOINT VERIFICATION
After each step, before starting the next one, check the step's actual output against its stated success criterion. If it doesn't match, don't proceed as though it does — retry the step, revise the plan, or stop and report the blocker, but never silently treat a step that didn't meet its criterion as though it did just to keep momentum going.

DRIFT DETECTION
Every every 10 contracts processed steps, re-read the original goal and ask explicitly: does the plan as currently executing still point at this goal, or has it drifted toward a nearby-but-different goal that felt like a reasonable interpretation at some earlier step? A multi-step agent's most common failure isn't getting one step wrong, it's a small early misinterpretation compounding, unnoticed, across many technically-successful-looking steps.

BUDGET ENFORCEMENT
If the budget is exceeded before the goal is reached, stop and report exactly what's done, what's left, and what specifically consumed more budget than planned — don't quietly keep going past a stated budget on the assumption that finishing matters more than the budget that was set for a reason.

OUTPUT FORMAT
A numbered step list, each with: action, dependencies, success criterion, and estimated cost against the budget. Followed by the drift-check cadence and what re-reading the goal at each checkpoint should look for specifically.

Customize

Optional — swap in your own details for the highlighted parts above.

Why this works

Requiring each step's success criterion to be checkable against real evidence rather than the agent's own sense that the step 'seems complete' matters because an LLM agent's self-assessment of its own output is exactly as fallible as the reasoning that produced the output in the first place — asking the same process that might have made a mistake to also judge whether it made a mistake doesn't add an independent check, it just runs the same judgment twice. A criterion like 'the specific clause was found and quoted' can be verified by anyone, including the agent itself, by literally checking whether the quote exists and matches; a criterion like 'reviewed thoroughly' has no such check and just becomes whatever the agent already believed about its own step. The periodic drift-check is aimed at the failure mode that actually dominates in practice for long-horizon agents, which is not a single dramatic wrong action but a slow compounding one: an early step interprets an ambiguous instruction slightly wrong, every subsequent step is technically correct given that slightly-wrong interpretation, and by step thirty the agent has produced a large amount of internally consistent, individually verified work that answers a question adjacent to, but not actually, the one it was asked. Nothing about checking each step's own success criterion catches this, because each step did pass its own criterion — only re-reading the original goal from scratch at intervals, independent of the momentum the plan has built up, catches a drift that every local check would have missed. Hard budget enforcement with a required explanation of what actually consumed the excess, rather than a soft guideline, matters because autonomous agents left to their own judgment about when to stop tend to keep going past a soft limit precisely when they're closest to a goal that feels almost finished. Forcing a hard stop with a specific accounting of where the budget went turns an open-ended cost risk into a bounded, auditable one, and the 'what specifically consumed more than planned' requirement is what makes the next run's budget estimate better instead of just as wrong.

What you get back

Step 14 of 40: extract_text(contract_23.pdf), success criterion: auto-renewal clause quoted verbatim with its notice-period text. Output matched criterion — clause requires 30 days notice, flagged for review. Drift check at step 20: re-read goal, confirmed the plan is still filtering on notice-period length specifically, not accidentally broadening into flagging every auto-renewal clause regardless of notice period as step 17's phrasing had started to drift toward.

Verified against

Claude Agent SDK Sonnet 4.6 · 2026-07-25

GPT-5.1 2026-06 release · 2026-07-25

Changelog

  • 2026-07-25 Initial publish, verified against Claude Agent SDK long-running task loops and GPT-5.1 planning.

Building this for real?

This is a free starting point. If you'd rather have AI agents & automation built and running for your business, that's Scult's day job.

EXPLORE AI AGENTS & AUTOMATION
All AI Agents & RAG prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY