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

# Set up an agent

> Create an agent, describe its job, add steps and tools, and choose when it should run.

An agent is easiest to build when you start with one clear business process.

For example: "Review incoming invoices, extract the key fields, check the vendor, and ask for approval if the total is above \$10,000."

## Create the agent

<Steps>
  <Step title="Open Agents">
    Go to **Agents** from the sidebar.
  </Step>

  <Step title="Select Create Agent">
    Choose **Create Agent**. Nanonets creates a new agent and opens the setup screen.
  </Step>

  <Step title="Name the agent">
    Enter a short name that describes the work, such as **Invoice Processing Agent**.
  </Step>
</Steps>

<Frame caption="The Agents page lists your agents. Click Create Agent to set up a new one.">
  <img src="https://mintcdn.com/nanonets-fb7e8f2a/eksLpltcNl29FEi2/images/agents-page.png?fit=max&auto=format&n=eksLpltcNl29FEi2&q=85&s=776702dc3343276fc1c7cb9846006768" alt="Agents page showing the Create Agent card alongside existing agents" width="1440" height="1000" data-path="images/agents-page.png" />
</Frame>

## The Configure screen

The Configure screen shows the parts of your agent on the left: **Role and Behaviour** and your **Steps**, with **Tools** and **Run when** below. Select any item to edit its details on the right.

## Add role and behaviour

**Role and Behaviour** describes who the agent is and the core process it follows: the job itself. Keep it focused on that; preferences, guardrails, and exceptions are better added as [rules](/docs/guide/rules).

Write it like you are explaining the job to a new teammate.

Good examples:

* "You are an accounts payable assistant who reviews vendor invoices."
* "Read each invoice carefully and extract the fields the finance team needs."
* "If something looks wrong or a field is missing, flag it instead of guessing."

<Frame caption="Role and Behaviour: the agent's role and the core process it follows on every task.">
  <img src="https://mintcdn.com/nanonets-fb7e8f2a/eksLpltcNl29FEi2/images/role-and-behaviour.png?fit=max&auto=format&n=eksLpltcNl29FEi2&q=85&s=448d971c26282685602ed7b5546f20cf" alt="Role and Behaviour editor with a sample accounts-payable role" width="1440" height="1000" data-path="images/role-and-behaviour.png" />
</Frame>

## Add steps

Steps break the work into smaller parts. This helps the agent follow the same process each time.

For an invoice agent, steps might be:

1. Read the invoice.
2. Extract invoice data.
3. Look up the vendor.
4. Ask for approval if needed.
5. Send the result to a spreadsheet.

<Frame caption="Each step has its own instructions and the tools it's allowed to use, shown as labels (here, Data Extraction).">
  <img src="https://mintcdn.com/nanonets-fb7e8f2a/eksLpltcNl29FEi2/images/step-editor.png?fit=max&auto=format&n=eksLpltcNl29FEi2&q=85&s=bf2acc89c96be9040d631aed0c9c20b8" alt="A selected step showing its instructions and an enabled Data Extraction tool label" width="1440" height="1000" data-path="images/step-editor.png" />
</Frame>

## Add tools

Tools are actions the agent can take.

For example, an agent can extract data from a PDF, look up a row in Google Sheets, create a file, send a Slack message, or ask a person a question.

Only add tools the agent needs for this job. More tools are not always better.

<Frame caption="The Tools panel: search, browse by category, and toggle on the tools this agent needs.">
  <img src="https://mintcdn.com/nanonets-fb7e8f2a/eksLpltcNl29FEi2/images/tools-panel.png?fit=max&auto=format&n=eksLpltcNl29FEi2&q=85&s=2b2db72289de452f7906fc396cb39154" alt="Tools panel showing tools grouped by category with enable toggles" width="1440" height="1000" data-path="images/tools-panel.png" />
</Frame>

### Reference a tool in a step

You can also point to a tool directly inside a step's instructions. Type **`@`** to bring up the tool menu, then pick the tool, and it's inserted as a label. This tells the agent exactly which tool to use at that point in the work.

<Frame caption="Type @ in a step's instructions to open the tool menu and insert a tool reference.">
  <img src="https://mintcdn.com/nanonets-fb7e8f2a/eksLpltcNl29FEi2/images/tool-mention.png?fit=max&auto=format&n=eksLpltcNl29FEi2&q=85&s=59e9c26bf5018ccdfed42cd2ac74ec07" alt="A step's instructions showing the @ tool menu with selectable tools" width="760" height="340" data-path="images/tool-mention.png" />
