# Debug an Agent

> Turn on Debug Agent and follow one Agent's prompts, reasoning and tool calls live, to see why it did what it did.

Source: https://air.build/docs/agents/debug-an-agent/

> [!NOTE]
> **Debug Agent** is an experimental feature, off by default. It's in the app on iPhone, iPad and Mac. The switch applies to the device you turn it on on. Only the Team's owner can see an Agent's debug timeline.

**Debug — _Agent's name_** is a live timeline of everything one Agent does: the prompts sent to its model, its reasoning and replies as they're written, and every tool call with its input and output. Use it when an Agent does something you don't understand and its chat doesn't tell you why.

To follow an Agent's work in a lighter way from a chat, see [Watch what an Agent is doing](https://air.build/docs/agents/watch-agents-work/).

## Turn on Debug Agent

1. Open **Settings**, then **About**, then **Experimental Features**.
2. Turn on **Experimental Features** at the top, and tap **Turn On** to confirm. See [Experimental Features](https://air.build/docs/settings/experimental/).
3. Turn on **Debug Agent**: "Adds Debug Agent to each Agent's menu and profile, showing its prompts, reasoning and tool calls live."

Turn either switch off to hide **Debug Agent** again.

## Open the timeline

Choose **Debug Agent** from any of these:

**iPhone**

- The Agent's menu: touch and hold the Agent in the list of chats.
- The **⋯** at the top of your chat with the Agent.
- The Agent's profile, in the row of buttons under its name.

**Mac**

- The Agent's menu: Control-click the Agent in the sidebar.
- The Agent's profile, in the row of buttons under its name.

The sheet **Debug — _Agent's name_** opens. It first shows the Agent's recent work, then adds new events at the bottom as they happen, and stays at the bottom unless you scroll up. Tap **Done** to close it. Closing it doesn't affect the Agent.

If the Agent hasn't done anything lately, the sheet says **Waiting for Events**: "Events appear when the agent works. Send it a message to see the stream."

## The status

Next to the title, a dot and a word say whether the timeline is live:

| Status | Meaning |
| --- | --- |
| **Live** | Connected. New events appear as they happen. |
| **Connecting** | Connecting to the Agent. |
| **Starting Environment** | The place your Agents run is starting up. The sheet tries again every few seconds. |
| **Reconnecting** | The connection dropped. The sheet tries again every few seconds and picks up where it left off. |
| **Stream Unavailable** | The timeline can't be shown, and the sheet stops trying. See [Questions](https://air.build/docs/agents/debug-an-agent/#questions). |

## What the timeline shows

Each row has a time. A line with **Run Started** or **Run Ended** marks where the Agent starts and finishes a piece of work.

| Row | What it is |
| --- | --- |
| **LLM Request** | What was sent to the Agent's model for one step, including the Agent's prompts. Tap the row to show it. |
| **Reasoning** | The Agent's thinking, as it's written. Long reasoning folds to four lines: tap **Show More**. |
| **Output** | What the Agent wrote, as it's written. |
| A tool's name | One tool call: the tool, what the call is for, and how long it took. Its mark shows **Running**, **Done** or **Failed** (a cross). Tap the row to see its **Input** and **Output**. |
| **LLM Response**, **LLM Stream Ended** | The model's answer to a step finished. Tap to see the details. |
| **Model Stream Error**, **Model Stream Retrying** | The model's answer failed, or failed and is being tried again. |
| **Live Output Rewound** | The answer was started over, so the text shown before it is replaced by what follows. |
| **Events Dropped** | Some events didn't reach the timeline. The rows around it may be missing steps. |

You can select text in the rows to copy it.

> [!WARNING]
> The timeline shows the instructions and prompts the Agent works from and everything it reads, including what other people in the Team said to it in their own chats with it and in groups. Be careful when you share a screenshot or copied text from it.

## Questions

**I don't see Debug Agent in the menu**

Check that both **Experimental Features** and **Debug Agent** are on, on this device. The switches don't carry over to your other devices.

**The status says Stream Unavailable**

The timeline can't be shown for this Agent. Only the Team's owner can see it, so in a Team someone else owns it's always unavailable. For a Team that runs on your Mac, it's also unavailable while that Mac is offline. Close the sheet and open it again once the Mac is back.

**The sheet is empty**

The Agent hasn't worked lately. Send it a message and keep the sheet open.

**Does closing the timeline stop the Agent?**

No. The sheet only shows what the Agent does. The Agent carries on whether the sheet is open or not.
