Sub topic 3
Designing Clear Confirmation Before Data Changes
Assume you know Salesforce records and have used Agent Builder. You should also understand basic Flow or Apex actions.
Designing actions so the confirmation is clear
An agent can call a Flow, an Apex invocable method, or a prompt template as an action. Design each action so the agent can identify the record, the change, and the resulting value.
Use specific action names and descriptions. Give inputs clear labels and descriptions. For example, use Case Id and New Status instead of Record and Value. An action that updates a case should expose enough information for the agent to say exactly what will change.
| Action design choice | Clear example |
|---|---|
| Input label | New Status |
| Input description | The status to assign, such as Closed |
| Action description | Changes one case's Status field |
Ask for confirmation when the action creates, updates, or deletes data. Read-only actions usually do not need this step.
@InvocableMethod(
label='Update Case Status'
description='Changes one case Status field. This modifies data.'
)
public static List<Result> updateStatus(List<Request> requests) {
// Validate inputs before performing the update.
update new Case(
Id = requests[0].caseId,
Status = requests[0].newStatus
);
return new List<Result>{ new Result('Update complete') };
}What the confirmation conversation looks like
The agent should summarize the pending operation, ask a direct question, and wait. It should run the action only after a clear agreement.
Testing confirmation in conversation preview
In Agent Builder's conversation preview, test both paths:
- Request a valid change and confirm it.
- Decline the request.
- Give an unclear response, such as “Maybe.”
- Omit a required record or value.
- Try a value that validation should reject.
Check that the action does not run before confirmation and that the message names the correct record and new value.
Safeguards beyond confirmation
Confirmation reduces accidental changes, but it does not replace security controls. Use permissions that grant only the required access. Validate record identifiers and field values in the action. Limit the action to the intended object and operation. Use separate, narrow actions instead of one action that can modify many unrelated fields.
Choosing the right control for each action
Use the action's Require user confirmation setting as the primary control for a data-changing action. Add topic instructions when the agent needs consistent wording or must explain a special risk. Use validation and permissions for every action because a user can confirm an invalid or unauthorized request.
Exercise
The agent asks for confirmation but does not identify the case or the new status. What should you improve first?
Show answer
Improve the action's input labels and descriptions, then test the confirmation again. The agent needs those values to summarize the change clearly.