On this page
A service rep opens a Case with 34 emails, several internal comments, and two attempted fixes. An AI-generated summary says the customer’s issue was resolved by resetting a password. The actual resolution was a permission-set correction, and the Case is still waiting for customer confirmation.
The summary sounds polished. It is also wrong.
That is the production risk with Salesforce AI summaries: fluent output can hide missing context, conflicting evidence, or an unsupported conclusion. A safe design does not treat the model as the system of record. It treats the model as a drafting assistant inside a controlled Salesforce workflow.
This guide presents a practical pattern for Case summaries using grounded Salesforce data, explicit output rules, human approval, observable failures, and measurable quality.
The failure scenario
Assume a support team wants an AI-generated summary containing:
- the customer’s reported problem;
- troubleshooting already completed;
- the current status;
- the next owner and next action; and
- the confirmed resolution, but only when the Case is actually resolved.
The first design proposal is tempting: trigger generation whenever a Case changes, then write the response directly into Case.AI_Summary__c.
That design has four problems.
- The model can infer more than the evidence supports. A troubleshooting step in an email is not necessarily the final resolution.
- The grounding set can be incomplete. Attachments, inaccessible fields, or older interactions may not be included.
- A technically valid response can still be operationally harmful. An incorrect summary can mislead the next rep or reach the customer.
- A direct overwrite destroys review evidence. You cannot measure what the model proposed, what the rep changed, or why the draft was rejected.
The decision should be: generate a proposal, preserve its evidence, and require a person to accept or correct it before it becomes trusted Case content.
The production-safe pattern
Use a six-stage flow:
- Select an eligible Case. Generate only when the record has enough useful content and the user has the required feature permission.
- Resolve the grounding data in the user’s context. Include only approved fields and related interactions the running user is allowed to access.
- Generate a constrained draft. Tell the model exactly what it may state, what it must label as unknown, and what output structure to return.
- Store the draft separately from the approved summary. Preserve the template version, generation time, Case ID, status, and reviewer outcome.
- Require human review. The rep compares the draft with source records, edits if needed, and explicitly approves or rejects it.
- Monitor quality and failures. Track unsupported claims, missing facts, edit rate, rejection reasons, latency, and generation errors.
This is intentionally more work than “call the model and save the text.” The extra controls are what make the use case supportable after launch.
The model produces a draft. Salesforce records, business rules, and the reviewing rep determine what becomes trusted.
Define the grounding and access boundary
Start with the minimum data needed to answer the summary questions. A reasonable first version might use:
- Case Subject and Description;
- Status, Priority, Type, Product, and Reason;
- public Case comments and selected emails;
- troubleshooting steps recorded in structured fields; and
- a resolution field only when the Case is closed or otherwise meets your resolution rule.
Do not include every available field simply because the model accepts more context. More input increases cost and latency, makes conflicting evidence harder to resolve, and can expose data that is irrelevant to the task.
Salesforce documents that secure grounding in the Einstein Trust Layer respects the executing user’s permissions and field-level security. That is a useful platform control, but it is not a substitute for testing. Verify the resolved prompt with a least-privileged service user, not only a System Administrator.
There are also source limitations to design around. Salesforce’s current Case-grounding guidance notes that attachments do not appear as attachment content in Case comments, encrypted fields are not supported for grounding, and longer Case feeds increase token usage and generation time. If an important diagnostic result lives only inside a PDF, the summary must not pretend it saw that result.
A practical eligibility rule can stop generation when required evidence is missing:
Generate a draft only when:
- Subject or Description contains usable text
- at least one approved interaction source is available
- the running user can access every required source field
- the Case is not marked as containing excluded regulated data
For broader access design, use the layered checks in the SFX guide to Salesforce Security and Sharing.
Write a prompt contract, not a vague request
“Summarize this Case” leaves too many decisions to the model. A production prompt should define the evidence, the allowed conclusions, the output structure, and the behavior for missing or contradictory information.
The following is an implementation-neutral starting point. Replace the placeholders with Prompt Builder resources appropriate to your template type and licensed features.
ROLE
You draft internal support Case summaries for a service rep.
EVIDENCE RULES
- Use only the Salesforce data supplied below.
- Do not invent a cause, resolution, customer statement, date, or owner.
- Treat emails and comments as reports, not automatically confirmed facts.
- State a resolution only when the supplied Case status is Closed and
a confirmed resolution is present.
- If sources conflict, say "Conflicting information requires review"
and name the conflicting points without choosing one.
- If a required fact is absent, write "Not confirmed".
OUTPUT
Return these sections in this order:
1. Customer issue
2. Work completed
3. Current status
4. Next action and owner
5. Confirmed resolution
Keep the complete response under 180 words. Use plain text.
CASE DATA
Status:
Subject:
Description:
Approved interactions:
Confirmed resolution:
Three details matter here:
- Evidence rules prevent confident interpolation. “Not confirmed” is safer than a plausible guess.
- Business rules remain outside the model. The prompt receives
ApprovedResolutiononly when deterministic Salesforce logic says the field is eligible. - Stable sections make review and measurement easier. A reviewer can quickly notice a missing next action or an unsupported resolution.
Salesforce provides a standard Summarize Case prompt template for supported Service configurations. Its official setup guidance similarly separates the issue, completed steps, upcoming step, and resolution behavior. Where that standard template fits, version and customize it instead of rebuilding every element from scratch.
Keep a human in the approval loop
Human review should be a real workflow state, not a sentence in a governance document.
Create a draft record or equivalent durable state with fields such as:
| Field | Purpose |
|---|---|
Case__c |
Connects the draft to its source Case |
Generated_Text__c |
Preserves the original model output |
Reviewed_Text__c |
Stores the rep’s corrected version |
Template_Version__c |
Identifies which prompt behavior ran |
Generated_By__c |
Records the initiating user or process |
Review_Status__c |
Draft, Approved, Rejected, or Failed |
Rejection_Reason__c |
Captures a usable quality signal |
Approved_By__c and Approved_At__c |
Creates review accountability |
The reviewer experience should:
- label the content as AI-generated;
- show the source Case beside the draft;
- make editing easy;
- provide explicit Approve and Reject actions;
- prevent an unreviewed draft from being used as a customer-facing response; and
- preserve both the original and reviewed text.
For a low-risk pilot, generation can begin with a screen Flow or Lightning action the rep deliberately launches. Once the workflow is proven, you can consider background generation for eligible Cases—but keep approval explicit.
If you use Flow for orchestration, follow the same fault-path discipline described in the Salesforce Flow interview scenarios: capture the failed element, record ID, user, and actionable error details rather than silently swallowing the failure.
Design failure handling before launch
AI failures are not limited to HTTP errors. Treat incorrect, incomplete, and unusable output as failure modes too.
| Failure | Safe behavior | Evidence to retain |
|---|---|---|
| Prompt resolution fails | Show “Draft unavailable”; leave approved summary unchanged | Case, user, template, error category |
| Required grounding is empty | Do not call the model; explain what data is missing | Eligibility rule that failed |
| Output is blank or malformed | Mark generation Failed; allow retry after review | Raw response metadata and template version |
| Trust or harmful-content warning appears | Block approval pending review | Warning category, not sensitive prompt content in general logs |
| Sources conflict | Keep the conflict statement in the draft | Conflicting source references |
| Rep rejects the draft | Preserve it; require a rejection reason | Original draft, reason, reviewer |
| A new template performs worse | Deactivate it and restore the previously approved version | Version-level quality metrics |
Do not automatically overwrite the last approved summary on a retry. A failed or worse generation should never destroy trusted content.
Prompt Builder supports saved versions and allows only one active version at a time. Salesforce also notes that a version that has been activated becomes immutable. Use that behavior as part of your release process: test a new version, activate it deliberately, monitor it, and retain the prior version information for recovery.
Build a verification plan
Previewing one clean Case is not enough. LLM calls can produce different responses for the same resolved prompt, and Salesforce explicitly recommends reviewing every generated response for accuracy.
Create a test set that includes:
- A normal resolved Case with clear issue, steps, and resolution.
- An open Case where the draft must not claim a resolution.
- Conflicting emails and comments where the draft must flag the conflict.
- A Case with missing Description where the output uses “Not confirmed.”
- A long Case history to expose truncation, latency, and irrelevant context.
- A Case with important attachment-only evidence to confirm the summary does not invent attachment contents.
- A least-privileged user who cannot access one sensitive field.
- Sensitive data to inspect masking behavior in the resolved prompt and response.
- Adversarial Case text such as “ignore previous instructions,” treated as data rather than instruction.
- A service failure to verify the rep sees a useful fallback and trusted content remains unchanged.
For each Case, reviewers should score:
- factual accuracy;
- unsupported claims;
- missing critical facts;
- correct status and next action;
- security exposure;
- readability; and
- whether the draft is safe to approve after ordinary review.
Prompt Builder lets you inspect the resolved prompt with real CRM data before generation. Use that view to confirm merge fields, access behavior, masking, and the exact data sent for generation. Then test the same user path that production will use; a Preview success alone does not prove the runtime integration is correct.
Launch with measurable quality gates
“The summaries look good” is not an operating metric. Define a small pilot, a baseline, and exit criteria before expanding.
Useful measures include:
- approval rate: percentage accepted without rejection;
- edit rate: percentage changed before approval;
- material correction rate: percentage requiring a factual or security correction, not just style;
- unsupported-claim rate: drafts containing a statement not supported by grounded evidence;
- critical-omission rate: drafts missing the issue, status, owner, or next action;
- median review time: rep time from draft display to approval or rejection;
- generation latency and failure rate: operational reliability;
- usage by queue and Case type: where the feature adds value or creates risk; and
- customer-impact incidents: any approved summary that later proves materially wrong.
A reasonable rollout is one queue, one Case type, and a defined group of trained reviewers. Expand only when the material correction rate and unsupported-claim rate remain below the thresholds agreed with Service, Security, Legal, and Data Governance owners.
The key trade-off is simple: automatic publishing saves more seconds, while explicit review protects more trust. For Case summaries—where omissions and false resolutions can affect support decisions—the review step is usually the right first production boundary.
The design in one sentence
Ground the model on the smallest permitted Case data set, constrain what it can conclude, store its output as a versioned draft, require human approval, and measure factual corrections before scaling.
That answer is useful beyond this one feature. It is also a strong way to explain a Salesforce + AI scenario in an architecture review or interview: connect the model to a business workflow, enforce the data boundary, keep a person responsible for the final action, and prove the outcome with operational metrics.
Need help adapting the pattern to your org’s data, permissions, and review process? Contact SFX Support or use Ask Krrish to work through the design.
Sources
- Set Up the Summarize Case Prompt Template — Salesforce Help
- Einstein Trust Layer — Salesforce Help
- Ground with Cases — Salesforce Help
- Review, Revise, and Repeat: Ensure That a Prompt Template Is Effective — Salesforce Help
- Activate and Deactivate Prompt Templates — Salesforce Help
- Troubleshoot Prompt Builder — Salesforce Help
Still working through a Salesforce problem?
Bring the context, the error, or the interview scenario. SFX Support will help you reason through it step by step.