> For the complete documentation index, see [llms.txt](https://docs.riff.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.riff.ai/guides/working-with-your-autonomous-agent.md).

# Working with your autonomous agent

Run an autonomous agent day to day: review its tasks and approvals, fix wrong decisions, change how it works, and what to do when a live change causes problems.

How to review an autonomous agent's work, fix its mistakes and change how it works. To create a new agent, see [Build your first agent](https://docs.riff.ai/get-started/quickstart-agent-v2.md).

{% hint style="info" %}
**Key points**

* You change the agent in build mode. Click **Edit agent** to open it. Nothing you do there affects the live agent until you deploy.
* A wrong decision usually means a missing rule. The agent only knows what it has been told.
* Ask it to explain itself. "Why did you do that?" and "Which rule did you use?" get direct answers.
* Make one change at a time, and test it on a few examples before the next.
  {% endhint %}

## How your agent works

Work arrives, the agent applies your rules, then either finishes the task or waits for you.

<div data-with-frame="true"><figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2FI5MFrYZ3YJpJd2XBcYrl%2Fagent-how-work-flows.png?alt=media&amp;token=bb95ce72-9375-4df9-a1f9-4757db3b95ee" alt="How work moves through an autonomous agent: new work arrives on a schedule, a task appears on the Tasks page, the agent applies your rules, then either acts on its own or waits for your approval, and the task is completed with a summary"><figcaption></figcaption></figure></div>

Most changes adjust one of two things: the rules, or which actions need approval.

## Where things are

Click **Agents** in the left sidebar and open your agent. You land on the live agent, the one your team uses. Its bar at the top has **Profile**, **Tasks**, **Activity**, **Rules**, **Chat**, **Improve agent** and **Edit agent**.

<div data-with-frame="true"><figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2FZcmpAbJjGX9unIVloubb%2Flive-agent-page.png?alt=media&amp;token=cbe2bb23-dfb2-4146-a4a7-df0edc937527" alt="The live agent page, with Tasks, Rules, Improve agent and Edit agent in the bar at the top"><figcaption></figcaption></figure></div>

| To                                    | Go to                                                          |
| ------------------------------------- | -------------------------------------------------------------- |
| Review the agent's work               | **Tasks** on the live agent                                    |
| See or edit its rules                 | **Rules** on the live agent                                    |
| Change how it works                   | **Edit agent**, then the **Chat** tab. This is the build chat. |
| Change what needs your approval       | **Edit agent**, then the **Agent** tab, then **Tools**         |
| See when it runs                      | **Edit agent**, then the **Triggers** tab                      |
| Make your changes live                | **Deploy**, top right in build mode                            |
| Use a system that isn't connected yet | Talk to your Riff contact and your IT team                     |

## Daily review

On the live agent, click **Tasks**.

<div data-with-frame="true"><figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2FqZA2QFH1wubPtxELRf5x%2Flive-tasks-page.png?alt=media&amp;token=3fa769b1-1a93-4ff3-9562-200da8d6de91" alt="The live Tasks page: work in progress, including anything waiting for you, is under Processing, and finished work is under Completed"><figcaption></figcaption></figure></div>

1. **Start with work in progress.** It includes every task waiting for you. Approvals also appear in **Inbox** in the left sidebar.
2. **Open a waiting task.** The card at the top says what the agent wants to do, why, and which rules it used.
3. **Decide.** Click **Approve** if it is right, **Reject** if it is wrong, or **Chat about it** to question or correct the agent first.
4. **Spot-check finished work.** Look at two or three completed tasks.
5. **Report problems.** **Give feedback** on a task records what was wrong. **Improve agent**, at the top of the live agent, lists changes the agent proposes for you to accept or reject.

<div data-with-frame="true"><figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2FvlcfYAuIBONFtxyqzlQI%2Ftask-waiting-for-approval.png?alt=media&amp;token=57361ef6-8930-4851-a22a-3a073e5bade9" alt="A task waiting for approval: the card says what the agent wants to do and which rules led there, with Approve, Reject and Chat about it"><figcaption></figcaption></figure></div>

Other cards you may see on a task:

* **The agent has a question**: pick an answer or click **Chat about it**.
* **The agent escalated to the builder responsible for it**: type a reply and click **Respond**, or click **Mark resolved**.
* **Needs rescue**: the agent's session failed. Open the task to retry it.

<div data-with-frame="true"><figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2FztUd6bDuPNUA4slbLvgG%2Fimprove-agent-panel.png?alt=media&amp;token=24139465-b491-47b8-b6f1-221a92661c6e" alt="The Improve agent panel, where changes the agent proposes are listed"><figcaption></figcaption></figure></div>

If the same mistake appears twice, fix the rule behind it (see Troubleshooting).

## Troubleshooting

Type the quoted prompts in the build chat: **Edit agent**, then **Chat**.

| What you see                                     | Likely cause                                                | What to do                                                                                                                                                                                                                     |
| ------------------------------------------------ | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| It made the wrong decision                       | A rule is missing, unclear, or disagrees with another       | "On task \[number] you chose \[X]; it should have been \[Y], because \[reason]. Which rule caused this? Suggest the smallest fix and wait for my go-ahead."                                                                    |
| It asks you about things it could handle         | The tool for that action is set to ask every time           | "Stop asking me about \[action] when \[conditions]. Keep asking when \[exceptions]. Show me your plan first."                                                                                                                  |
| It acted without asking when it should have      | The tool is set to **No approval needed**                   | Set the tool to **Asks you first** on Live as well as Build (see [Tool permissions and approvals](https://docs.riff.ai/reference/agent-builder/tool-permissions-and-approvals.md)). Then tell the agent why in the build chat. |
| It made up a fact, such as a name, limit or date | It filled a gap nobody told it about                        | "You do not know \[thing]. When it is missing, ask me instead of guessing."                                                                                                                                                    |
| No new tasks are appearing                       | The schedule is off, failing, or looking in the wrong place | Check **Needs attention** on the **Triggers** tab. Then ask: "Where do you look for new work, and when did you last find any?"                                                                                                 |
| Its explanations are hard to follow              | It is using technical terms                                 | "Explain that again in plain words, as if to a new colleague."                                                                                                                                                                 |
| It does work outside its job                     | Its instructions are too broad                              | "\[Thing] is outside your job. Say so on the task and hand it back."                                                                                                                                                           |

If no row fits, ask: "Here is what I noticed on task \[number]. What do you think went wrong?"

## Making a change

Every change follows the same six steps.

1. **Open a new chat in build mode.** Click **Edit agent**, then **Chat**, then **New chat** (the **+** next to **Chats** and **Tasks**).
2. **Ask what it does today.** "Explain how you handle \[one kind of task] today, step by step. Do not change anything."
3. **Say what should change, and why.** Describe the result you want, not how to build it. "From now on, \[new behaviour], because \[reason]. List what you will change and wait for my go-ahead."
4. **Check the plan, then approve it.** Correcting a plan is quicker than fixing a change.
5. **Test it** on three to five examples you know well. "For each of these, tell me what you would do, whether you would ask me, and why." If one is wrong, repeat step 3 for that example only.
6. **Deploy.** When every answer matches, follow [Deploy an agent](https://docs.riff.ai/reference/agent-builder/deploy-an-agent.md).

<div data-with-frame="true"><figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2F2IGPqGBpg09ahRsKy21X%2Fbuild-chat.png?alt=media&amp;token=e15088f8-898a-44e7-b825-e1c15f292eec" alt="The build chat: type at the bottom, the tabs along the top open the other build mode pages, and Deploy is top right"><figcaption></figcaption></figure></div>

<div data-with-frame="true"><figure><img src="https://4203676568-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmj3x7kCuQ8vAs0u0uIPo%2Fuploads%2F1XDU3dqYezfmRYxPVPHl%2Fbuild-new-chat-button.png?alt=media&amp;token=81fda6f7-fa08-4571-8fb3-159348b2b6d7" alt="Top left of build mode: the + next to Chats and Tasks starts a new chat"><figcaption></figcaption></figure></div>

For a small fix to one rule, skip the chat and edit the rule directly: see [Rules](https://docs.riff.ai/reference/agent-builder/rules.md).

## If a live change causes problems

1. **Stop the action, not the whole agent.** In build mode, open the **Agent** tab, switch to **Live**, open the tool involved and set it to **Asks you first**. This takes effect straight away. Or switch off the schedule on the **Triggers** tab so no new work arrives.
2. **Write down what happened**: the task number, what the agent did and what you expected.
3. **Fix it in build mode.** Follow the steps in Making a change, then deploy.

Stuck, or the agent's answers don't match what you see? Send your notes from step 2 to your Riff contact.

## Related

* [Prompts to copy](https://docs.riff.ai/reference/agent-builder/prompts-to-copy.md)
* [The live agent](https://docs.riff.ai/reference/agent-builder/the-live-agent.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.riff.ai/guides/working-with-your-autonomous-agent.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
