# Build an agent

> Create a saved agent in chat or by hand, turn it on, and run its first task.

Source: https://docs.tulipfarm.ai/guides/build-an-agent/

This guide shows you how to create an [agent](https://docs.tulipfarm.ai/concepts/agents-skills-and-workflows/), turn it on, and give it its first task.

## Before you start

- Saving an agent does not turn it on. Read [Saved, activated, and running](https://docs.tulipfarm.ai/concepts/saved-activated-running/) to learn the difference.
- Each task uses workspace [credits](https://docs.tulipfarm.ai/concepts/credits/).

## Create the agent

**In chat**

1. Select **Agents** in the sidebar.

2. Select **Create in chat**.

3. Describe the job of the agent in the chat.

4. Read the agent draft that the chat shows.

   To change the draft by hand, select **Edit in builder**.

5. Select **Create and activate** to save the agent and turn it on.

   To save the agent without turning it on, select **Save draft**.

> **Note:** A message in the chat is not an approval. Only the buttons on the draft save or activate the agent.

**By hand**

1. Select **Agents** in the sidebar.

2. Select **Configure manually**.

3. On **Basics**, enter the **Agent name**.

4. In **Instructions**, describe the role, tone, and tasks of the agent. Also say when it must ask a person.

5. On **Skills**, choose the [skills](https://docs.tulipfarm.ai/guides/create-skills/) that the agent follows.

   You can choose up to 16 enabled skills.

6. On **Access**, choose who can use the agent.

7. On **Triggers**, choose how the agent starts.

8. On **Review**, check the setup.

9. Select **Create and activate** to save the agent and turn it on.

   To save the agent without turning it on, select **Save draft**.

To try the agent before you save it, use the **Test chat** tab in the preview. Test chat cannot take actions.

The agent uses the **Workspace default** model unless you choose a model family for it.

## Turn on a saved draft

Do these steps if you selected **Save draft**. Only an agent manager can do them. An agent manager is a person with the Manage permission on the agent.

1. Select **Agents** in the sidebar.

2. Open the agent.

3. Open the **Execution** tab.

4. Turn on **Enable execution**.

5. Select **Save execution settings**.

6. Select **Activate saved instructions**.

Later edits to the agent stay inactive until a manager activates them.

## Share the agent

People need the Invoke permission to start tasks with an agent.

1. Open the agent.

2. Open the **Access** tab.

3. Add the people or teams that can use the agent.

4. Select **Save sharing**.

| Permission | What it allows |
| --- | --- |
| Read | See the agent. |
| Invoke | Start tasks with the agent. |
| Edit | Change the instructions of the agent. |
| Manage | Change access, execution, and activation. |

## Run the first task

1. Select **Agents** in the sidebar.

2. Open the agent.

3. Under **Run agent now**, type the work in **Task message**.

4. Select **Start task**.

The task opens in **My agent tasks**. The agent works in steps and asks before it changes rows.

If the agent cannot start, read its setup checklist on the agent page. The checklist shows the next step and who must take it.

## Agent status

| Status | What it means |
| --- | --- |
| **Not activated** | The agent is saved but not turned on. |
| **Run permission required** | You need the Invoke permission from an agent manager. |
| **Activated** | The agent is on and ready to run tasks. |

## Next steps

- [Schedule an agent](https://docs.tulipfarm.ai/guides/schedule-an-agent/)
- [Review agent tasks](https://docs.tulipfarm.ai/guides/review-agent-tasks/)
- [An agent cannot start](https://docs.tulipfarm.ai/troubleshooting/agent-cannot-start/)
