> ## Documentation Index
> Fetch the complete documentation index at: https://docs.duvo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Refining Your Agent

> Iterate on your agent across multiple runs to align it with your exact business process.

**Don't expect perfection on the first try.** Just like training a new employee, your agent needs guidance and refinement to learn your specific process. Multiple runs are normal and expected when developing an agent.

***

## How to refine

<Steps>
  <Step title="Run your agent" icon="play">
    Run your agent.
  </Step>

  <Step title="Observe the steps" icon="eye">
    Observe the steps it takes to accomplish the task.
  </Step>

  <Step title="Note what to adjust" icon="pen">
    Note what works and what needs adjustment.
  </Step>

  <Step title="Describe changes" icon="wand-sparkles">
    Use the Agent Builder again to describe changes, or edit the AOP directly.
  </Step>

  <Step title="Test and repeat" icon="rotate-cw">
    Test and continue refining.
  </Step>
</Steps>

```mermaid theme={"dark"}
flowchart LR
    A[Run your agent] --> B[Observe the steps]
    B --> C[Note what to adjust]
    C --> D[Describe changes or edit the AOP]
    D --> E[Test and continue refining]
    E --> A
```

***

## Common refinements

* **Adjusting edge case handling**
  * What happens when expected data is missing?
  * How should the agent handle unexpected formats or values?

* **Clarifying which data fields to use**
  * Which specific column or field contains the information?
  * What should the agent do if multiple fields could match?

* **Handling data variations**:
  * Different date formats
  * Varying currency symbols
  * Alternative naming conventions

* **Adding more approval checkpoints**
  * Where do you want to review before the agent proceeds?
  * What threshold requires your input?

***

## Conclusion

Each run is a training session that helps align your agent with your exact process. Use human-in-the-loop (HITL) approval points as strategic checkpoints to review the agent's progress and identify where the AOP needs refinement. When making changes, focus on one modification per run—this makes it easy to understand the impact of each change and isolate what works. Refinement isn't a sign of failure; it's how you develop an agent that truly understands your unique business process.

***

## Things to know

<Note>
  The Agent Builder is looking at the current run that happened and is visible in the interface.
</Note>

***

## Related

<CardGroup cols={2}>
  <Card title="Test Safely Before Going Live" href="/user-guide/getting-started/test-safely">
    Test plan template, mocking patterns, and environment separation before enabling autonomous Runs
  </Card>

  <Card title="Guardrails for High-Risk Automations" href="/user-guide/security/high-risk-guardrails">
    How to classify risk and apply the right guardrails before an agent runs autonomously
  </Card>

  <Card title="Designing Human-in-the-Loop Workflows" href="/user-guide/assignment-features/hitl-design">
    Using approval gates as checkpoints during refinement
  </Card>
</CardGroup>
