Skip to main content
← Back to Blog
2026-08-08 · 15 min readSalesforceUpdated Oct 31, 2026

Salesforce Agentforce Interview Questions: Prompt Builder, Data 360 and AI

Interview prep for Salesforce AI developer roles: Agentforce agents, Prompt Builder template types and merge fields, grounding, the Einstein Trust Layer, Named Credentials, LLM callouts from Apex, and Data 360 (formerly Data Cloud) identity resolution and calculated insights. Each question has a model answer checked against current Salesforce docs.

Avnish Yadav
AI Automation Engineer & Salesforce Developer
26 views
Salesforce Agentforce Interview Questions: Prompt Builder, Data 360 and AI

This guide is for developers preparing for Salesforce AI developer roles. It covers the questions interviewers ask about Agentforce, Prompt Builder and Data Cloud, which Salesforce has renamed Data 360, plus grounding, guardrails and calling a large language model (LLM) from Apex. Each question has a model answer you can adapt, grouped from beginner to advanced. Expect follow-ups on what you've built and shipped inside Salesforce, not only on what the Trailhead modules say.

This is part 2 of the Salesforce Interview Series. Part 1 is a revision guide to Apex, LWC, triggers and system design, and part 3 answers core Apex, SOQL and LWC interview questions.

Key takeaways

  • Know the current names: Einstein Copilot became the Agentforce (Default) agent, Data Cloud is now Data 360, and Prompt Builder templates can run as agent actions.
  • Ground prompts with merge fields, related lists, Apex, Flow or Data 360 data, and know what the Einstein Trust Layer does (and that its data masking is off for agents).
  • Keep keys in Named Credentials, validate every generated output, and measure quality with a test set plus human review.

How to read the answers: they're written in the first person because that's how you'll answer in the room. Where an answer describes my own project work, it says "in my projects". Everything else is a model answer you should only claim if it matches what you've done.

Beginner questions: Agentforce and Prompt Builder basics

What is Agentforce?

Agentforce is the agent-driven layer of the Salesforce Platform: it lets you deploy AI agents that work alongside employees and serve customers, with the Einstein Trust Layer connecting your data to LLMs (Agentforce Developer Guide). Unlike a chatbot that only retrieves information, an agent uses an LLM to decide which actions to run, such as updating a record or calling a flow. The point to stress is that the agent acts only through the actions and permissions you give it.

What's the difference between Agentforce, Einstein Copilot and Prompt Builder?

Einstein Copilot was Salesforce's first conversational assistant for employees. That agent type is now called Agentforce (Default), and since June 17, 2025 it gets no new features and isn't available in new environments; Salesforce recommends migrating to the Agentforce Employee agent (migration guide). Prompt Builder is where you create reusable prompt templates. You can run a template on a record page, from Flow or Apex, or as an Agentforce action (Prompt Builder developer guide).

What is a prompt template?

A prompt template is a reusable set of instructions, context and formatting for an LLM prompt. In Prompt Builder you mix static text with merge fields that pull CRM data at run time. When you insert a record field, Prompt Builder adds it as a merge field such as {!$Input:Account.Name} (Ground with Record Merge Fields). In my projects, I built a template that generates a personalized email to a customer by injecting their first name and recent order details. Templates keep the output consistent and governed.

Which prompt template types did you use?

Prompt Builder offers types such as Sales Emails, Field Generation, Record Summary and Flex, plus industry and service-specific types (Prompt Template Types). In my projects, I mainly used Field Generation and Record Summary templates to automate summaries and next steps on Service and Sales Cloud records. Flex covers anything the other types don't, with inputs you define. Each type runs from a different place, so choose by where the output is used.

Template type What it creates Where it runs
Sales Emails A personalized email from record data Einstein Sales Emails
Field Generation Content for one record field A button on the field in Lightning Experience
Record Summary A summary of a record The Summarize Record action, including agents
Flex Anything the other types don't cover Flow, Apex, agent actions

Intermediate questions: grounding, token limits and security

How do you ground prompts with CRM data?

Grounding means giving the model relevant, factual context from your org so its answer is based on your data. In Prompt Builder you can ground with record merge fields, related lists, Flow and Apex merge fields, data graphs, Data 360 DMO merge fields and retrievers for retrieval-augmented generation (RAG). Data 360 data reaches a template once enrichments relate a data model object (DMO) to Contact or Lead (Ground with Data 360 DMO Merge Fields). Keep the context relevant; as a rule of thumb, five useful related records beat fifty.

How do you include emails, comments and attachments?

Use related list merge fields or an Apex merge field that queries the latest EmailMessage or FeedItem records for the case or account. For documents, Flex templates accept file inputs, and for anything else you extract the text first. Summarizing a long thread before it goes into the prompt saves tokens and usually gives a better answer. At scale, put that pre-processing in one reusable Apex class.

