
















Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!

















Variables in Agentforce act as secure data containers, enabling developers to control agent logic and ensure deterministic outcomes. Are a type of structured memory whose value can be used as an input or output for actions. The state of a variable can determine whether a topic or action is triggered. Variables are essential to two main capabilities of Agentforce: Persistent dynamic grounding : Variables allow agents to continuously update their understanding of the world while persisting important information. This persistence remains unaffected by any subsequent interactions. This method ensures that critical information, which can be unstructured data retrieved via RAG or structured data like user profile information, is maintained throughout the conversation. Determinism : Variables can be used as both input and output for actions. They can also be used to determine the conditions for actions or topics to be executed, based on the state of the variables. This allows a specific flow of information between actions as well as determinism in action execution. This is particularly crucial for security rules, where actions cannot be initiated if specific input variables, such as email, are not verified. There are primarily two types of variables: context variables and conversation variables. Context variables These are system generated variables holding information about the user and the conversation sessions If your agent connects to customer messaging channels, it automatically includes context variables that come from Messaging Session object fields, including custom fields. Context variables are prefixed with $Context and are read-only. They can be added to topic instructions using
Below is a simple diagram that helps visualize how the outputs from one action can be mapped back to custom variables, and then the same customer variables can be mapped back to the inputs of other actions. The screenshot below from the Coral Cloud sample app shows the mapping of a variable to an action output in the Agent Builder.
And below is a screenshot from Agent Builder showing how to map the conversation variables to the inputs of an action. In this case, we map the Verified Customer ID variable to the inputs of the Create Booking action. Differences between different types of variables
We also need simple topic instruction (as shown below) that uses the variable to define the scope of user verification for Agentforce to reason correctly.
The screenshot below shows how to add this filter to the Create Booking action.
An agent is an autonomous AI assistant that adapts and improves with each interaction. The agent interprets your request (written in natural language), plans to address it, and then calls the best action or actions to meet your needs. Based on what you ask, an agent might formulate sales or marketing guidance, auto-generate emails, summarize service work, visualize data, or write custom code. The more descriptive your request, the more detailed the response will be. Agentforce is a customizable suite of autonomous and assistive artificial intelligence AI agents. AI agents are goal-oriented AI applications that perform tasks and business interactions. All you must do is enable Agentforce and then create an agent. Agentforce, in addition to the agents, is composed of actions, topics and the reasoning engine. We mentioned that Agentforce picks the best action/s to accomplish a task. Actions are how an agent gets things done. An agent includes a library of actions, which is basically a set of tasks the agent can do, such as summarizing information, or drafting emails. Every action in an agent is assigned to a topic. Topics are a layer of organization and customization that help your agent make more accurate decisions and generate more relevant, predictable responses. If you peek inside a topic, you’ll find a collection of related actions and natural- language instructions telling Agentforce how to use them. When a user enters a question or request, the agent selects a relevant topic and then launches one or more actions included within that topic. This keeps your agent focused on the actions and data that are most relevant to the current conversation. Like topics, actions also include a set of instructions. Action instructions are crucial because they tell the agent what the action does. The names, instructions, inputs, and outputs for agent actions determine when and how an action is used. The better the instructions, the more predictably the action performs, which leads to more reliable interactions.
issue like resetting a password and prefers a human touch, an agent verifies their identity, then promptly transfers the conversation for personalized support. Key features: Data Masking : Obscures or anonymizes sensitive data (PII, financial, health) before it is included in the prompt sent to the LLM model. Prompt Sanitization : Removes references to unauthorized or potentially risky data from the prompt. Output Filtering : Analyzes generated responses to prevent the leakage of sensitive information or hallucinations. Audit Logging : Records AI interactions for compliance, auditing, and continuous improvement purposes. The Trust Layer is always enabled for Einstein services and integrates with standard Salesforce security policies (Shield, Data Classification, Encryption at Rest).
AGENTFORCE CHARACTERISTICS - HE IS… Proactive Some AI agents aren’t just reactive, they’re proactive, which is essential in dynamic business environments. AI agents use the reasoning engine in Agentforce to perform the reasoning and acting process. The reasoning engine helps agents automate routine tasks, handle tedious duties, and find the right solutions for customers. This simplifies the process for service reps at Cloud Kicks, making their jobs easier and more efficient. Natural Language A conversational interface lets people ask questions or give instructions in natural language, just like talking to a human. Agentforce retains the conversation context, making follow-up questions and related requests seamless. For example, instead of navigating the Salesforce UI to find records, a sales rep can simply type, “Show me my Acme deals.” The AI agent interprets the request, responds in natural language, and displays a list of matching opportunities. It feels just like chatting with a trusted colleague. In the same conversation, the sales rep can then ask, “Show me their open cases.” The AI agent remembers the context and knows “their” refers to Acme. This capability ensures multiple, coherent, and efficient interactions. But with Agentforce, you're not limited to conversational interfaces and chat windows. You can trigger an agent to complete background or event-driven tasks from anywhere you can call a flow or Apex class. Dynamic Information Retrieval Dynamic information retrieval makes AI agents highly effective at handling complex tasks. Here’s how it works: Retrieval augmented generation (RAG): Agents use semantic search on structured and unstructured data in Data Cloud to fetch relevant info from external sources and databases. Generic information retrieval tools : Tools like web search and knowledge Q&A help agents handle complex tasks. For instance, you can research a company or product online and combine it with internal knowledge to create an email summary. Deployment in Flows, APIs, and Apex Classes: Agents can be deployed in these environments, passing all contextual information to the agent. This eliminates the need for custom solutions in each scenario, making the agent more versatile and efficient.
Permissions required for users to run many standard agent actions. These requirements apply across many standard agent actions. FEATURE YOUR AGENT USES REQUIRED PERMISSIONS Prompt templates (including those associated with agent actions) Permission set: Prompt Template User Flows (//) App Permission: Run Flows or Grant access to individual flows Apex classes (//) Apex Class Access: select the apex classes that the agent uses Features and actions that leverage Knowledge and Data Cloud (Agentforce Data Library, Answer Questions with Knowledge agent action, …) App Permission: Allow View Knowledge / Access Conversation Entries Permission Set: Data Cloud User Data Category Visibility: select the data categories that include knowledge article data that you want your agent to use in responses. Object Permissions: following the principle of least privilege, grant access to the Knowledge object.
Agentforce security is built around a fundamental concept: the Agent User. This is a specialized user record that acts as the identity and security context for autonomous AI agents in Salesforce. The Agent User Concept An Agent User is a system-generated user that: Serves as the execution context for AI agents Determines what data the agent can access Enforces Salesforce's standard security model (profiles, permission sets, sharing rules, field-level security) Acts on behalf of end users while maintaining appropriate guardrails Think of it as the "service account" through which the agent operates - similar to how integration users work but specifically designed for AI agent operations. How Agent User Applies to Different Agent Types Employee Agent The Agent User needs access to internal Salesforce data that employees typically use Requires permissions for objects like Cases, Accounts, Knowledge Articles, and internal systems Security considerations: o Grant read access to knowledge bases and help resources o Provide appropriate case management permissions o Ensure the agent can only access data employees should see o Consider using Permission Sets to grant specific capabilities Service Agent The Agent User operates in customer service contexts Needs access to customer records, cases, and service resources Security considerations: o Configure sharing rules to limit visibility to relevant customer data
Best Practice Approach
Five foundational attributes of secure agents Role A role defines the AI agent’s persona, scope, and objectives, and sets the foundation for secure interactions. Developers must carefully define the agent’s topics — predefined conversational themes and tasks — that shape its behavior and permissions. Key security considerations include: What is the agent’s job and scope? Define the agent’s purpose and responsibilities clearly. Is it answering customer support questions, assisting sales teams, or retrieving internal documentation? A tightly scoped role reduces the risk of the agent responding to out-of-scope or unauthorized requests. Who is the target audience? Determine whether the agent will serve public visitors, internal employees, or authenticated customers. Access control policies will differ based on the audience’s trust level and required permissions. Where is the agent deployed? Identify the deployment environment, such as a website, mobile app, or internal system. Each environment introduces unique security considerations, especially related to data exposure and endpoint protection. Clearly defining roles and their associated scope lays the essential foundation for establishing appropriate access controls. This foundational understanding is crucial to minimize unintended behavior and ensure that access rights are granted correctly. Data Agents run on data which inform their decisions and interactions. But with that intelligence comes risk. Agents that access too much or the wrong kind of data can expose sensitive information and compromise trust. Agentforce allows agents to consume data from CRM, Data Cloud, and third-party sources, offering flexibility and customization. That flexibility demands strong governance to maintain security and enforce proper data boundaries. To protect your data and reduce exposure risk, focus on three core strategies: Data Access: Know what the agent accesses and what it exposes in responses. For example, a support agent trained in CRM case histories shouldn’t access financial records. Unintended exposure can lead to compliance violations or user mistrust. Data Governance: Align data usage with your organization’s management policies. Ensure agents respect boundaries between public, confidential, and restricted data. Data Minimization: Provide only the data the agent truly needs. Avoid loading “nice-to-have” datasets that increase risk without adding core value. Following these principles helps protect sensitive information while preserving the agent’s effectiveness. Actions Actions are predefined tasks triggered by instructions like Flow, Prompt Template, or Apex. Actions are the “muscle” of the AI agent — predefined tasks like retrieving information, updating records, or initiating workflows. These tasks are carried out using tools such as Flow, Prompt Templates, or Apex, based on instructions from the agent or user input. In Agentforce, actions are categorized as: o Public Actions: These can be performed on behalf of anyone, often without authentication. For example, retrieving business hours or responding to FAQs. Public actions should be tightly scoped to minimize risk. o Private Actions: These involve sensitive tasks that require identity verification, such as updating account details or accessing personal records. Agents should be configured to confirm the user’s
Employee Agent Use when the interaction involves: Internal workforce matters : HR inquiries, payroll questions, benefits enrollment Company policies : PTO requests, expense reports, internal procedures IT support : Password resets, equipment requests, software access Training and onboarding : New hire processes, skill development Internal communications : Company updates, department information Example scenarios: "How many vacation days do I have left?" "I need to submit my travel expenses" "What's the policy on remote work?" Service Agent Use when the interaction involves: Existing customer support : Troubleshooting, account issues, technical problems Post-purchase assistance : Returns, warranties, product setup Account management : Billing inquiries, subscription changes, profile updates Customer complaints : Issue resolution, service quality concerns How-to guidance : Product usage, feature explanations Example scenarios: "My order hasn't arrived yet" "I can't log into my account" "How do I install this product?" Sales Agent Use when the interaction involves: Pre-purchase inquiries : Product information, pricing, availability Lead qualification : Understanding customer needs and fit
Product recommendations : Suggesting solutions based on requirements Quotes and proposals : Pricing negotiations, contract discussions New customer acquisition : Converting prospects to customers Example scenarios: "What plans do you offer for small businesses?" "I'm interested in upgrading my subscription" "Can you help me choose between these two products?" Quick Decision Framework Internal user + company matter → Employee Agent Existing customer + problem/question → Service Agent Potential/new customer + buying interest → Sales Agent