DavidGadyan

AI & Agents · AI ERP & SaaS · Security & Compliance

Hybrid AI for Salesforce: Claude, ChatGPT & Private LLMs, One Router

By David Gadyan · Published · Updated

AI on your Salesforce data, safely: Salesforce records flow through a policy router to Claude or ChatGPT with PII masked, to a private LLM that stays in the network, or back to Salesforce at no model cost

Use AI on Salesforce data without moving off Salesforce, overpaying for one model or leaking customer data. A router sends each request to Salesforce itself, Claude, ChatGPT or a private LLM inside the client's network, chosen by sensitivity, stakes and cost, and masks personal data before anything leaves. On top: an Apex and Flow review that returns fixed code and tests, a revenue agent that works dormant leads with fact-checked drafts, and a sandbox refresh and migration planner. Nothing is written to Salesforce until a person approves it.

The problem

Teams hiring for Salesforce and AI work keep describing the same problems. Legal worries that customer data will leak to an outside model. Finance worries about model bills and being locked into one vendor. Admins worry that AI-written Apex and Flows look fine and then break in production. Sales has thousands of old leads nobody works, and every sandbox refresh or org migration eats days of admin time.

This project answers each of those with something working, not slides.

The product in use

Walkthrough of the router, the Apex review, the revenue agent and the refresh planner, recorded in real time with the model waits shown at 8× speed.

What I built

AI router: a patient-intake record is routed to the private LLM because it contains medical data, and the decision trace shows it stayed inside the network

A router that decides where data may go. Every request is checked for sensitive fields. Medical and card data goes only to a model inside the client's network. The decision trace shows which policy matched and why.

Masked prompt: names, e-mails and phones replaced with tokens before Claude sees the record, then restored in the answer

Masking before anything leaves. Names, e-mails and phone numbers are replaced with tokens before Claude or ChatGPT see the record, then put back in the answer. Salesforce stays the system of record and the best model still does the job.

Model comparison: the same Salesforce opportunity assessed by Claude Opus, Claude Haiku and a private model, with latency and cost per answer

Cost decided on data, not a vendor pitch. A compare view runs the same record across every connected model, so the routing choice rests on real cost and quality. Adding or swapping a provider is a setting, not a rebuild.

Apex review: findings on a payment class, then the corrected Queueable code shown as a diff

Apex and Flow review that fixes the code. Fixed rules catch queries inside loops, missing sharing and field security, hard-coded IDs and keys. Claude then confirms each finding, adds the ones rules cannot see, and returns corrected code with a bulk test class.

Refresh and migrate: record reconciliation between source and target, and Claude's architect review with a runbook

Sandbox refreshes and migrations, planned. After a refresh someone has to mask personal data, point integrations at test endpoints, stop scheduled jobs and reload test data, usually from memory. The planner builds that checklist from the org's own metadata, orders the data seeding so lookups resolve, maps fields for an org-to-org move, reconciles record counts, and has Claude review the plan and write the runbook.

People stay in control. The revenue agent scores and tiers each lead, picks a next best action and drafts a short, specific e-mail. Any draft that cites something not in the CRM goes back for rewrite, and nothing is sent or updated until a person approves it. Every AI decision is logged.

Related projects

← All projects