# Testing and iterating

> Change an agent that already works without breaking it — what to change one at a time, how to tell whether it helped, and how to get back.

An agent is tuned by iteration: change one thing, run the same task, compare. Endue keeps prompt [revisions](/docs/build/system-prompt/#revisions-and-rollback) so the "get back" step is always available.

## When to use it

Whenever an agent is nearly right. The failure mode this page exists to prevent is the common one: three changes at once, the agent gets better in one way and worse in another, and nothing can be attributed to anything.

## A loop that works

1. **Keep a task you re-run.** Two or three real requests you have asked before, whose good answer you can recognize immediately. This is your test set. Without one, "better" is a feeling.
2. **Change one thing.** The prompt, or the model, or a binding — not all three.
3. **Run the same task in a new conversation.** A new [conversation](/docs/work/conversations/) matters: an existing thread carries history that changes the answer independently of your edit.
4. **Compare against what you saw before.** Look at the tool calls, not only the final text — that is where a prompt change usually shows up first.
5. **Keep it or roll back.** If it is worse, restore the previous prompt revision and try a different change.

## What to change, in order

Work down this list. The earlier items move results more, per unit of effort.

| Try | When the symptom is |
| --- | --- |
| Sharpen "what a good result looks like" in the prompt | The answer is right but not usable — wrong format, wrong depth, buries the point |
| Add a hard rule | It repeats a specific mistake |
| Bind a connector or skill | It guesses at something it should look up |
| Turn off a [built-in tool group](/docs/capabilities/built-in-tools/) | It reaches for a capability that is noise for this agent |
| Raise [reasoning effort](/docs/build/models/#reasoning-effort) | It skips steps in long tasks |
| Change the model | Everything above is right and it still cannot follow the task |
| Split into two agents | The prompt has grown to cover two unrelated jobs |

## Reading a run to diagnose it

Most "the agent is bad" problems are visible in the [run](/docs/work/runs/) itself.

- **It called no tools.** It thinks it should answer from memory. Usually a prompt problem, sometimes a missing binding.
- **It called the right tool with bad arguments.** It is missing context — say it in the prompt, or store it in [memory](/docs/capabilities/memory/).
- **It called tools in a loop without converging.** The task is underspecified, or the effort setting is too low for its length.
- **It asked you something it should know.** That fact belongs in the prompt or in memory.

<Aside type="tip" title="Steering is a diagnostic, not just a fix">
  If [steering](/docs/work/steering/) a run with one sentence reliably rescues it, that
  sentence belongs in the system prompt. A correction you find yourself sending
  repeatedly is a prompt bug you have not fixed yet.
</Aside>

## Limits

- There is no built-in evaluation harness or automated scoring. Comparison is by hand, against tasks you choose.
- There is no draft mode: an agent has one live configuration, and changes take effect on its next run. To try something risky without disturbing an agent you rely on, build a copy and experiment on that.
- Revision history covers the system prompt. Other settings — model, bindings, tool groups — are not versioned, so note what you changed.

## Related

<CardGrid>
  <LinkCard
    title="System prompt and revisions"
    href="/docs/build/system-prompt/"
    description="The lever you will pull most, and how to undo it."
  />
  <LinkCard
    title="Runs"
    href="/docs/work/runs/"
    description="Reading what the agent actually did, step by step."
  />
  <LinkCard
    title="Steering a run"
    href="/docs/work/steering/"
    description="Correcting a run in flight — and what that tells you."
  />
</CardGrid>
