Insights · Blog

Shipping LLM features on Salesforce without bypassing governance

Published

Generative AI demos are easy in a sandbox with unlimited API keys. Production Salesforce is different: you inherit platform limits, org-wide sharing, field-level security, and a compliance story auditors will ask about later. The following patterns help teams ship useful LLM-assisted workflows without turning every Lightning page into an ungoverned side channel.

Separate orchestration from the database of record

Call external models from a dedicated integration tier—Apex callouts, middleware, or a managed package boundary—not from anonymous browser keys embedded in LWC. Keep Salesforce as the system of record for persisted outputs, with clear attribution for who generated or edited machine-assisted text.

Treat prompts and completions as sensitive data

Log metadata (model version, temperature, latency) without storing full prompts in fields visible to broad profiles unless policy allows. If you must retain prompts for quality review, use restricted objects, retention windows, and encryption consistent with your data classification standard.

Governor limits still apply

Batch summarization across thousands of rows belongs in asynchronous processing with chunking and backoff—not synchronous Apex tied to a user save. Design idempotent retries and partial failure surfaces so a model timeout does not block core CRM transactions.

Human-in-the-loop for consequential actions

Use LLMs to draft emails, case summaries, or knowledge articles, but require explicit user acceptance before sending externally or updating regulated fields. Pair UI affordances with field history and feed tracking so downstream teams can reconstruct decisions.

Consent and transparency

Disclose when content is model-assisted, especially in customer-facing channels. Align with your marketing and legal teams on disclaimers and regional requirements before you enable features broadly.

Operational metrics that matter

Track acceptance rate of suggestions, edit distance before send, and escalation rate after AI touches. These metrics tell you whether the feature reduces load or creates review debt. Review them monthly with security and enablement stakeholders.

Done thoughtfully, LLM features can shorten handle time and improve consistency. Done without governance, they become the fastest way to leak context and erode trust. Choose the path your enterprise can defend in an architecture review—not only the path that wins a hackathon.

Testing strategy beyond happy-path prompts

Build evaluation sets from real (redacted) transcripts and edge cases your agents see weekly. Regression-test prompts when upstream model versions change; a five-point quality rubric beats subjective “looks fine” reviews from a single power user.

Cost controls and throttling

Meter token usage per feature and per business unit. Cap burst traffic during marketing campaigns so a spike in summarization requests does not exhaust API budgets that other teams rely on for batch jobs.

Enablement for service managers

Managers need scripts for coaching agents when suggestions are wrong: how to override, how to flag bad completions, and how to escalate model drift. Technology without manager air cover rarely sticks in contact centers.

Vendor and model diversification

Avoid single-vendor lock-in for critical workflows unless contractually unavoidable. Abstract provider-specific calls behind an interface so you can swap or multi-source models without rewriting Lightning components.

Closing the loop with customers

If customers ever see model-generated text, give them a lightweight feedback channel (thumbs up/down) routed into your quality backlog. Closing the loop tightens prompts faster than quarterly manual audits alone.

Governed AI on Salesforce is iterative: ship a narrow use case, measure, harden, expand. The enterprises that win treat governance as product work, not as paperwork that appears after the demo screenshots are taken.