Sub topic 5
Setting a Topic's Scope
This chapter assumes you know basic Salesforce objects and fields, can navigate Setup, and have a general idea of what a large language model does. You should also have read the previous chapter on naming a topic and writing its classification description.
What scope does
A topic has two pieces of text that look similar but do different jobs. The classification description helps the agent decide whether a request belongs to the topic. The scope states what the agent does once it is in the topic, and where that job ends.
Scope answers three questions:
- What is the agent responsible for in this topic?
- What can it do, based on the actions attached to the topic?
- What can it not do?
Without a stated scope, the model fills the gaps itself. It may promise a cancellation it cannot perform, or invent policy that does not exist.
A worked example
Here is the scope from an Order Status topic, with its classification description:
Topic name: Order Status
Classification description:
Handle customer questions about where an existing order is and what its current status is. Do not use for returns, refunds, or new orders.
Scope:
Your job is to look up the status of an existing order and report it. You cannot change or cancel orders.The scope is two sentences. The first sentence names the job: look up and report. The second names a limit: no changes and no cancellations. Both match the single action in the topic, Get Order Status, which only reads data.
Scope versus classification
The two fields overlap in subject matter, so it is easy to mix them up.
| Field | Used for | Written from the view of |
|---|---|---|
| Classification description | Choosing this topic over other topics | Matching an incoming request |
| Scope | Bounding the agent's job inside the topic | The agent doing the work |
The classification description above ends with "Do not use for returns, refunds, or new orders." That sentence helps routing. The scope's "You cannot change or cancel orders" tells the agent how to behave if a customer asks for a cancellation while already in the topic.
Writing a good scope
Follow these guidelines:
- Start with the job, in one sentence, using a verb: "look up", "summarize", "update".
- State hard limits in plain words, such as "You cannot change or cancel orders."
- Keep the scope consistent with the actions on the topic. If no action can change an order, the scope must not suggest the agent can.
- Leave step-by-step behavior to the instructions. Scope sets boundaries, and instructions set the procedure.
Common errors
- Scope wider than the actions. The scope says "manage orders" but only a read action exists. The agent will promise things it cannot do.
- Scope that repeats the instructions. Procedure written into the scope makes both fields harder to maintain.
- Vague limits. "Be careful with changes" is not testable. "You cannot change or cancel orders" is.
- Overlapping scopes across topics. If two topics both claim order questions, the agent may choose between them inconsistently. Give each topic one job.
Exercise
A Returns topic has the scope "Help customers with their orders." Its only action is Create Return Request. Rewrite the scope so it matches the topic's job and states one limit.
Show answer
For example: "Your job is to start a return for an existing order by creating a return request. You cannot issue refunds or change the order." The scope names one job that matches the Create Return Request action and states a limit in testable words.