“New-customer conversion is down. Find the cause and recommend what to do.” The agent queries channels, then regions. The third query times out, so it restarts from the beginning. Or it produces a twelve-step plan, reads the first result, and forgets which hypothesis the task was meant to test. It appears to reason, yet the work never finishes.
The planning layer is not a checklist generator. It turns a complex objective into an execution process that preserves state, checks evidence, recovers from failure, and hands control to a person when necessary.
Every step needs an input, artifact, acceptance condition, and failure destination. Without those four elements, an “autonomous loop” is usually an unbounded retry loop.
Route complexity before planning
Not every question deserves an agent loop:
- A known metric, one read-only query, and low risk can use a constrained query path.
- Multiple sources, competing hypotheses, or code analysis justify plan–execute–verify.
- Writes, external communication, sensitive data, or expensive computation require explicit approval points.
- An unclear objective, definition, or coverage needs clarification—not a more elaborate plan.
Complexity routing saves cost and narrows the failure surface. Sending every request through a multi-agent workflow usually adds latency and makes diagnosis harder.
Seven fields in an executable step
| Field | Purpose |
|---|---|
step_id | Stable reference for recovery and audit |
objective | The uncertainty this step should reduce |
inputs | Data, semantic versions, and prior artifacts |
tool_contract | Allowed tool, parameters, and authority |
output_contract | Structure, version, and location of the artifact |
verification | Acceptance rule, tolerance, and independent check |
on_failure | Retry, replan, degrade, clarify, or escalate |
“Analyze channel impact” is not an executable step. A stronger objective is: “Using the same metric definition and coverage, compare conversion by channel between the current and baseline periods, identify the three largest absolute contributions, and verify denominator completeness.”
State cannot live only in the conversation
The harness should persist the factual state of a long task: objective, constraints, plan version, completed steps, artifact references, failure counts, budgets, approvals, and unresolved questions. Each model call receives only the slice required for the current decision.
A useful state machine might include PLANNING → READY → RUNNING → VERIFYING → COMPLETED, with WAITING_INPUT, WAITING_APPROVAL, REPLAN_REQUIRED, FAILED, and CANCELLED. Rules and tool outcomes drive transitions. A model may recommend a transition; it should not relabel a failure as completion.
Checkpoints preserve logical artifacts and versions rather than copying every sensitive row. On resume, revalidate data, semantics, permissions, and approvals. Yesterday’s approval does not authorize an action whose parameters changed today.
Separate planning, execution, and verification
A common pattern gives the Planner the next-step decision, the Executor controlled tool access, and the Verifier independent checks. These can be separate components or the same model operating under different context and permissions. The important property is control-plane separation:
- The Planner does not hold production credentials.
- The Executor does not expand task scope.
- The Verifier uses rules, executed checks, or independent evidence—not only model self-critique.
- The harness owns budgets, retries, and stopping.
Multiple agents are useful when specialized context, authority, or parallel work genuinely needs isolation. Several anthropomorphic roles sharing the same context, permissions, and evaluator create communication cost without a new control boundary.
Replanning needs triggers
Valid triggers include a missing source, failed verification, a newly discovered dependency, a near-exhausted budget, or a changed user objective. Replanning should preserve validated artifacts and record why the previous plan became invalid.
Disallow infinite retries with identical parameters, tool switching to bypass policy, silent expansion of data scope, and rewriting the objective to fit an attractive result. Planning is not a promise to finish at any cost; it is a search for a verifiable path inside constraints.
Example: diagnosing conversion decline
A bounded plan could be:
- Bind the conversion metric, period, channel coverage, and baseline.
- Verify watermarks and denominator completeness; stop attribution if incomplete.
- Decompose change by channel and identify the largest contributions.
- For candidate channels, test region, device, and campaign mix to guard against aggregation artifacts.
- Separate observations, hypotheses, and missing evidence; produce follow-up checks.
- Recompute material values with an independent query before drafting the report.
If step two finds missing data, the correct state is WAITING_INPUT or PARTIAL, not a generated list of likely causes. If step five provides association only, the output contract cannot silently become a causal conclusion.
Measure completion, not plan length
Useful planning metrics include:
- End-to-end task success: the final artifact satisfies its contract and passes verification.
- Effective-step rate: steps that produce valid artifacts used downstream.
- Recovery success: failures recovered within budget without duplicated side effects.
- Escalation quality: a person receives the gap, completed work, and a concrete choice.
- Budget adherence: steps, time, calls, and scanned data stay within limits.
- State consistency: task, report, and action states agree.
Token count and reasoning turns are not planning quality. A longer trace can simply be a more expensive way to get lost.
Start with two task classes
Choose one deterministic multi-step task and one open analysis that allows partial completion. Define states, step contracts, validators, maximum budgets, and human escalation points. Run them in shadow mode, collect real failure paths, and only then decide whether parallelism or specialized agents add value.
Good orchestration does not make the system sound more thoughtful. It makes the current state, stopping reason, trusted artifacts, and next owner visible.