Loading
Agentforce and Einstein Generative AI
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Get to Know Prompt Builder

          Get to Know Prompt Builder

          Prompt Builder features a guided, visual layout that takes you through each stage of your prompt’s lifecycle, from creation, to testing, and activation.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations

          Navigate the Prompt Builder UI

          Prompt Builder features a guided, visual layout that takes you through each stage of your prompt’s lifecycle, from creation, to testing, and activation. The intuitive design helps you understand how a prompt is constructed and how it performs at each step.

          Prompt Builder Workspace with all of the sections expanded Prompt (1), Preview and Template Settings (2), Resolved Prompt (3), Generated Response (4), and Save, Activate and Delete Panel (5).

          Build Your Prompt Template (1)

          Craft your prompt template by using merge fields to personalize responses based on real org data.

          Prompt Section displaying a prompt with multiple merge fields.
          • Type an @ symbol or select Insert Resources in the Prompt section to search for and insert merge fields. Adding resources ensures that your prompts are grounded in org data and generate relevant responses.
          • Select Copy ( Copy Icon) to quickly copy the prompt to your clipboard. The copy icon is also available in the Resolved Prompt and Response sections to easily reuse content.

          Template and Preview Settings (2)

          Take control of how your prompt behaves with the Template and Preview Settings.

          Template Settings showing overview, inputs, models and response sections collapsed.
          Overview section showing template type, template name, api name, and description. Model section showing the model type and models fields and the model limitations accordion collapsed. Response section expanded to show the allowed languages field.

          Template Settings

          • View your template type (1).
          • Edit the prompt template name and description after drafting (1).
          • View the inputs required by this prompt template. For example, the Sales Email prompt template uses primary and related objects, while Flex templates use different inputs based on the use case (1).
          • Select and test LLM models with your prompt template. Quickly access the accepted file types and sizes and the exclusion process if a file exceeds the limits (2).
          • Select the allowed languages that the LLM can use to generate your prompt’s response when the outputLanguage parameter is specified during template invocation. See Supported Languages in Prompt Template Responses (3).
          Preview Settings showing inputs, configure response, and display sections collapsed.  
          Inputs section with the field selector account. Configure response section expanded to show the Generate Response toggle and the language field.

          Preview Settings

          • Select sample data to preview how your prompt’s output appears in production (1).
          • When Generate Response is off, only the resolved prompt displays. The prompt isn’t sent to the LLM, and no response is generated. Customize what’s visible in the Step-by-Step Layout (2).
            • Show or hide the prompt.
            • Show or hide the Resolved Prompt.
            • Focus only on the response for a clean preview output.

          Review the Resolved Prompt (3)

          In the Resolved Prompt section, you can view how test inputs are merged into your prompt template. This version of the prompt template represents what is sent to the LLM, with actual org data applied.

          • Verify that all merge fields are correctly resolved.
          • Ensure that the structure of the prompt is clear and complete.
          • Use Copy ( Copy Icon) to quickly add the resolved prompt to your clipboard.

          Data Trust and Masking

          Screenshot of the Resolved Prompt Section showing a prompt with the sensitive data masked with placeholder text

          If your prompt template includes sensitive data, it’s automatically replaced with a placeholder in angle brackets before being sent to the LLM. For example, <AccountName>. The Einstein Trust Layer masks sensitive values to protect customer information.

          When the response is returned, the original values are automatically reinserted and displayed in italics in the Response section.

          To turn on masking and verify that it’s configured properly, go to the Einstein Trust Layer Settings in Setup.

          Preview the LLM Response (4)

          The Response section displays the final output generated by the LLM based on your resolved prompt. This preview shows exactly what a customer or user sees, helping you to evaluate the clarity, tone, and accuracy of the response.

          Screenshot of the Response Section showing the response from the selected LLM with the sensitive data restored. A zoomed-in view of the icons displayed in the response section.

          Use the icons at the top of the Response section to gain deeper insights and take action.

          • View Masking Details: Click the shield (Shield icon) to view which placeholders were used for sensitive org data and how that data was masked before the prompt was sent to the LLM. The placeholders are replaced with real data after the response is received so that you can inspect what was protected and how it maps to the final output.
          • Toxicity Warning: If applicable, a numeric value indicating the number of warnings in the response is shown next to the triangle, Warning icon with the number 0.
          • Copy Response: Select the Copy ( Copy Icon) to quickly copy the generated response to your clipboard. If the response includes rich text, the format that's copied is JSON.

          Save, Activate, and Delete (5)

          When you’re ready, use the Save, Activate, and Delete panel to:

          • Save your prompt template as a draft.
          • Activate the prompt template to make it available for use across your org.
          • Delete a template that isn't currently in use. If the template is in use, remove the references before deactivating or deleting it.

          Put Prompts to Work in Salesforce

          After activation, your users can benefit from prompt templates directly within Salesforce apps like Sales Emails and Lightning record pages. To see how users interact with prompts, see How Users Work with a Prompt Template.

           
          Loading
          Salesforce Help | Article