Sub topic 3
Simulated versus live testing
This chapter assumes you have an agent in Agentforce Builder with at least one topic and one action, and that you can open the conversation preview panel. It covers the two test modes in that panel, what each one does to your data, and how to choose between them.
Why there are two modes
An agent does two kinds of work in a conversation. It reasons: it reads the user's message, picks a topic, and decides which action to call. Then it acts: the action runs a Flow, Apex code, or a prompt template, and the agent uses the result in its reply.
The two preview modes differ in whether that second step really happens.
| Row | Simulated | Live |
|---|---|---|
| Actions run | No. The model imitates what an action would return. | Yes. The real Flow, Apex, or prompt template runs. |
| Uses real org data | No | Yes |
| Can change records | No | Yes, if the action writes data |
| Needs finished actions | No | Yes |
| Tests topic selection | Yes | Yes |
| Tests action outputs | No, the outputs are invented | Yes |
In the preview panel, a mode selector sets which of the two you use. The labels can differ slightly between releases, so check what your org shows.
Simulated mode
In simulated mode the agent still chooses topics and decides which action to call and with what inputs. When it calls an action, nothing in your org runs. The model produces a plausible result instead, and the agent replies using that result.
Use simulated mode when:
- You are early in the build and the actions are not finished or deployed.
- You want to check topic classification and instruction wording quickly.
- The real action would send an email, create a case, or update a record, and you don't want that during testing.
The weakness is that the action output is made up. A reply that looks right in simulated mode proves only that the agent's reasoning is sound. It does not prove that the real Flow returns the fields you expect. A simulated "Your order shipped yesterday" says nothing about whether the Look Up Order action can find order 00012345.
Live mode
In live mode the agent calls your real actions with real inputs against the org's data. The reply comes from what the action actually returned.
Use live mode when:
- You want to confirm that an action receives the right inputs, such as the order number extracted from the user's message.
- You want to see how the agent handles real output, including empty results, errors, and unexpected values.
- You are checking permissions. Actions run in the context of the agent's running user, so a record the agent cannot read fails in live mode and never fails in simulated mode.
Live mode has a cost. Actions that write data will write it. Test against a sandbox, or against records you created for testing, and never against production customer records.
Choosing a mode
A practical order is to start simulated and move to live once the reasoning looks right.
Running the same test in both modes
Take the first utterance from the starter set: "Where is my order 00012345?" Record what you expect, then run it in each mode.
Test: "Where is my order 00012345?"
Expected topic: Order Status
Expected action: Look Up Order (input: order number 00012345)
Expected reply: States the order's current status
Result: pass or fail
Notes: If it fails, record the topic and action shown in the reasoning trace.In simulated mode, check the topic and the action input. If the agent picks Order Status and passes 00012345 to Look Up Order, the reasoning works. The status in the reply is invented, so don't judge it.
In live mode, run the same utterance and check the status against the order record in your org. If it differs, or the agent says it cannot find the order, the problem is in the action or its data access, not in the topic.
This split helps you debug. A failure that shows up in both modes points to topics or instructions. A failure that shows up only in live mode points to the action, its inputs, or permissions.
Common errors
- Trusting simulated replies. The content of an invented action result is not evidence that the action works. Judge only the reasoning in simulated mode.
- Testing writes against real records. Live mode applies the changes. Create test records first.
- Skipping live mode before deployment. Agents that passed simulated tests often fail on permissions or on real data that is missing fields.
- Changing mode mid-conversation and comparing results. Reset the conversation when you switch, so earlier turns don't affect the agent's choices. The reset step is covered in a later chapter.
- Blaming the topic for an action failure. If the right topic and action were chosen but the reply is wrong, look at the action, not the instructions.
Exercise
Your agent picks the Order Status topic and calls Look Up Order with 00012345 in simulated mode, but in live mode it replies that it cannot find the order. The order exists in your sandbox. In which part of the agent should you look first, and why?
Show answer
Look at the Look Up Order action and the agent's access to the order record, such as the running user's permissions and how the Flow or Apex finds the order. Simulated mode shows that the topic and the input are correct. Simulated results are invented, so they never reveal action or permission problems. The failure appears only when the real action runs, which points away from the topic and instructions.