Sub topic 4
Turning on Require user confirmation
This chapter shows how to switch on the Require user confirmation setting for an Agentforce action, what the agent does at runtime once it is on, and where the setting stops protecting you. It assumes you can already open an agent in Agent Builder, add an action to a topic, and read a simple Flow or Apex invocable method. Earlier chapters covered how to spot actions that change data and why they should ask first. This chapter covers the platform setting that enforces the asking.
What the setting does
Require user confirmation is a property of an action as it is assigned to a topic. It is not a property of the underlying Flow, Apex method, or prompt template. When it is on, the agent must show the user what it is about to do and receive an explicit yes before it calls the action.
The agent's planning step decides that an action is needed and collects the inputs. The platform then pauses before execution. Only after the user agrees does the action run. If the user declines, the action does not run.
The pause is part of the action configuration, not part of the language model's reasoning. That makes it more reliable than a sentence in a topic instruction, which the model may follow well but is not forced to follow. Topic instructions are covered in the next chapters.
Enabling the setting in Agent Builder
Menu labels move between releases, so treat the steps below as the general path. The checkbox name stays the same.
- In Setup, open Agentforce Agents and choose your agent. Open it in Agent Builder.
- Select the topic that contains the action.
- In the topic's action list, select the action you want to protect. If the action is not yet assigned to the topic, add it first, and choose the Flow, Apex, or prompt template it wraps.
- In the action's configuration panel, find Require user confirmation and select it.
- Save the agent. If the agent is already active, you may need to deactivate it before editing, then activate it again. This depends on the agent version you are working in.
The same action can be assigned to several topics, and each assignment has its own setting. Turning it on in one topic does not turn it on in the others.
What happens at runtime
The confirmation is part of the normal conversation. The user asks for something. The agent identifies the topic and the action, gathers any missing inputs, and then pauses to summarize what it intends to do.
Three points about this flow matter in practice.
- Inputs come first. The agent cannot describe the change until it knows the case Id and the new status. If an input is missing, the agent asks for it, then asks for confirmation. The user sees two different questions: a data question and an approval question.
- The user can correct the plan. If the summary shows the wrong record or value, the user can say so. The agent updates the inputs and asks again.
- Declining ends the action. A "no" or no answer leaves the data untouched. The agent should say that it did nothing. Check this wording in testing.
An action worth protecting
The setting applies to the action, so a well-designed action makes the confirmation message useful. Here is the Apex invocable method used throughout this tutorial. It changes data, so it is a good candidate.
public with sharing class UpdateCaseStatusAction {
public class Request {
@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;
}
public class Result {
@InvocableVariable(label='Message' description='Outcome of the update')
public String message;
}
@InvocableMethod(
label='Update Case Status'
description='Changes the Status field of one case. This modifies data.'
)
public static List<Result> updateStatus(List<Request> requests) {
List<Case> toUpdate = new List<Case>();
for (Request r : requests) {
toUpdate.add(new Case(Id = r.caseId, Status = r.newStatus));
}
update toUpdate;
List<Result> results = new List<Result>();
for (Request r : requests) {
Result res = new Result();
res.message = 'Case ' + r.caseId + ' set to ' + r.newStatus;
results.add(res);
}
return results;
}
}The agent builds its confirmation text from the information it has about this action: the action name, the description, and the input labels and values. The method's label, "Update Case Status", and its description, "This modifies data", tell the agent that a change is coming. The two input descriptions tell it which values to name in the summary. If you had labeled the inputs Value 1 and Value 2, the confirmation would be vague. A later chapter covers action design in more detail. For now, remember that the setting makes the pause happen, and the labels and descriptions decide how informative it is.
The method uses with sharing, so the update respects the running user's record access. That is a separate safeguard from confirmation, and the two work together.
What the confirmation message might look like
The wording is generated by the agent, so it varies between runs. A typical exchange looks like this:
User: Close case 5001R00000AbCdE.
Agent: I will set the status of case 5001R00000AbCdE to Closed. Do you want me to go ahead?
User: Yes.
Agent: The case is now Closed.You do not write this text in the setting. You influence it through the action's name and description, the input labels, and any topic instructions. If you need an exact message, for example for compliance reasons, a topic instruction can specify the wording, but the model may still paraphrase it.
Which actions to switch it on for
The setting adds a step to every conversation that uses the action, so apply it with a reason. The table gives a starting rule.
| Action type | Example | Confirmation setting |
|---|---|---|
| Read only, low sensitivity | Look up a case status | Usually off |
| Creates a record that is easy to remove | Log a call note | Judgment call, often on |
| Updates existing fields | Change case status | On |
| Deletes data or cannot be undone | Delete a record, cancel an order | On, and add other safeguards |
| Sends something outside the org | Email a customer, post to an external system | On |
| Prompt template that only drafts text | Summarize a case | Usually off |
A prompt template that only returns text does not change data. If a Flow behind the action both reads and writes, treat the whole action as data-changing.
What the setting does not do
Require user confirmation is a consent step, not a validator. Several things sit outside what it checks.
- It does not verify the values. If the agent misread the case Id and the user clicks through a summary without reading it, the wrong record changes. The summary has to be readable, and users have to read it.
- It does not enforce permissions. The action still runs as the user (or the agent's running user, depending on your agent type). Object and field access, sharing rules, and validation rules apply as they would without confirmation. Giving an agent more access than it needs is a mistake that confirmation does not repair.
- It does not limit how many records change. A Flow that updates every open case still updates all of them after one "yes". The summary should state the scope, or the action should be designed to handle one record.
- It does not replace testing. You need to see the pause happen in the conversation preview, which a later chapter covers.
Common errors
- The checkbox is on in one topic but the action is also reachable elsewhere. Search every topic for the action name and confirm each assignment.
- The action is not labeled as a change. A name like
Case Helperhides what happens. UseUpdate Case Status, and say "modifies data" in the description. - Edits are not saved or published. After changing the setting, save it, activate the agent version if needed, and retest. Preview behavior reflects the saved configuration.
- Confirmation is expected from a topic instruction alone. Instruction text can fail on unusual phrasing. For anything that changes data, use the setting as the primary control and instructions as reinforcement.
- The user is asked twice. If the topic instruction asks for confirmation and the setting is also on, the user may see two confirmation prompts. Review the preview transcript and adjust the instruction so it complements the setting. For example, tell the agent to describe the change clearly before the platform prompt rather than ask a second question.
Exercise
Your agent has a topic with three actions: "Get Case Details" (a Flow that only queries), "Update Case Status" (the Apex action above), and "Draft Reply" (a prompt template that returns text). You turn on Require user confirmation for Update Case Status only. A teammate then adds Update Case Status to a second topic for escalations. Is the new assignment protected, and what should you check in the preview?
Show answer
The new assignment is not automatically protected, because the setting belongs to each topic's assignment of the action. Open the escalation topic, select the action, and turn on Require user confirmation there. Then test in the preview with a request routed to the escalation topic. Check that the agent states the case and new status, waits for a yes, runs the action only after it, and leaves the case unchanged when you answer no. Leaving the other two actions unconfirmed is reasonable, since neither changes data.