Sub topic 9
Deciding What Belongs at the Agent Level and What Belongs in a Topic
This chapter assumes you can open Agentforce Builder and preview a conversation. It also assumes you know what a topic is and how its classification description, scope, and instructions work. The goal here is a repeatable way to decide where each piece of guidance should live. Menu names differ between Agentforce releases, so check the labels in your org.
Two layers of guidance
An Agentforce agent reads guidance at two levels.
- Agent-level guidance applies to every conversation, whichever topic is active. It usually covers the agent's role, the company it represents, its tone, and any agent-wide rules your builder version exposes.
- Topic-level guidance applies only after the agent selects that topic. It consists of the topic's scope and instructions, plus the actions assigned to the topic.
The topic's classification description is not part of the second layer. The agent uses it earlier, to decide whether the topic applies at all. Instructions inside a topic cannot influence that decision, because they are read only after the topic is chosen.
The core test: how many topics need this rule?
Ask these questions in order for each rule you want to write.
- Does this rule need to be followed every time, with no exceptions? If yes, an instruction of any kind is the wrong tool. Use a Flow or Apex action, as the later chapter on deterministic logic explains.
- Would this rule be true in every topic of this agent? If yes, it is a candidate for agent-level guidance.
- Is it true in one topic and irrelevant or wrong in the others? Put it in that topic's instructions.
- Is it true in two or three topics but not all? Repeat it in each of those topics. Do not promote it to the agent level, where it would apply to topics it was never meant for.
The most common mistake is not putting a rule in the wrong layer by accident. It is promoting a topic-specific rule to the agent level because that feels tidier. A rule that applies "everywhere" will also apply in places you did not think about.
What belongs at the agent level
Agent-level guidance should hold things that stay true whichever topic the customer lands in.
| Kind of guidance | Example |
|---|---|
| Role and audience | You are a support assistant for Northwind Outfitters. You talk to retail customers. |
| Tone and voice | Be polite and concise. Use plain language. Do not use slang. |
| Format defaults | Keep replies under 80 words unless the customer asks for detail. |
| Universal safety and handoff behavior | If the customer asks for a human, offer to transfer them. Never ask for a full card number. |
| Language behavior | Reply in the language the customer writes in. |
Notice what these have in common. None of them mention a specific business process, a specific action, or a specific data field. Each one would read correctly if you pasted it into any topic.
What belongs in a topic
Topic-level guidance should hold anything tied to a particular job.
- The sequence of steps for that job, such as asking for an order number before a lookup.
- The conditions under which each assigned action runs.
- What to do when that job's data is missing or an action returns nothing.
- Boundaries specific to that job, such as "do not promise a refund date."
- Wording the customer will see only in that situation, such as how to present a delivery date.
A good check: if removing the rule would not change behavior in the other topics, it belongs in this topic.
A worked split
Suppose a retail agent has two topics, Order Status and Returns. A first draft puts everything in one block at the agent level:
You are a support assistant for Northwind Outfitters.
Be polite and concise.
Always ask for the order number before looking anything up.
Give the delivery date in one or two sentences.
For returns, collect the reason and the item before starting a return.
Never promise a refund date.
If the customer asks for a human, offer to transfer them.This works in a quick test, then misbehaves. In a general question such as "Do you ship to Canada?", the agent asks for an order number, because the third line applies everywhere. A return conversation can be cut short with a delivery date, because the fourth line applies everywhere too.
Split by the core test:
Agent level:
You are a support assistant for Northwind Outfitters.
Be polite and concise. Keep replies under 80 words unless the customer asks for more.
If the customer asks for a human, offer to transfer them.
Order Status topic instructions:
1. If the customer has not given an order number, ask for it.
2. Use the Get Order Status action with the order number before describing the status.
3. Give the current status and expected delivery date in one or two sentences.
4. If the order is not found, say so and ask the customer to check the number. Do not guess.
Returns topic instructions:
1. Ask which item and why the customer wants to return it.
2. Use the Start Return action with the order number and item.
3. Never promise a refund date. Say the refund is handled after the item is received.Get Order Status and Start Return are hypothetical action names. Use the exact names of actions assigned to your topics.
The agent-level block is now three lines, and each line is safe in every topic. The order-number rule only runs when the Order Status topic is active.
Conflicts between the layers
When agent-level and topic-level guidance disagree, the agent has to pick one reading, and you cannot reliably predict which. Treat any conflict as a defect to remove, not a precedence rule to rely on.
Common conflicts:
- Agent level says "Keep replies under 80 words." A topic instruction says "Explain each step of the return process in detail." The model may truncate the explanation or ignore the limit.
- Agent level says "Never discuss pricing." A topic's instruction tells the agent to quote the price from an action's output.
- Agent level says "Always greet the customer by name." A topic is designed for anonymous visitors, so no name is available.
To fix a conflict, narrow the broader rule so it no longer covers the exception. For example, change the length rule to "Keep replies short by default. A topic may allow a longer reply." Or remove the agent-level line and put the rule only in the topics that need it. Narrowing is better than adding a counter-instruction such as "Ignore the agent length limit," because that wording is itself something the agent must interpret.
Why the agent level is the riskier place to edit
A change at the agent level affects every conversation. A change in one topic affects only the conversations routed to it. That asymmetry has practical consequences.
- Testing cost. After a topic edit, retest that topic and a few utterances that might route to it by mistake. After an agent-level edit, retest every topic.
- Dilution. Each added agent-level sentence competes for attention with every topic's instructions. A long agent block makes it more likely that any one rule is followed loosely.
- Hidden coupling. Topics written by different people can silently depend on, or contradict, an agent-level sentence that someone later changes.
For these reasons, default to the topic. Promote a rule to the agent level only when you can name at least three topics where it applies, or you can show it holds for any topic you might add later.
Duplicate, or promote?
Sometimes the same sentence appears in three topics. Should you promote it? Use this table.
| Situation | Decision |
|---|---|
| The sentence is identical in every topic and is not tied to an action or process | Promote it to the agent level. |
| The sentence is identical in some topics but another topic needs a different version | Keep it in the topics, each with its own wording. |
| The sentence refers to an action name or a field | Keep it in the topic that owns that action. |
| You expect to add topics where the sentence would be wrong | Keep it in the topics. |
Duplication costs you a little maintenance. A wrong promotion costs you unexpected behavior. When unsure, accept the duplication.
Where deterministic rules fit
Neither layer is a place to enforce a rule that must never fail. Consider "Never process a return for an order older than 30 days." Whether you write it at the agent level or in the Returns topic, it is still an instruction the model interprets. A customer who argues, or a prompt that phrases the date oddly, can still produce the wrong outcome.
The reliable version moves the check into the action. A Flow or Apex action that receives the order number can compare dates and return a clear result, such as eligible: false. The topic instruction then only says what to do with each result:
1. Use the Check Return Eligibility action with the order number.
2. If the action says the order is eligible, ask which item to return and use the Start Return action.
3. If the action says the order is not eligible, tell the customer it is outside the return window. Offer to transfer them to a human agent.The instruction handles the conversation. The action handles the rule. This division also keeps the topic instructions short, which helps the agent follow them.
Checking your split in the preview
After you place guidance, test the layering directly.
- Send an utterance that matches no topic well, such as a greeting. Confirm that only agent-level behavior appears, such as tone and role. No topic-specific steps should leak in.
- Send an in-scope request for each topic. Confirm the topic's steps run in order and the tone still matches your agent-level rules.
- Send a request that sits near a topic boundary. Check that the topic-specific rule from the wrong topic does not appear.
- Temporarily remove one agent-level sentence and rerun a few utterances. If nothing changes, the sentence may not be doing useful work and can be deleted.
Summary of decision rules
- Put in the agent level only what is true and safe in every topic.
- Put job-specific steps, action conditions, and edge-case handling in the topic.
- Resolve conflicts by narrowing the broader rule, not by adding a rule that cancels it.
- Prefer a little duplication over a wrong promotion.
- Move rules that must always hold into a Flow or Apex action.
Exercise
An agent has three topics: Order Status, Returns, and Store Hours. A teammate proposes adding "Always ask for the customer's order number first" to the agent-level guidance. Explain what is likely to go wrong, and where the rule should go instead.
Show answer
The rule would apply in the Store Hours topic too, where no order exists. The agent could ask a customer who only wants opening times for an order number, or stall until it gets one. The rule belongs in the instructions of Order Status and Returns, the two topics that use an order number. If both topics use identical wording, the duplication is acceptable. The agent level should keep only guidance that is safe in all three topics, such as tone and the offer to transfer to a human.
Exercise
The agent-level guidance says "Keep every reply under 50 words." The Returns topic instruction says "List all steps of the return process." In testing, the agent drops steps. How do you fix the conflict?
Show answer
Narrow the broader rule instead of adding an override. Change the agent-level line to something like "Keep replies short by default. A topic may allow a longer reply when the customer needs several steps," or remove the limit from the agent level and set it only in the topics that need it. Then retest the Returns topic and a few other topics, because the agent level is shared.