# Test an agent (/docs/agents/agent-test-run)

A test run plays a customer message through the agent with its current settings: its knowledge, guardrails and autonomy level. You see the draft it would write, what would happen to it, the sources it cites and every rule it checked. Nothing is sent and no records change.

- **Who can use it:** Owners, admins and members, or anyone whose role can test agents. Viewers can't: **Test run** isn't in their menus. See [Roles and permissions](/docs/settings/roles).
- **Before you start:** Nothing. To test a single flow step by step instead, see [Test, publish and version a flow](/docs/agents/flow-test-run).

## Run a test [#run-a-test]

<Steps>
<Step>

### Open Test run [#open-test-run]

Open the test in any of these ways:

- On the agent's page, click **⋯** (**More actions**), then **Test run**, or press <kbd>T</kbd>.
- On the [Agents page](/docs/agents/agents), click **⋯** on the agent's card or row, then **Test run**.

A dialog named after the agent opens, for example **Test Closer Agent**.

![The Test Closer Agent dialog with sample buttons, the Customer message field, Arrives on WhatsApp, and Close and Run](/screenshots/agent-test-run/01-test-dialog.webp)

</Step>
<Step>

### Pick a sample or write a message [#pick-a-sample-or-write-a-message]

Under **Try a sample**, click a ready-made message, such as **Asks for 20% off** or **Wants a person**. A sample runs straight away. The samples depend on what the agent does.

Or type your own in **Customer message**, the way a customer would write it, and choose the channel it **Arrives on** (only the agent's channels are listed).

</Step>
<Step>

### Run it [#run-it]

Click **Run**, or press <kbd>⌘</kbd> <kbd>Enter</kbd> (<kbd>Ctrl</kbd> <kbd>Enter</kbd> on Windows and Linux) in the message field. While it runs, the dialog says "Running Closer Agent on this message".

</Step>
<Step>

### Read the result [#read-the-result]

The result shows the customer's message, the agent's draft, how long it took to draft and how confident it was. Under the draft:

- **The outcome:** what would happen to this draft, for example "Held for approval: Price within approved band".
- **Sources:** which knowledge sources it cited, or "No sources cited". Every result ends with "Nothing was sent."
- **Rules checked:** each guardrail with its result and why.

![A held result: the draft offers 20% off for $67,200, the outcome Held for approval: Price within approved band, and Rules checked with Price within approved band failed](/screenshots/agent-test-run/02-held-result.webp)

</Step>
<Step>

### Try again [#try-again]

Change the message or channel, or pick another sample, and click **Run again**. The dialog remembers your last message and result for each agent while you work, so you can close it and come back. Click **Close** when you're done.

</Step>
</Steps>

## Understand the outcome [#understand-the-outcome]

The outcome depends on the message, the rules and the agent's autonomy level:

| Outcome | What it means |
| --- | --- |
| **Would send on its own: every check passed** | At the Autonomous level, this reply would go out without a person. |
| **Ready, waits for your approval** | At the Approval level, every check passed and the reply waits for approval. |
| **Drafted in shadow: nothing sends** | The agent is in shadow, so it only drafts. A note says what would happen out of shadow. |
| **Held for approval:** rule | A rule held the draft for a person to approve or edit. |
| **Handed to the deal owner:** reason | A rule, or the customer asking for a person, handed the conversation to a person. |
| **Blocked by a hard limit:** rule | Nothing sends at any level. The run is logged. |
| **Revised twice, then held for approval** | A rule set to revise rewrote the draft twice without passing, so it was held. |
| **Routed to Closer Agent** | A routing agent sent the conversation on to another agent. |

Some results add a note, such as "Revised once: 20% became 15% to pass the rule." or "Sends with a warning".

![A handed-off result: Of course, I've asked the person who owns your account to pick this up, with every rule Not checked: a person takes over](/screenshots/agent-test-run/03-handoff-result.webp)

![A passing result: a 10% offer for $75,600, the outcome Would send on its own: every check passed, and every rule passed](/screenshots/agent-test-run/04-would-send.webp)

A routing agent such as Triage Agent doesn't draft a customer reply. Its result says where it would send the conversation:

![A Triage Agent result: Pricing question from a 40-person sales team, Routed to Closer Agent, with its two rules passed](/screenshots/agent-test-run/05-routed.webp)

## Read the rules checked [#read-the-rules-checked]

Each rule in **Rules checked** shows one of these results, with the detail underneath (for example "The quoted price is $67,200; needs at least $71,400"):

| Result | Meaning |
| --- | --- |
| **Passed** | The draft met the rule. |
| **Failed** | The draft broke the rule, which decides the outcome. |
| **Warned** | The draft broke a warn-only rule: it would still send, and the run is flagged. |
| **Skipped** | The rule didn't apply, for example "Only checks WhatsApp conversations", or "Not checked: a person takes over". |
| **Off** | The rule is turned off, so it wasn't checked. |

To change a rule, see [Guardrails and rules](/docs/agents/agent-guardrails).

## Troubleshooting [#troubleshooting]

<Accordions type="single">
<Accordion title="The test run didn't finish">
The test couldn't run, for example because you're offline. Click **Try again** in the dialog.
</Accordion>
<Accordion title="There's no Test run in the menu">
Your role can't test agents. Ask an owner or admin. See [Roles and permissions](/docs/settings/roles).
</Accordion>
<Accordion title="Run is greyed out">
The message is empty. Write a message, or pick a sample.
</Accordion>
</Accordions>

## Next steps [#next-steps]

<Cards>
<Card title="Guardrails and rules" href="/docs/agents/agent-guardrails" description="Change what's held, handed off or blocked." />
<Card title="Knowledge sources" href="/docs/agents/agent-knowledge" description="Give the agent better sources to cite." />
<Card title="Test, publish and version a flow" href="/docs/agents/flow-test-run" description="Trace a single flow step by step." />
</Cards>
