---
schema_version: "1"
id: b9ee7c98b7fc4830682f16171d2cc5f039eb489fa2e4568e5b33cdd010534252
title: Test Your Agent in Agentforce Builder
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_test_in_builder.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_test_in_builder.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: fa3dc4b07bf4d9f90cddf737bdb6853e29faa31ac8c3affd62afb990ca701669
description: Manually testing your agent in Agentforce Builder provides a detailed, step-by-step trace of your agent's interactions and processes. Use the Preview panel to chat with your agent, then review subagent selection, action execution, and reasoning on the Interaction Summary panel. For more details about any step, converse with the Agentforce Assistant.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Test Your Agent in Agentforce Builder

Manually testing your agent in Agentforce Builder provides a detailed, step-by-step trace of your agent's interactions and processes. Use the Preview panel to chat with your agent, then review subagent selection, action execution, and reasoning on the Interaction Summary panel. For more details about any step, converse with the Agentforce Assistant.

### 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>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d107727e80">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d107727e80 ">To test agents in Agentforce Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d107727e80 ">Manage AI Agents AND <a href="https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&amp;type=5&amp;language=en_US" target="_blank">the required permissions for your agent
                type</a></td>

          </tr>
        </tbody>
      </table>

1. From the Agents page in the Agentforce Studio app, open your agent in Agentforce Builder.
2. Click **Preview**.
3. Select your [test mode](https://help.salesforce.com/s/articleView?id=ai.agent_simulate_and_live_modes.htm&release=264.0.0&type=5 "Agentforce Builder includes two different modes to test your agent: Simulate and Live Test. Simulate mode helps you verify that your agent has the right configuration without risking any changes to your actual data or org. Live Test mode actually runs the actions and changes your org so you can see how the agent performs when it’s active.").
4. In the Context Variables tab, set or override the value of variables used in your agent to match the user’s actual context, such as their verification status or language. Setting initial values ensures that your agent’s preview behavior accurately reflects your user’s context.
    
    A warning icon on the Context Variables tab or an individual variable field indicates that your agent uses a linked variable that’s set for you in production, but isn’t set in preview. For example, a value that’s filled from the Messaging Session object when your agent is live on a Messaging channel. You don’t have to set a value for any variables to preview your agent, but consider how your agent uses each variable and whether you can accurately test without it.
    
    ![The preview panel with the Context Variables tab open, showing empty values for variables included in the agent](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/generative_ai/images/agent_test_set_context.png)
    
    ![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 If you change the value of a variable during a preview conversation, restart the conversation to apply your changes.
5. To start a preview conversatoin, in the chat window, enter a typical user question or request.
6. To review the agent’s behavior and reasoning, start with the Interaction Summary in the Summary tab.
    
    ![A split-page showing a chat simulation on the left and the Interaction Summary on the right that outlines the AI's step-by-step reasoning and subagent transitions.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/generative_ai/images/agent_interaction_summary.png)
    
    The Interaction Summary shows you a high-level overview of the steps your agent took to generate a response, including the result of each. Hover over each step for more details. The Interaction Summary also includes an AI-generated natural language explanation of your agent’s process, which helps put the steps in context.
7. To drill down, click the Trace tab. The Trace panel shows the full trace data for the interaction, including each event, the time elapsed for the event, and the technical details related to that event. The agent events in the trace data are more granular than the overview of steps in the Interaction Summary, which makes them useful for troubleshooting. And you can also view the details for each event.
8. Use the Variables tab to track the state of variables in your agent at the start and the end of the interaction. Tracking the value of variables at the start and end of an interaction can help you evaluate whether your agent has the right context, how well it follows instructions, and the accuracy of its responses.
9. To get AI assistance, click **Ask Optimizer** in the Interaction Summary panel. We send [Agent Optimizer](https://help.salesforce.com/s/articleView?id=ai.agent_optimize_dev.htm&release=264.0.0&type=5 "Focus on what you want your agent to do, not how to configure or fix it. Agent Optimizer is a built-in coding agent that extends, refines, and troubleshoots your agents directly in Agentforce Builder, at no additional cost. Explore use cases and considerations for working with Optimizer.") information about the preview session so you can ask it questions and it can diagnose issues.
10. If the test reveals errors or gaps, ask Optimizer to make updates, and it proposes and tests changes. Or make changes yourself in the Canvas or Script views. If your agent version is committed, make a new version first and modify it.
11. To test changes, refresh the session by clicking the reset icon on the Preview panel. Continue testing, modifying, and retesting until you're satisfied with the agent’s behavior.