How do you stay within token limits?

Trim the longest fields, summarize older conversation turns, and keep a sliding window of recent interactions. Set a character budget per grounded section, for example the first 500 characters of a description. A common rule of thumb estimates tokens as characters divided by four; it's rough, so leave headroom and trim before the call rather than after an error.

How do you prevent prompt injection?

Treat all grounded data and user input as untrusted. Separate instructions from data with clear delimiters, tell the model that the data isn't instructions, and allow only the actions the use case needs. On the platform, the Einstein Trust Layer adds prompt defense. Prompt Injection Detection (Beta) scores prompts for attacks such as role-play and privilege escalation, and logs the score to the audit trail in Data 360 (Prompt Injection Detection).

How do you reduce hallucinations?

Ground every prompt with real Salesforce data and instruct the model to say it doesn't know when the data is missing. Then check the output: compare names, amounts and IDs the model mentions against the records you passed in. Don't trust a confidence score that the model writes about itself; as a rule of thumb, treat it as a hint, not a measurement. Show citations to sources where the feature supports them.

How did you validate AI-generated output?

In my projects, I built a validation framework that checks generated text for required fields, length constraints and tone. For structured output, validate against the expected JSON schema and retry with a corrected prompt when validation fails. Rule-based checks can also flag banned words or PII patterns before anything reaches a user.

How do you handle personally identifiable information (PII)?

Send only the fields the task needs. The Einstein Trust Layer masks sensitive data before the prompt reaches the LLM, using pattern-based and field-based detection, and you choose what to mask in setup (LLM Data Masking). Two caveats are worth mentioning. First, that masking is disabled for agents, including a prompt template called through an agent action (Data Masking Limitations in Agentforce). Second, a direct callout from Apex to an outside LLM doesn't pass through the Trust Layer at all, so masking is yours to build.

How were model credentials stored?

In my projects, I stored API keys and endpoints in Named Credentials. Today that means a named credential for the endpoint plus an external credential with a custom header that holds the API key, so the key never appears in Apex code (API Keys in Custom Headers). Apex refers only to callout:Your_Credential/... (Named Credentials as Callout Endpoints).

Which model or LLM provider did you use?

In my projects, I used OpenAI's GPT-4 and Anthropic's Claude for different tasks. In some Salesforce deployments, I used Salesforce's built-in models through Prompt Builder to avoid external calls, especially where data residency was a concern. Model names change fast, so in an interview explain how you choose rather than which name you picked. Salesforce's own guidance is to test models on your real task and data, and to match model cost to business impact (Choose the Right AI Model).

Advanced questions: integration, parsing and Data 360

How does Apex invoke the model?

There are two routes. To run a prompt template, call ConnectApi.EinsteinLLM.generateMessagesForPromptTemplate with the template's API name and inputs (EinsteinLLM Class); the request goes through the Einstein Trust Layer. To call an outside model directly, make an HTTP callout through a named credential. This example calls the Claude Messages API:

public with sharing class LlmClient {
    public class LlmException extends Exception {}

    // modelId comes from Custom Metadata so you can change it without a deploy
    public static String complete(String prompt, String modelId) {
        HttpRequest req = new HttpRequest();
        req.setEndpoint('callout:Anthropic_API/v1/messages');
        req.setMethod('POST');
        req.setHeader('Content-Type', 'application/json');
        req.setHeader('anthropic-version', '2023-06-01');
        req.setTimeout(60000);
        req.setBody(JSON.serialize(new Map<String, Object>{
            'model' => modelId,
            'max_tokens' => 1024,
            'messages' => new List<Object>{
                new Map<String, Object>{ 'role' => 'user', 'content' => prompt }
            }
        }));

        HttpResponse res = new Http().send(req);
        if (res.getStatusCode() != 200) {
            throw new LlmException('LLM call failed with status ' + res.getStatusCode());
        }
        Map<String, Object> body = (Map<String, Object>) JSON.deserializeUntyped(res.getBody());
        Map<String, Object> first = (Map<String, Object>) ((List<Object>) body.get('content'))[0];
        return (String) first.get('text');
    }
}

