Sub topic 12
Common Pitfalls and How to Fix Them
This chapter collects the problems that show up most often when you write Agentforce topics, and it gives a repeatable way to fix each one. It assumes you can open Agentforce Builder and preview a conversation. It also assumes you know what the classification description, scope, and instructions of a topic are, and that you know what an action is. Earlier chapters covered how to write each field. This one covers how they fail.
Start with the symptom, then find the layer
Most fixes go wrong because the author edits the wrong field. If the agent picks the wrong topic, rewriting instructions will not help, because instructions only apply after a topic is selected. If the right topic is selected but the agent behaves badly, rewriting the classification description will not help.
Use the symptom to choose where to look.
| Symptom in the preview | Most likely cause | Where to fix it |
|---|---|---|
| A request goes to the wrong topic | Overlapping or vague classification descriptions | Classification description of the competing topics |
| A request goes to no topic, or the agent gives a generic answer | Description too narrow or too abstract | Classification description |
| The right topic is chosen, but the agent does things it should not | Scope or instructions allow it, or nothing forbids it | Scope, instructions |
| The agent answers from memory instead of calling an action | Instruction does not name the action or the condition | Instructions |
| The agent behaves differently on the same input across runs | Vague wording, or a rule that needs exact logic | Instructions, or a Flow or Apex action |
| A numeric or policy rule is applied inconsistently | Rule written as prose | Deterministic logic |
| Behavior is correct in one topic and wrong in another | Conflicting or duplicated guidance | Agent-level versus topic-level instructions |
Pitfall 1: Overlapping topics
Two topics whose descriptions could both fit the same request compete for it. Which one wins can change from one phrasing to the next, which makes the problem look random.
Overlapping:
Topic A description: Answers questions about orders.
Topic B description: Helps customers with order problems.A customer who writes "my order hasn't shown up" fits both. The words "orders" and "order problems" describe the same area, not different customer intents.
Fix. Describe each topic by what the customer is trying to do, and make the intents mutually exclusive.
Distinct:
Topic A description: Looks up the status and delivery date of an existing order.
Topic B description: Starts a return or refund for an order the customer says arrived damaged or incorrect.Then check the boundary cases on purpose. Write three or four utterances that sit between the topics, such as "my order never arrived and I want my money back". Decide which topic should own each one, and adjust the descriptions until the preview agrees. If a request truly needs both topics, that is a design question: it may need a hand-off, or one topic may be too narrow.
Pitfall 2: Vague wording
Words like "helpful", "appropriate", "properly", and "as needed" cannot be checked. The model has to guess what you meant, and different guesses produce different behavior.
Weak:
Be helpful with orders and don't make mistakes.You cannot tell from a conversation whether this was followed. A good instruction names behavior you can observe.
Stronger:
1. Ask the customer for their order number if they have not provided one.
2. Use the order number to look up the order before describing its status.
3. Give the current status and the expected delivery date in one or two sentences.
4. If the order cannot be found, say so and ask the customer to check the number. Do not guess a status.A useful test: for each instruction, can you point to a line in a preview transcript that proves it was followed or broken? If not, rewrite it. Notice that step 4 also covers a failure case. Many vague instructions are really missing instructions for the case where something goes wrong.
Pitfall 3: Conflicting instructions
Conflicts are easy to create when several people edit the same topic or when agent-level and topic-level guidance both speak to the same behavior.
Agent-level: Always keep replies to one sentence.
Topic-level: Explain the delivery timeline in detail, including each carrier handoff.The model cannot satisfy both, so it picks one, and which one can vary. Subtler conflicts hide in conditions: "Always offer a discount" next to "Never mention discounts unless the customer asks".
Fix.
- Read the agent-level instructions and every topic's instructions together, looking for the same behavior covered twice.
- Keep general rules, such as tone, at the agent level. Keep task-specific behavior in the topic.
- Where a topic needs an exception to a general rule, state the exception in the topic and make it narrow: "When explaining a delivery delay, you may use up to three sentences."
- Remove the duplicate. Two copies of a rule drift apart as they are edited.
Pitfall 4: Instructions that don't tie actions to conditions
An action that is assigned to a topic is available to the agent, but nothing forces the agent to use it at the right moment. If the instructions only say "help with order status", the agent may answer from the conversation instead of calling the action.
Each instruction should pair one condition with one expected behavior, and name the action when one applies.
If the customer asks for the status of an order, use the Get Order Status action with the order number.
If the customer asks to return an item, tell them you can't process returns in this topic and offer to transfer them to a human agent.Get Order Status is a hypothetical name. Use the exact name of an action assigned to your topic. A paraphrase such as "the lookup tool" gives the agent a weaker link to the real action.
Common mistakes here:
- Naming an action that is not assigned to this topic. The instruction then promises something the topic cannot do.
- Describing the action's purpose but not the inputs. Say which value goes in, such as "with the order number".
- Leaving out what to do when the action returns nothing or fails. Add that case, as in step 4 of the stronger example earlier.
- Stacking several conditions and behaviors into one long sentence. Split them into separate lines so each can be tested alone.
Pitfall 5: Using an instruction where logic belongs
Instructions guide a language model. They are good for tone, sequencing, and judgment. They are a poor fit for rules that must come out the same way every time.
Refunds over 100 dollars require manager approval. Check the amount carefully before offering a refund."Check carefully" does not make arithmetic or policy enforcement reliable. If the rule has a threshold, a calculation, an eligibility check, or a legal or financial consequence, put it in a Flow or an Apex action. The action returns a result, such as approved or needs approval, and the instruction only tells the agent what to do with that result.
Use the Check Refund Eligibility action with the order number.
If the result is "approved", tell the customer the refund will be started.
If the result is "needs approval", tell the customer a specialist will review it and offer to transfer them to a human agent.The division of work is the point. The action decides, and the instruction describes how to talk about the decision. As before, Check Refund Eligibility is a placeholder for a real action name.
Pitfall 6: A scope that only lists what is included
A scope that says what the topic does leaves the edges open. The agent may stretch to adjacent requests because nothing tells it not to.
Scope:
Look up the status of an existing order and explain shipping and delivery information. Does not cancel, change, or refund orders, and does not answer product questions.The second sentence is what holds the boundary. When you find the agent doing something out of bounds in the preview, add it to the exclusions, and also check that the request has somewhere else to go. An exclusion with no destination leaves the customer stuck, so pair it with a redirect: another topic, or a transfer to a human agent.
Pitfall 7: Piling everything into one place
Two opposite habits cause trouble. One is putting every rule in the agent-level instructions, so they grow long and apply to topics they were never meant for. The other is copying the same rule into every topic. A good split:
- Agent level: tone, language, how to handle requests that match no topic, and rules that truly apply everywhere.
- Topic level: the steps, conditions, and actions for that task only.
Long instruction blocks have a cost too. When a topic has many instructions, important ones are easier to overlook, and conflicts are easier to introduce. If a topic keeps growing, consider whether it is really two topics with different intents.
Pitfall 8: Testing only the easy path
A topic that works for "Where is my order 1234?" may fail on realistic input. Test more than the sentence you had in mind when you wrote it.
- Different phrasings: "has it shipped yet", "package never came", "ETA on my stuff".
- Missing information: the customer gives no order number.
- Failed lookups: an order number that does not exist.
- Out-of-scope requests: "cancel it", "does this come in blue".
- Mixed requests: a status question and a return request in one message.
The other half of this pitfall is changing too much at once. If you rewrite the description, scope, and three instructions in one edit and the result improves, you do not know which change helped. If it worsens, you do not know which change hurt. Change one thing, rerun the same set of utterances, and record the result.
A repeatable fix loop
- Reproduce the problem with an exact utterance and note what the agent did.
- Use the symptom table to pick the layer.
- Make one small, specific change in that layer.
- Rerun the failing utterance, then rerun your saved set of earlier utterances to catch regressions.
- Keep the utterances that exposed problems as a permanent test list for the topic.
Quick checklist
- Each classification description names one customer intent that no neighboring topic shares.
- The scope states both what the topic does and what it does not do.
- Every instruction is observable, and each pairs one condition with one behavior.
- Every action named in an instruction is assigned to the topic and spelled exactly.
- Failure paths are covered: missing input, no result, an out-of-scope request.
- Exact rules live in a Flow or Apex action.
- No behavior is specified in two places.
- The topic has been tested with varied, incomplete, and out-of-scope utterances.
Exercise
A customer writes "my package never came and I want my money back." The agent sends it to the Order Status topic, which has the description "Answers questions about orders." A second topic, Returns and Refunds, has the description "Helps customers with order problems." Name the pitfall, and rewrite both descriptions so the request goes to the right topic.
Show answer
The pitfall is overlapping topics. Both descriptions describe the same broad area, so the request fits either one. A fix: Order Status: "Looks up the status and delivery date of an existing order." Returns and Refunds: "Starts a return or refund for an order the customer says arrived damaged, incorrect, or never arrived." The request is about a refund, so it should now go to Returns and Refunds. Then test nearby phrasings, such as "where is my package", to confirm they still go to Order Status.
Exercise
A topic contains the instruction "Offer a refund only if it is reasonable to do so." The agent sometimes offers a 400-dollar refund without review. Identify two problems with this instruction and describe the fix.
Show answer
First, "reasonable" is vague and cannot be tested. Second, a monetary threshold is an exact rule, so prose is the wrong tool. Move the check into a Flow or Apex action that takes the order and returns a result such as "approved" or "needs approval". Then write instructions that name the action and say what to do for each result, including a transfer to a human agent when approval is needed.
Exercise
You rewrite a topic's classification description, its scope, and four instructions in one edit. The preview now handles refunds correctly but fails a status question that used to work. Why is this hard to diagnose, and what should you have done?
Show answer
Because several changes were made together, you cannot tell which one caused the regression. You should change one thing at a time, rerun the failing utterance and the saved list of earlier utterances after each change, and keep the change only if the results improve without breaking other cases.