# Plan-first prompt: make the agent write its steps before it touches anything

From Distru's No Bullshit AI Course, lesson 10-06 (learnai.distru.com). CC0 1.0. Version 1.0, September 2026.
Adapted in part from Microsoft's *AI Agents for Beginners* (MIT License, Copyright (c) Microsoft Corporation); not endorsed by Microsoft.

**What it is for:** any job you hand an AI agent that takes more than one step: reconciling a manifest, cleaning a product list, chasing overdue invoices. Paste it before the job. It makes the agent show its plan and how it will check each step, and stop instead of improvising when a check fails.

**How to use it:** paste the block below, fill in the two lines in capitals, send it, and read the plan before you say "go". If the plan has a step with no check, or a step that changes something without asking you, say no and ask for a new plan.

---

```text
Before you do anything, write your plan. Do not call any tool that changes, sends, saves or
deletes anything until I have approved the plan.

THE JOB: <one sentence: what done looks like>
THE LIMITS: <what you may not do, e.g. "never accept a manifest in Metrc", "read only">

Write the plan as a numbered list. For every step give:
  - what you will do,
  - which tool or source you will use,
  - how you will check that the step worked, using a number or record from a real system,
    not your own judgment ("the package counts from Metrc and the inventory system match"),
  - what you will do if the check fails (stop and tell me, unless I have said otherwise).

Then wait for me to say "go".

When I say go:
  - Do one step at a time. After each step, report the check and whether it passed.
  - If a check fails, stop. Tell me which step, what you expected and what you found.
    Do not work around it, and do not change records to make numbers match.
  - If you learn something that makes the plan wrong, stop and propose a new plan.
  - Anything that changes, sends, saves or deletes a real record: ask me first, every time.
  - At most two new plans. After that, stop and hand the job back to me.
```

---

**For the tech person:** the same shape in code is plan-then-execute. Have the model return the plan as structured output (one object per step with `action`, `tool`, `check`, `on_fail`), validate it before running anything (every step has a check; no write tool outside an approval step), run each step's check in code against the tool's result, and cap re-plans. The model's own "this looks right" is not a check.