Request format checked against the Claude API docs (anthropic-version: 2023-06-01, model, max_tokens, messages; the reply's content array holds text blocks), 2026-10-30. The Apex wasn't run: there's no org in this test setup. Anthropic_API is a named credential whose external credential adds the x-api-key header. Store a current model ID, such as claude-sonnet-5-5, in Custom Metadata and check the provider's models page before you change it. Run the callout from a Queueable job so users don't wait on it.

Why use a hand-written callout instead of External Services?

External Services registers an OpenAPI schema and turns its operations into invocable actions for Apex, Flow and agents (External Services). That suits fixed operations with stable request and response shapes. LLM calls often need custom headers, long timeouts and careful handling of odd responses, which is easier with a hand-written callout. Say which you'd pick for the case in front of you and why.

How do you parse structured LLM output?

Ask for JSON with a named schema, for example "Return a JSON object with the fields summary, sentiment and confidence." Parse it with JSON.deserializeUntyped or JSON.deserialize into an Apex class. Apex's parser is strict, so it helps to ask the model to wrap the JSON between markers you can find, and to strip anything outside them before parsing.

What if the model returns malformed JSON?

Retry once with an instruction to fix the JSON, and if that fails, return a clear error and log the raw response. Don't loop retries: each one costs tokens and time. A small sanitizing step for common problems, such as text before the opening brace, catches many failures before the retry.

How do you calculate confidence?

Don't rely on a score the model gives itself. Compare the output with the source instead: check that every entity it mentions exists in the grounded data, or measure how close a summary is to the source text. Flag low-scoring results for human review rather than presenting them as fact.

What AI guardrails would you put in place?

Human approval for any action that sends an email or changes a status, a token budget per call, toxicity checks, and a block on PII in outputs unless the use case needs it. The Einstein Trust Layer adds zero data retention with external model providers, prompt defense, toxicity scoring and an audit trail in Data 360 (Einstein Trust Layer). For agents, keep each agent's instructions and actions narrow.

Should a human approve AI recommendations?

Yes, for anything with business or compliance impact. Save each recommendation as a record with a "Pending approval" status, and route it through an approval process or a notification to the owner. Regulated industries will ask about this, so have the design ready.

What is Data 360's role?

Data 360 (renamed from Data Cloud on October 14, 2025) brings data from Salesforce and outside systems together (Enhance Data with Insights). Identity resolution builds unified profiles, which you can use to ground prompts. Instead of only the case record, the prompt can include the customer's history from other systems.

What are data streams and DMOs?

Data streams are the connections, and the data they ingest, into Data 360 (Data Streams in Data 360). Ingested data lands in data lake objects. You map it to data model objects (DMOs), which are harmonized groupings of data from data streams, insights and other sources. A typical answer names a Salesforce CRM stream as the core, plus streams for email engagement or web behavior, each mapped to DMOs.

What is identity resolution?

Identity resolution is the processing engine that turns source profiles into unified profiles, using rulesets you configure (About Identity Resolution). A detail that impresses interviewers: unified profiles aren't golden records. Identity resolution doesn't pick winning values or overwrite source data; the profile works like a key ring that points back to every source record.

What is a calculated insight?

A calculated insight defines multidimensional metrics on Data 360 data, at the profile, segment or population level, such as customer lifetime value or satisfaction score (Enhance Data with Insights). Pre-computed signals keep the arithmetic out of the LLM. For example, a prompt can say "The customer's churn score is 0.85, so suggest a retention offer" instead of asking the model to work it out.

Why use platform events?

They decouple the AI work from the user's transaction. When a case is created, publish an event; an Apex trigger on the event picks it up. Event triggers generally can't make callouts (Subscribe with Apex Triggers), so the trigger enqueues a Queueable job that implements Database.AllowsCallouts and calls the LLM (Queueable Apex). That also gives you a clean place to retry.

How do you handle high-volume enrichment?

For prompt templates, use Prompt Template Batch Processing, which generates large numbers of responses asynchronously from Flow or Apex (Prompt Template Batch Processing). For direct callouts, Batch Apex or chained Queueable jobs process records in chunks within callout limits. Monitor throughput and set timeouts on every call.

How do you monitor cost and token use?

For prompt templates, the Trust Layer audit trail stores prompts and responses in Data 360. For direct callouts, log each call with the model and the token counts from the response's usage field in a custom object, then report spend per model and use case. Add caching for repeated requests and a cheaper model for low-stakes tasks.

How did you measure summary quality?

In my projects, I measured summary quality with ROUGE scores on a small test set, plus human A/B review. Another useful signal is how often users edit the generated text before saving it. Collect feedback where users see the output, for example a "Was this helpful?" control saved to a custom object.

What happens when the AI service is unavailable?

Fail gracefully. Log the error, fall back to a rule-based response or a "try again later" message, and notify an admin if failures continue. A circuit breaker, such as a custom setting that switches the feature off after repeated failures, stops you from hammering a service that's down. A second provider adds resilience, but also cost and testing work.

How do you deploy prompt templates?

Prompt templates are metadata (GenAiPromptTemplate in the Metadata API), so they live in source control and move with Salesforce DX (GenAiPromptTemplate). You can include them in managed, unmanaged or unlocked packages. If a template references a flow, deploy them together, or deploy the flow first when a combined deployment fails (Deployment Considerations).

How do you test an LLM-based Salesforce solution?

Test in layers: Apex unit tests with mocked LLM responses, integration tests against a sandbox endpoint, and end-to-end tests of the user journey. Keep a curated set of cases for empty, very long and ambiguous input. In Apex tests, implement HttpCalloutMock and register it with Test.setMock so every callout returns a fixed response (HttpCalloutMock).

Interview tips: how to use this list

First, understand the reasons, not only the answers. Interviewers follow up with "why" and "what if". If you say you used Named Credentials, be ready to explain how you'd set up the external credential. Second, practice answering each question in two to three minutes. Third, be honest about gaps. If you haven't used Data 360, say so and explain how you'd approach it.

The best preparation is a small project. Sign up for a Developer Edition with Agentforce and Data 360, build an agent action and a couple of prompt templates, and call an external LLM through a named credential. For keeping agents reliable once they're live, see how to debug AI agents.

Frequently asked questions

What's the easiest way to learn Agentforce for interviews?

Start with the Trailhead units on Agentforce and Prompt Builder, then sign up for a Developer Edition with Agentforce and Data 360. Build a simple agent that updates a case status through one action. That gives you real examples to talk about.

Do I need Data 360 (Data Cloud) for a Salesforce AI developer role?

It helps more each year, because Data 360 is how unified customer data reaches prompts. Even if the role doesn't require it, explaining identity resolution, DMOs and calculated insights sets you apart. Mention both names, since many job posts still say Data Cloud.

How should I answer a prompt injection question?

Cover three layers: delimiters that separate instructions from data, a narrow set of allowed actions, and treating all grounded data as untrusted. Then name the platform features, the Einstein Trust Layer's prompt defense and Prompt Injection Detection (Beta). That shows you know both the general practice and the Salesforce tools.

What if I have no production experience with these tools?

Be honest and give a clear conceptual answer plus a learning project. You can say, "I haven't deployed this in production, but here's how I'd approach it, based on the documentation and my own experiments." Interviewers value that more than a bluff they can see through.

Sources

Verified against the sources below on October 30, 2026. Products and docs change often: check the linked sources if something looks different.

  1. Agentforce Developer Guide: Get Started
  2. Agentforce Developer Guide: Prompt Builder
  3. Salesforce Help: Migrate from Agentforce (Default) to Agentforce Employee Agent
  4. Salesforce Help: Prompt Template Types
  5. Salesforce Help: Ground with Record Merge Fields
  6. Salesforce Help: Ground with Data 360 DMO Merge Fields
  7. Salesforce Help: Choose the Right AI Model for Your Prompt Template
  8. Salesforce Help: Prompt Template Batch Processing
  9. Salesforce Help: Deployment Considerations for Prompt Templates
  10. Metadata API Developer Guide: GenAiPromptTemplate
  11. Salesforce Help: Einstein Trust Layer
  12. Salesforce Help: Large Language Model Data Masking
  13. Salesforce Help: Data Masking Limitations in Agentforce
  14. Salesforce Help: Prompt Injection Detection (Beta)
  15. Salesforce Help: Use API Keys in Custom Headers with Named Credentials
  16. Apex Developer Guide: Named Credentials as Callout Endpoints
  17. Apex Reference Guide: EinsteinLLM Class
  18. Apex Developer Guide: Testing HTTP Callouts by Implementing the HttpCalloutMock Interface
  19. Apex Developer Guide: Queueable Apex
  20. Platform Events Developer Guide: Subscribe to Platform Event Notifications with Apex Triggers
  21. Salesforce Help: External Services
  22. Salesforce Help: About Identity Resolution
  23. Salesforce Help: Enhance Data with Insights (Data 360)
  24. Salesforce Help: Data Streams in Data 360
  25. Salesforce Developers: Developer Edition with Agentforce and Data 360
  26. Claude API: Get started (Messages API request format)
  27. Claude API: Models overview
All 3 parts in this series
  1. Part 01Salesforce Interview Preparation: Apex, LWC, Triggers & System Design
  2. Part 02Salesforce Agentforce Interview Questions: Prompt Builder, Data 360 and AI
  3. Part 03Salesforce Developer Interview Questions: Apex, SOQL and LWC Answered
Written by

Avnish Yadav

AI Automation Engineer & Salesforce Developer

Salesforce developer since June 2018. I build AI agents, n8n workflows and Salesforce integrations, and write up what holds up in real use.

About meLinkedIn

Share
Discussion

Comments

Loading comments...

Add a comment

Comments are reviewed before they appear.