Sub topic 3
The Einstein Trust Layer and Safe Responses
Assume you know Salesforce objects, permission sets, and basic Flow or Apex. You should also understand that a large language model generates text from instructions and available data.
Trust, channels, and escalation
The Einstein Trust Layer adds protections between Agentforce and the model. It helps limit sensitive data exposure, apply masking, and keep prompts and responses within Salesforce controls. Grounding the response with approved CRM records or knowledge is also important. Instructions should require the agent to use action results instead of guessing.
Agents run in different channels:
- Service agents support customers through channels such as a website or messaging.
- Employee agents support authenticated users in internal channels, such as Salesforce or Slack.
- The channel affects identity, authentication, and the information the agent should present.
A service agent should offer escalation when it cannot resolve an issue, detects a sensitive request, or reaches a defined business limit. Configure the handoff to Omni-Channel so a human receives the conversation and relevant context.
Custom actions with Flow and Apex
A custom action lets an agent perform a controlled operation. A Flow action is useful for declarative record updates and branching. An Apex invocable method is useful for custom logic.
public with sharing class GetOrderStatusAction {
public class Request {
@InvocableVariable(required=true)
public String orderNumber;
}
public class Response {
@InvocableVariable
public String status;
}
@InvocableMethod(label='Get Order Status')
public static List<Response> getStatus(List<Request> requests) {
Set<String> numbers = new Set<String>();
for (Request request : requests) numbers.add(request.orderNumber);
Map<String, String> statuses = new Map<String, String>();
for (Order order : [SELECT OrderNumber, Status FROM Order
WHERE OrderNumber IN :numbers]) {
statuses.put(order.OrderNumber, order.Status);
}
List<Response> results = new List<Response>();
for (Request request : requests) {
Response result = new Response();
result.status = statuses.containsKey(request.orderNumber)
? statuses.get(request.orderNumber) : 'Order not found';
results.add(result);
}
return results;
}
}Test, activate, and choose
Test normal requests, missing data, unauthorized requests, prompt injection attempts, and escalation paths before activation. Confirm that the agent uses the intended action and does not invent results. After deployment, review transcripts, action errors, handoff rates, and user feedback.
Choose a service agent for customer-facing support. Choose an employee agent when authenticated staff need help with records already governed by their permissions.
Exercise
Which agent type fits an assistant for employees reviewing their own open cases?
Show answer
An employee agent, because the internal user's identity and permissions should govern the returned records.