Lesson 5 of 41 · All lessons
Salesforce Agentforce Specialist
0 of 41 complete
1Exam Overview
  1. 1.1Agentforce Specialist Complete Exam Overview
2Prompt Engineering20%
  1. 2.1When to Use Prompt Builder
  2. 2.2Prompt Template Access Controls
  3. 2.3Field Generation and Flex Prompt Template Types
  4. 2.4Grounding Techniques for Prompt Templates
  5. 2.5Creating, Activating, and Executing Prompt Templates
  6. 2.6Best Practices for Writing Effective Prompts
  7. 2.7Trust Layer Security and Privacy Features
  8. 2.8Managing and Preventing Specific Models from Being Accessed
3Data 360 Fundamentals20%
  1. 3.1Agentforce Data Library
  2. 3.2Data 360 Concepts for Agentforce
  3. 3.3Chunking
  4. 3.4Indexing
  5. 3.5Retrievers
  6. 3.6Choosing a Grounding Approach for a Scenario
4AI Agents35%
  1. 4.1How an Agentforce Agent Works
  2. 4.2Agent Building Blocks and Agent Script
  3. 4.3Hybrid Reasoning and Deterministic Behavior
  4. 4.4Agentforce Builder: Canvas and Script Views
  5. 4.5Filters, Variables, and Template Expressions
  6. 4.6Standard and Custom Topics
  7. 4.7Standard and Custom Agent Actions
  8. 4.8Configure Topics, Instructions, and Actions for a Use Case
  9. 4.9Connecting Agents to Digital Experience, Email, Voice, and Slack
  10. 4.10Agent Security Context and Action Execution
  11. 4.11Choosing Between Employee and Service Agents
  12. 4.12When to Use Agent API
5Testing, Deployment, and Maintenance10%
  1. 5.1Testing Agents with Testing Center
  2. 5.2Understanding Testing Center Evaluations
  3. 5.3Deploying Agents from Sandbox to Production
  4. 5.4Deploying Prompt Templates Between Environments
  5. 5.5Reviewing Agent Behavior After Changes
6Governance and Observability10%
  1. 6.1Managing and Monitoring Agents
  2. 6.2Agent Analytics and Performance Signals
  3. 6.3Identifying Opportunities to Optimize Agent Behavior
  4. 6.4Using Observations to Guide Improvements
7Multi-Agent Orchestration5%
  1. 7.1Choosing a Multi-Agent Architecture
  2. 7.2Orchestrators and Connected Subagents
  3. 7.3Handoff and Supervisor Modes
  4. 7.4Model Context Protocol (MCP)
  5. 7.5Agent-to-Agent (A2A) Communication

Section 2 · Prompt Engineering · 20% of exam

2.4 Grounding Techniques for Prompt Templates

3 min read Updated Nov 16, 2026

Exam objective

Given a scenario, identify a suitable grounding technique for supplying relevant Salesforce or organizational context to a prompt.

Grounding adds trusted, relevant context to a prompt so the model can generate a response based on information connected to the task. Without grounding, a model may rely on general learned patterns and can return a plausible but unsupported answer. In Salesforce, grounding can use resources such as record fields, related lists, Flow outputs, Apex-provided values, Data 360 data, or retrieval results, depending on the template and feature.

Choose context that answers the question

Begin with the information the user actually needs. If a summary requires fields from the current record, merge fields can provide those values. If it needs related records, a related list or an appropriate Flow may supply them. If the answer depends on a collection of documents or knowledge articles, a data library or retriever can search and return relevant passages. The goal is not to add every available data source; it is to give the prompt the minimum sufficient evidence needed for its task.

Record-based grounding works well when the relevant facts are structured and attached to a known Salesforce record. Retrieval is more useful when the source is a larger body of text or documents and the system must find pertinent passages from a corpus. A retriever does not make a source authoritative by itself. The quality of the response depends on source accuracy, permissions, indexing, retrieval relevance, and instructions that tell the model how to use the supplied context.

Understand the resource path

Prompt Builder's resource picker can reference Salesforce resources, but a resource must be available to the template and invocation context. For example, a prompt that references a Flow output needs a compatible Flow and the required inputs. An Apex resource must expose the values the prompt needs. Data 360 grounding requires a suitable data model or retriever, along with correctly prepared and accessible data. Check that the selected resource supplies current values and that the template doesn't refer to an ambiguous field or stale text.

Grounding also intersects with security. Salesforce documents that retrieval from CRM data preserves standard role-based permissions when grounding data from a CRM instance, and the Einstein Trust Layer helps protect sensitive data in prompt processing. Still, the administrator must review which data is included, who can run the template, and what output can be shown or saved. Never assume a prompt can safely use a resource simply because the resource appears in a setup menu.

Test grounding, not just wording

Use representative records and questions. Inspect the preview to see what values or context are supplied. Test missing data, conflicting sources, long records, and a query with no relevant document. The prompt should instruct the model to stay within the provided facts, acknowledge when information is absent, and avoid inventing values. If retrieved content is irrelevant, improve the source, indexing, filters, retriever, or retrieval instructions rather than adding more generic prompt language.

Match the source to the information shape: fields for structured record facts, retrieval for finding relevant passages across a corpus, and Flow or Apex when a controlled calculation or transformation is needed.

Grounding improves relevance but does not guarantee factual correctness. Review both the source and the generated answer.

Extra concept: In retrieval-augmented generation, the retriever selects context and the prompt gives that context to the model; the model then generates a response. These are separate steps and can fail independently.

Official reference: Salesforce Help, Ground Prompt Templates with Salesforce Resources - https://help. salesforce.com/s/articleView?id=ai.prompt_builder_ground_template.htm&language=en_US&type=5

Key takeaways

  • Ground prompts with relevant, authorized, current information.
  • Choose structured fields or retrieval based on where the needed facts live.
  • Test whether context is present, relevant, secure, and handled correctly when missing.

Check your knowledge

Answer exam-style Prompt Engineering questions with answers and explanations.

Practice Prompt Engineering
Finished this lesson? Mark it complete to track your progress.

Ready for the real exam?

Take the timed Salesforce Agentforce Specialist simulator: same number of questions, same time limit.

Get Complete Access