</Frame>

## Choose when it should run

Open **Run when...** to start the agent automatically.

Common options include:

* When an email arrives.
* On a schedule.
* When another connected app sends an event.
* When a user starts a task by hand.

<Frame caption="Run when…: start the agent automatically, for example when an email arrives at its dedicated inbox address.">
  <img src="https://mintcdn.com/nanonets-fb7e8f2a/eksLpltcNl29FEi2/images/run-when.png?fit=max&auto=format&n=eksLpltcNl29FEi2&q=85&s=d1ae67d9a5f5a09306fb30a698e806e8" alt="Run when panel showing an inbound email trigger with an enable toggle and Add button" width="1440" height="1000" data-path="images/run-when.png" />
</Frame>

## Write clear instructions

You guide an agent in three places: **Role and Behaviour** (how it should act on every task), **Steps** (the order of work), and **Rules** (the specifics it learns over time, covered in [Rules](/docs/guide/rules)). You don't need technical prompts. For Role and Behaviour and Steps, write plain business directions, the way you'd brief a new teammate.

A simple pattern:

<Steps>
  <Step title="Say what the agent should do">
    Example: "Extract the invoice number, vendor name, invoice date, due date, line items, and total."
  </Step>

  <Step title="Say what matters most">
    Example: "Do not guess missing values. Mark them as missing."
  </Step>

  <Step title="Say when to ask for help">
    Example: "Ask the user if the total does not match the line items."
  </Step>

  <Step title="Say where the result should go">
    Example: "Add one row per invoice to the Invoice Review spreadsheet."
  </Step>
</Steps>

Keep instructions concrete:

| Avoid                         | Better                                                                                  |
| ----------------------------- | --------------------------------------------------------------------------------------- |
| "Process invoices correctly." | "Extract invoice number, vendor, date, total, and line items. Flag missing PO numbers." |
| "Check everything."           | "Check that the invoice total matches the sum of line items."                           |
| "Be careful."                 | "Ask for approval before sending any email outside the company."                        |

## What goes in the prompt vs a rule

**Role and Behaviour and Steps** describe the agent's job: who it is and the core process it follows. Keep them focused on that.

Everything you add on top (preferences, corrections, guardrails, exceptions) is a **rule**. A rule is either:

* **Global**: applies to every task. Best for always-on guardrails, like "Ask for approval before any payment above \$10,000." Leave it unscoped so it applies everywhere.
* **Scoped**: applies only to a specific vendor, customer, or document type, using tag groups. Best for things like "For Northwind Traders invoices, the date is DD/MM/YYYY."

| Role and Behaviour / Steps                            | A rule (global or scoped)                                          |
| ----------------------------------------------------- | ------------------------------------------------------------------ |
| Who the agent is and how it works                     | A preference or guardrail you want enforced                        |
| The core process and the order of work                | An always-on rule (global) or a context-specific one (scoped)      |
| "Read invoices and extract the key fields, in order." | "Ask for approval before any payment above \$10,000." (global)     |
| "Check the vendor and the total before approving."    | "For Northwind Traders invoices, the date is DD/MM/YYYY." (scoped) |

The test: **Role and Behaviour and Steps explain the task itself. Anything you'd refine or add over time is a rule, so keep it global if it always applies, or scope it to a tag group if it only applies sometimes.**

<Tip>
  Don't try to write every exception into Role and Behaviour up front. A short, focused prompt plus a growing set of rules is easier to read, review, and improve.
</Tip>

Scoped rules use tag groups. See [Tag groups](/docs/guide/tag-groups) for those, and [Rules](/docs/guide/rules) for how rules are created and approved.

## Keep the first version simple

Your first agent does not need to handle every edge case.

Start with the normal path. Run a few tasks. Then add rules for exceptions, corrections, and special cases.

<Tip>
  If the process has many decisions, write each decision as a separate step. This makes the agent easier to review and improve.
</Tip>

## Publish changes safely

Agent edits are saved to a draft first. When the draft is ready, publish it as a numbered version and choose when that version should run live tasks.

Learn more in [Agent version control](/docs/guide/agent-version-control).
