Sub topic 6
Reinforcing confirmation in topic instructions
This chapter assumes you know what an Agentforce agent is, how to open Agent Builder, and how a Flow or Apex invocable method becomes an agent action. It also assumes you have seen the Require user confirmation setting on an action. Here you add a second layer: wording in the topic instructions.
What topic instructions do
A topic groups related actions and tells the agent how to handle a type of request. The topic's instructions are plain-language rules that the agent's reasoning engine reads when it decides what to say and which action to run.
Instructions guide the agent. They are not code, so the model usually follows them but is not forced to. The Require user confirmation setting is different. The platform enforces it when the action is about to run. That difference shapes how you use each one.
Why add instructions if the setting exists
The setting makes the platform ask for approval. It does not explain anything to the agent about how the confirmation should sound. Instructions fill that gap. With them you can:
- Make the agent name the record and the new value before it asks.
- Make the agent wait for a clear yes instead of treating a vague reply as approval.
- Say what to do when the user declines or goes quiet.
- Apply the same rule to every action in the topic, including ones added later.
Instructions complement the setting. They do not replace it. For an action that changes data, use both.
Writing a confirmation instruction
A good instruction does four things:
- Names the action it applies to.
- Says what the agent must tell the user before running it.
- Says what counts as approval.
- Says what to do if approval does not come.
This example is for the UpdateCaseStatusAction Apex method from the topic's code samples, which is registered as the Update Case Status action:
Before running the Update Case Status action, tell the user which case will change and what the new status will be, then ask them to confirm. Run the action only after the user clearly agrees. If the user declines or does not answer, do not run the action.Each sentence has a job. The first sets the content of the summary. The second defines approval. The third covers the refusal path, which is easy to forget.
Match the instruction to the action
The agent can only summarize what it knows. The Apex action declares two required inputs, caseId and newStatus, each with a label and description:
@InvocableVariable(required=true label='Case Id' description='The Id of the case to update')
public Id caseId;
@InvocableVariable(required=true label='New Status' description='The new value for the Status field, for example Closed')
public String newStatus;Because the agent must collect both values before it can call the action, it has the exact material for the summary: "case 5001R00000AbCdE" and "Closed". The method description also says "This modifies data", which gives the agent a cue that the action needs care.
If your instruction says "tell the user which case will change" but the action has no case input, the agent has nothing to quote. Keep instructions and action inputs in step.
How the two layers combine
The instruction shapes the conversation. The setting is the backstop that holds even if the model words something poorly or skips a step.
Common mistakes
- Vague wording. "Be careful with updates" gives the agent nothing to act on. State the exact behavior.
- Relying on instructions alone. A model can occasionally deviate. For actions that change data, also enable the setting.
- Contradicting the setting. An instruction such as "run the action immediately" conflicts with a confirmation requirement and confuses the agent.
- Over-applying it. Asking for confirmation before a read-only lookup adds friction and teaches users to click through prompts.
Check your work
Wording that looks right can still behave differently in conversation. After you edit instructions, run a conversation in the builder's preview and confirm the agent states the change, waits, and acts only after approval. A later chapter covers this testing in detail.
Exercise
A topic contains an action that deletes contact records. You have enabled Require user confirmation. Write one topic instruction sentence that makes the agent name the contact before asking, and explain why you would keep the setting enabled even with that sentence.
Show answer
Example: "Before running the Delete Contact action, tell the user the full name of the contact that will be deleted and ask them to confirm; do not run the action unless they clearly agree." Keep the setting enabled because instructions only guide the model and can be followed imperfectly, while the setting is enforced by the platform when the action is about to run. Using both gives a clear message and a reliable backstop.