---
schema_version: "1"
id: c75a8ac3a97131bb93f8b3e0db89f7773ab03b926cc828261f6aaaee6085f07a
title: How Agents Work
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_builder_reasoning_engine.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_builder_reasoning_engine.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 7a3f879cd37a5f906d685284b77d6fc488bbbe90a1393e552536ad88b05c57d2
description: Follow the path of a user message through the Atlas reasoning engine to learn how Agentforce agents reason, take action, and generate responses.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# How Agents Work

Follow the path of a user message through the Atlas reasoning engine to learn how Agentforce agents reason, take action, and generate responses.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions. <a href="https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&amp;release=264.0.0&amp;type=5" title="Learn about agent types and default templates for specific clouds and common use cases.">Required add-on licenses vary by agent type.</a></td></tr></tbody></table>

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/images/icon_note.png)

Note Beginning in April 2026, agent topics are now called subagents. There are no changes to functionality. During this transition, you may see a mix of the new and previous terms in our documentation.

The Atlas reasoning engine is a graph-based reasoning engine. You can think of it like a flowchart with nodes, variables, and transitions, so agents follow specific, predictable paths. Unlike strictly prompt-based reasoning engines, Atlas separates an agent’s big-picture workflow from its conversational skills. It uses Agent Script, the language for building agents in Agentforce Builder, to combine programmatic expressions with natural language instructions. The result is hybrid reasoning, which gives you the predictability and control that enterprise demands and the flexibility and creativity that large language models (LLMs) make possible.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/images/icon_note.png)

Note The number and size of LLM calls in an agent conversation depends on the complexity of the task and which subagents and actions are used. [Learn more about large language model support for Agentforce.](https://help.salesforce.com/s/articleView?id=ai.copilot_considerations.htm&release=264.0.0&type=5 "Carefully review the support, limits, and considerations for AI agents.")

## Step 1: A user sends a message

The process begins when a user enters a question or request.

## Step 2: The agent goes to a starting subagent

The agent moves to the subagent defined as the starting subagent. In Agent Script, this is whatever subagent uses the \`start\_agent\` prefix instead of the \`subagent\` prefix. By default, this is the [Agent Router](https://help.salesforce.com/s/articleView?id=ai.agent_topics_routing.htm&release=264.0.0&type=5 "Learn more about the Agent Router and how to customize it to control how your agent selects subagents in a conversation."), which guides the agent to select a subagent based on the recent conversation history and the subagents available to the agent.

## Step 3: The agent resolves the subagent instructions from top to bottom

After the agent moves to a subagent, it begins [resolving the subagent’s reasoning instructions](https://help.salesforce.com/s/articleView?id=ai.agent_topics_instructions_resolve.htm&release=264.0.0&type=5 "Learn about how an agent executes programmatic expressions in a subagent’s reasoning instructions to prepare for reasoning.") deterministically, in the order that they’re written. At this stage in the subagent’s execution, no reasoning takes place, so the agent doesn’t rely on an LLM yet.

If at any point in the reasoning instructions the agent executes a transition to another subagent, the agent redirects the conversation before the instructions are resolved and any reasoning occurs. Otherwise, when all reasoning instructions have been resolved, the resulting reasoning instructions, including any natural language instructions, are used to build a prompt.

## Step 4: The agent builds a prompt

The agent uses the reasoning instructions to build a prompt to send to the LLM and kick off the reasoning process. The prompt includes:

- Agent-level instructions, which apply to every agent interaction
- The recent conversation history, including the user’s most recent message
- The resolved subagent reasoning instructions
- [Reasoning actions](https://help.salesforce.com/s/articleView?id=ai.agent_topics.htm&release=264.0.0&type=5 "A subagent is a job an agent can do. Learn about the parts of a subagent and how to use them to define an agent’s logic, reasoning, and conversational capabilities.") included in the subagent, which are the actions (including agent actions) an agent is allowed to take during its reasoning process

## Step 5: The agent sends the prompt to the LLM to begin reasoning and take action

The agent uses the LLM to analyze the available information in the prompt and determine its next steps.

- Run an agent action or utility, based on the logic defined for the action or utility and any descriptions, inputs, and outputs
- Ask the user for more information
- Ask the user clarifying questions to disambiguate between available options
- Respond directly to the user’s question or request, if the user’s question or request can be resolved with information the agent already has access to

When the agent runs an action, it checks the result in a reasoning loop to make sure it has the right information before responding to the user. The agent adds the action output to the information it already has about the conversation. Then it decides whether to run another action, ask the user more questions, or send a final response. This process continues up to seven reasoning loops.

## Step 6: The agent performs a final response validation (Agentforce Service agents only)

Before an Agentforce Service agent sends a response, it checks whether the response is grounded in data sources, adheres to the subagent’s scope and instructions, and doesn’t include hallucinations, unverified information, or potential prompt injection risks. If the proposed response fails this validation, the agent generates a new response.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/images/icon_note.png)

Note Agents stream LLM responses in conversations as the responses are received. The response validation is applied to the final agent response. If a proposed response fails this validation after the response has started streaming, the response is deleted and a new response is generated.

If the agent can’t generate a response that passes validation, it informs the user that it can’t help with their question or request.

## Step 7: The agent sends a response to the user

After the agent completes the reasoning loop, it sends a message to the user. The user can continue the conversation by asking a follow-up question or changing the subject, and the agent responds appropriately. Behind the scenes, the user’s response restarts the journey, but to the user, it feels like they’re taking turns in a conversation.