> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-release-1-16-0.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# New Agent

> Build an agent once, then put it to work as a standalone app or inside a workflow

<Warning>
  **Data Security Notice**

  Community Edition uses file-access controls to limit access to agent and session files when the same agent is exposed to multiple end users. These controls reduce the risk of cross-conversation data access through the filesystem, but the Agent runtime is not intended to provide a hardened security boundary between mutually untrusted users or workloads.

  If your deployment requires strong isolation or strict security or compliance controls, use separately hardened infrastructure or contact Dify to assess an appropriate Cloud or Enterprise option. For Dify Enterprise, [contact sales](https://share-na2.hsforms.com/14-09ff5HS92Sh4m3f4yrcw40s9fk) to learn more.
</Warning>

<Tip>
  The new Agent is in beta. It's on by default on Docker Compose, with its runtime bundled in.

  For production, replace [`DIFY_AGENT_SERVER_SECRET_KEY`](/en/self-host/deploy/configuration/environments#dify_agent_server_secret_key) with your own random value.
</Tip>

An *Agent* is an AI worker you set up once and then put to work. It's a different kind of agent than the [classic Agent app](/en/self-host/use-dify/build/agent):

* It works in a **sandbox of its own**: it runs commands, installs programs, and reads and writes files, so it takes on open-ended work rather than just calling the tools you configured.

* You [build](/en/self-host/use-dify/build/new-agent/build) it **once** and use it **two ways**: on its own as a chat app, or as [a step](/en/self-host/use-dify/nodes/agent#new-agent) inside a workflow.

Create, configure, and manage your agents on the **Agents** page. Open one anytime to refine it or revisit an earlier version.

## Capability and Task

An Agent separates what it *is* from what you ask it to *do*:

* **Its *capability* (think of it as the agent's soul) is who the agent is.**

  The role and prompt you write, the model it runs on, and the knowledge, skills, Dify tools, and files you give it. You shape it once and keep refining it as you learn what the agent needs.

* **Its *task* is what you ask it to do on a given run.**

  When the agent works on its own, the task is the message you send it. When it works inside a workflow, the task is the instruction you give the node.

It's the same split as hiring someone: you choose a person for what they can do, then give them a specific task. Strong results need both: the right person for the job and a clear brief.

## Two Ways to Use an Agent

### On Its Own

The agent runs as its own chat app. You give it tasks by chatting, and you can publish it as a web app or call it through the service API.

Each conversation has its own memory: how much the agent keeps in mind depends on the model's context window, and a new conversation starts fresh.

Choose this when a single capable worker can reach the goal on its own: a support assistant that looks things up and answers, or a research agent that gathers sources and summarizes them.

### Inside a Workflow

You invite the agent into an [Agent node](/en/self-host/use-dify/nodes/agent#new-agent) to handle one step of a larger process. There you set only the task you want done. It's like asking a colleague to take care of one thing: you describe the task, and they bring their own skills to it.

Choose this when the work needs structure around it: several steps in a set order, branching on conditions, other kinds of nodes, or a few specialized agents handing off to each other.
