Sub topic 5
What Instructions Do Once a Topic Is Selected
This chapter assumes you know what an Agentforce agent, a topic, and an action are. It also assumes you can open Agentforce Builder and preview a conversation. Routing is covered in earlier chapters. Here the request has already been matched to a topic, and the question is how the agent behaves from that point on.
Routing and instructions do different jobs
The classification description and the instructions are read at different moments and answer different questions.
| Field | Used when | Question it answers |
|---|---|---|
| Classification description | Before a topic is chosen | Does this request belong here? |
| Scope | Before and after selection | What will this topic do and not do? |
| Instructions | After a topic is chosen | How should the agent behave and respond now? |
The agent does not use instructions to pick a topic. If a request lands in the wrong topic, rewriting the instructions will not fix it. Revise the classification description instead.
What instructions control
Once the topic is selected, its instructions guide the agent in four ways.
- Sequence. Which step comes first, such as asking for an order number before looking anything up.
- Action use. When to call an action and which inputs to pass to it.
- Response content. What to include in the reply and how long it should be.
- Limits. What to do when the request falls outside what the topic handles, such as offering a transfer to a human agent.
Instructions are guidance given to a large language model. The model reads them as part of its context and follows them as well as it can. That has a practical consequence. Instructions shape behavior but do not guarantee it, so a rule that must hold every time needs something stronger. A later chapter covers when to use a Flow or Apex action for that.
Instructions work as a set
The agent reads all of a topic's instructions together on every turn. Each instruction is part of the same context, so wording in one place can affect another.
Consider a topic with these two lines:
Always ask for the order number first.
If the customer is upset, apologize and offer a refund right away.An upset customer who has not given an order number triggers both lines. The agent has to choose, and its choice may vary between conversations. Conflicts like this are a common source of inconsistent behavior. When you add an instruction, reread the existing ones and check whether any of them could apply at the same time.
Instructions describe behavior, not identity
A common mistake is to use instructions to describe what the topic is. That belongs in the classification description and scope. Instructions should describe what the agent does.
Weak:
This topic is about order status. You are an expert in shipping.
Stronger:
1. Ask the customer for their order number if they have not provided one.
2. Look up the order before describing its status.
3. Give the current status and expected delivery date in one or two sentences.The weak version restates the topic's purpose and gives the agent nothing to do. The stronger version names observable steps. You can read a test transcript and decide whether each step happened.
A working check
For each instruction, ask whether you could point to a line in a preview conversation that proves it was followed. If you cannot, the instruction is too vague to test. The next chapter covers how to write instructions that pass this check.
Exercise
A customer asks about a damaged item, and the agent answers using the Order Status topic. A teammate suggests adding "Never handle damaged items" to the Order Status instructions. Will that fix the routing problem, and what should you change first?
Show answer
It will not fix the routing. Instructions apply only after the topic is selected, so the request would still land in Order Status. The teammate's line may make the agent decline once it is there, but the customer still reaches the wrong topic. First revise the classification descriptions so the damaged-item request matches the returns or refunds topic more clearly than Order Status. Keep the instruction as a backup if you want.
Exercise
These two instructions are in the same topic: "Always ask for the order number first" and "If the customer is upset, offer a refund right away." Name the problem and rewrite them so they no longer conflict.
Show answer
The problem is a conflict. An upset customer without an order number triggers both, and the agent may follow either. One fix is to set an order: "1. Ask for the order number if it was not provided. 2. After the order is found, if the customer is upset, apologize and explain the refund options." This makes the sequence explicit, so only one behavior applies at each point.