# Catch a long agent run drifting off course

> Researched. Small business · Intermediate · Operations. Updated 2026-11-02.

Canonical page: https://www.aisetupsthatwork.com/setups/catch-a-long-agent-run-drifting-off-course/

## What it does
Add a written goal, regular goal checks, a step limit and a stop-for-review checkpoint to long agent runs, so drift shows up mid-run instead of at the end.

## Who it's for
Owners running agents on long tasks, such as cleaning a list, building a report or updating many records, who find the final result is not what they meant.

## Tools
- Your agent's task instructions
- A 3-line goal
- A step or time limit

## Steps
1. Before the run, write the goal, what done looks like, and what must not change, in 3 lines.
2. Add the checkpoint rules from the prompt below to the task.
3. Set a stopping condition, such as a maximum number of steps. Anthropic's guide to building agents describes checking progress against real results at each step, pausing for human feedback at checkpoints, and using stopping conditions like iteration limits.
4. At each checkpoint, read the agent's goal check. If it has drifted, stop and restate the goal.
5. When a tool or setting changed recently, run a small test task first and compare with a past result.
6. Keep the 3-line goal with the output so you can check the end result against it.

## Copy-paste prompt
Adapt bracketed fields to your situation.
```text
Add these rules to this task:

Goal: [ONE LINE]
Done looks like: [ONE LINE]
Must not change: [ONE LINE]

1. Every [5] steps, stop and report: the goal in your own words, what you changed since the last check, and whether each change serves the goal (yes or no, with a reason).
2. If any answer is no, or you are unsure, pause and ask me before continuing.
3. Stop after [30] steps in total and report, even if not finished.
4. Before anything that cannot be undone, stop and ask.
```

## Guardrails
- What it touches: Connected mail, calendar, sheets, or chat. Scoped to this job (Your agent's task instructions; A 3-line goal).
- Needs your OK: Send, pay, publish, and account changes stay with you. Treat agent output as drafts first.
- Safety level: Read-only
- No written goal, so there is nothing to check against.
- Reading only the final output.
- Letting the agent judge its own drift without evidence of what it changed.

## Tips
- The 'must not change' line catches the most drift.
- Short checkpoints early, longer gaps once it is on track.
- A tool update can change behavior with no error; test small first.

## Estimates (labeled, not measured)
- Time saved: Saves rework on long runs; about 10 minutes to set up.
- Money saved: Not stated in sources.
- Tool cost: Prices: Not stated in sources.

## Sources
Summaries use the public sources below, not independent verification.
- Anthropic: https://www.anthropic.com/engineering/building-effective-agents (Building effective agents: agents check progress against ground truth such as tool results at each step, can pause for human feedback at checkpoints or when blocked, and use stopping conditions such as a maximum number of iterations (read 2026-11-02 from a search result summary of the page))

## Get the free starter pack
Five beginner copy-paste AI setups, free by email: https://www.aisetupsthatwork.com/starter-pack/?utm_source=ai-agent&utm_medium=markdown&utm_campaign=setup-catch-a-long-agent-run-drifting-off-course

Related:
- [Check your agent did the follow-up it promised](https://www.aisetupsthatwork.com/setups/check-your-agent-did-the-follow-up-it-promised/index.md)
- [Set guardrails before an AI agent gets access](https://www.aisetupsthatwork.com/setups/set-guardrails-before-giving-an-ai-agent-access/index.md)
- [Clean up your agent's long-term memory](https://www.aisetupsthatwork.com/setups/clean-up-your-agents-long-term-memory/index.md)
