Sub topic 4
Defining What the Topic Does and Does Not Cover
This chapter covers the scope field of an Agentforce topic. It assumes you have basic familiarity with Salesforce and Setup, know what an AI agent and a large language model are, understand the basic idea of Agentforce agents, topics, and actions, and can open Agentforce Builder and preview a conversation. It also assumes you have read the earlier chapters on topic anatomy, topic selection, and the classification description.
What scope is and why it exists
A topic has three fields you write. The classification description helps the agent decide whether a request belongs to this topic. The instructions tell the agent how to behave once the topic is selected. The scope sits between them. It states what the topic will do and what it will not do.
The two fields that feel similar are the classification description and the scope. They answer different questions:
| Field | Question it answers | When the agent uses it |
|---|---|---|
| Classification description | Is this request about this topic? | While choosing a topic |
| Scope | What may the agent do inside this topic, and what must it leave alone? | After the topic is chosen, while planning a response |
| Instructions | How should the agent do the work, step by step? | After the topic is chosen, while responding |
A useful way to think about it: the description is the sign on the door, the scope is the list of services offered inside, and the instructions are the procedure for each service.
The scope matters because a language model tends to be helpful by default. If a customer in the Order Status topic asks to cancel an order, a model with no stated limit may try to help anyway. It may promise a cancellation it cannot perform. A clear scope gives the agent a reason to decline and redirect.
Anatomy of a good scope
A good scope has two parts, and both are needed.
- What the topic does. Name the tasks in verbs the agent can act on: look up, explain, collect, confirm.
- What the topic does not do. Name the nearby tasks that someone might reasonably expect it to handle, and say they are out of bounds.
Here is the scope from the Order Status example:
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 first sentence lists two positive tasks. The second sentence lists three actions the topic will not take (cancel, change, refund) and one kind of question it will not answer (product questions). Every exclusion is something a customer might ask in the middle of an order conversation. That is the test for a good exclusion: it names a neighboring request that is plausible, not an absurd one.
Compare this with a scope that only lists inclusions or that says nothing useful:
Weak scope:
Handles everything related to orders.
Stronger 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."Everything related to orders" has no edge. It overlaps with any other order topic, and it invites the agent to attempt cancellations and refunds. The stronger version has edges you can test.
Scope is not a security control
Scope is written in natural language and read by a language model. It strongly shapes behavior, but it does not enforce anything.
Chapter 10 of this tutorial covers when a rule needs deterministic logic. For now, treat scope as guidance that makes the right behavior likely and the wrong behavior unusual, and treat hard guarantees as something you build elsewhere.
How scope interacts with the other fields
Scope works together with the other parts of the topic, and mismatches cause the most confusing failures.
Scope and classification description
The classification description decides what enters the topic. The scope decides what happens once a request is in. They should agree.
Suppose the description for Order Status says "Handles customer questions about where an existing order is, when it will arrive, or whether it has shipped." The scope should not then promise "and changes shipping addresses." If it did, a request to change an address would be routed in by the description of a neighboring topic, or fall into this topic and meet a contradiction.
A request that the agent sends to a topic but that the scope excludes is the clearest sign the two fields disagree. In a preview conversation, you will see the agent choose the right topic and then decline, or choose it and then try to act. Both mean you should reread the two fields side by side.
Scope and instructions
Instructions can only work within the scope. If the scope says the topic does not issue refunds, an instruction such as "Offer the customer a refund if the package is late" conflicts with it. The agent then has to resolve a contradiction, and its choice may vary between conversations.
Check each instruction against the scope. Every action an instruction asks for should appear in the "does" half of the scope, and nothing in the instructions should require something in the "does not" half.
Scope and actions
Each action assigned to the topic is a capability the agent can use. The scope should describe only tasks that those actions, or plain conversation, can actually support. If the scope says the topic "looks up the status of an existing order" but no assigned action can retrieve an order, the agent will either invent an answer or stall. Keep the scope honest about what the topic is equipped to do.
The reverse also matters. If an action is assigned to a topic but the scope excludes the task it performs, the agent receives mixed signals. Remove the action or fix the scope.
Handling the out-of-scope request
Writing the exclusion is half the job. The other half is deciding what the agent should do when a customer asks for something excluded. There are three common choices:
- Decline and stop. The agent says it cannot help with that here.
- Decline and redirect. The agent names where the request can be handled, if another topic or channel exists.
- Decline and hand off. The agent offers to transfer the customer to a human agent.
The scope states the boundary. The instructions state the response. A short instruction paired with the scope is usually the clearest approach:
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.This is the second line of the earlier example. It names the condition (a return request), the behavior (say it cannot be done here), and the follow-up (offer a transfer). Without it, the agent has to improvise, and the improvisation may be vague or may overpromise.
Before you write a redirect, confirm the destination exists. Telling a customer "I can transfer you to our returns team" is a bad instruction if your deployment has no transfer path configured.
Choosing the right level of detail
A scope that is too short leaves gaps. A scope that is too long becomes a second set of instructions and starts to contradict the first. Aim for two to four sentences.
Use these checks to decide whether the scope is the right size:
- Can you list the tasks? If the "does" half names more than about three tasks, the topic may be doing too much. Consider splitting it.
- Is each exclusion plausible? Delete exclusions nobody would ask for. "Does not write poetry" adds noise.
- Does it avoid procedure? Words like "first," "then," and "if" belong in instructions.
- Would a new teammate understand it? If a colleague cannot tell what the topic handles, the agent probably cannot either.
Distinct scopes keep neighbors apart
Scope is also one of your main tools for keeping topics from competing. Two topics can have clear descriptions and still blur if their scopes overlap. Compare two topics that sit next to each other:
Topic A: Order Status
Scope: Look up the status and delivery date of an existing order. Does not start returns or refunds.
Topic B: Damaged or Incorrect Orders
Scope: Start a return or refund for an order the customer says arrived damaged or incorrect. Does not look up shipping status or delivery dates.Each scope names the other's job as an exclusion. That symmetry makes the border visible from both sides. When you add a third topic, check its scope against both neighbors in the same way.
Testing your scope
A scope is a hypothesis about behavior, so test it. In Agentforce Builder, open the preview and send these kinds of messages to a topic:
- A core request. "Where is order 10482?" The agent should select the topic and answer.
- A near-boundary request. "Can you cancel order 10482?" The agent should decline according to the scope.
- A mixed request. "Where is my order, and can I return the shoes?" The agent should handle the in-scope part and decline the rest. Watch whether it tries to do both.
- A request for something the topic has no action for. This reveals whether the scope promises more than the topic can deliver.
Record what you observe. If the agent crosses a boundary, tighten the exclusion by naming the specific task. If it refuses something it should do, check whether the exclusion is too broad. A phrase like "does not handle order changes" may accidentally cover lookups if the model reads "changes" loosely, so prefer concrete verbs such as "cancel," "modify the address," or "refund."
Common scope mistakes
- No exclusions. The scope lists only what the topic does, so the agent stretches into adjacent tasks.
- Vague breadth. "Everything related to X" has no edge and overlaps with neighbors.
- Scope that contradicts instructions. The agent resolves the conflict inconsistently.
- Scope that promises unsupported work. No assigned action can do what the scope claims.
- Scope used as a lock. The team assumes the exclusion blocks the action, and skips the deterministic safeguard.
- Exclusions with no response. The boundary exists, but no instruction says what to do when a customer hits it.
Exercise
A topic called Appointment Scheduling has this scope: "Handles everything related to appointments." A customer asks the agent to reschedule an existing appointment, and the agent books a second one instead. Rewrite the scope so it supports a topic that only books new appointments, and name one instruction you would add for the rescheduling request.
Show answer
Example scope: "Book a new appointment by collecting the customer's preferred date, time, and service. Does not reschedule, cancel, or look up existing appointments." Example instruction: "If the customer asks to reschedule or cancel an appointment, tell them you can't do that in this topic and offer to transfer them to a human agent." The new scope has concrete "does" tasks and plausible, verb-specific exclusions, and the instruction states what the agent does at the boundary.
Exercise
Your Order Status scope says "Does not refund orders." One instruction says "If the delivery is more than a week late, offer the customer a refund." What is wrong, and how would you fix it?
Show answer
The instruction requires something the scope excludes, so the agent has to resolve a contradiction and may behave differently between conversations. Fix it by deciding where refunds belong. If this topic should not refund, change the instruction to "If the delivery is more than a week late, apologize and offer to transfer the customer to a human agent." If refunds should be available here, change the scope and assign an action that performs the refund, with any limits enforced in a Flow or Apex action.