All Posts
· Laine · 8 min read

How to Connect Claude to Salesforce (the Safe Way)

Connect Claude to Salesforce safely: dedicated infrastructure, JWT auth, scoped keys, and sandbox-first deploys — not admin credentials on a laptop.

AICRMSalesforceTutorial
Sentinel cover graphic: Connect Claude to Your Salesforce Org, Safely

If you want to connect Claude to Salesforce, you can get something working in an afternoon — and that’s exactly the problem. The quick version of this connection puts admin credentials on a laptop and gives an AI unaudited write access to your production org. It works right up until you can’t answer “what did it change?” This tutorial walks through the safe way: dedicated infrastructure, JWT authentication, scoped keys, and a sandbox-first path to production.

The position this post takes: the connection layer is the safety layer. Get it right once and everything your AI builds afterward inherits it. Get it wrong and no amount of careful prompting saves you.

What “connecting Claude to Salesforce” actually means

Claude on its own can’t touch your org. It can write flawless Apex all day, but writing code and doing things to a live system are different capabilities. The bridge is MCP — the open protocol that lets an AI call external tools. Connect Claude to something that can talk to Salesforce’s APIs, and suddenly “write me a trigger” becomes “write it, deploy it to the sandbox, run the tests, and promote it.”

So the real question isn’t whether Claude can operate Salesforce — it can. The question is what sits between them, because that middle layer decides whether you have an accountable development pipeline or an unsupervised admin session.

The unsafe way (and why people do it anyway)

The tempting shortcut looks like this: install a local MCP server on your laptop, hand it your Salesforce username, password, and security token — often an admin’s — and start prompting. It works in minutes, which is why people do it.

Here’s what you’ve actually built. Credentials sitting in a config file on a machine that sleeps, travels, and gets stolen. An AI acting as a full admin, with no separate identity — every change it makes is indistinguishable from you clicking around Setup. No independent audit trail beyond what you remember prompting. No snapshot to roll back to. And if a second person on your team does the same thing on their laptop, you now have two unaudited admins racing each other into one production org.

None of that is hypothetical AI misbehavior. It’s just bad operations — the same mistakes we stopped accepting from human developers years ago, reintroduced because the setup was quick.

The safe way: four requirements

Whatever tooling you use, a safe Claude-to-Salesforce connection has four properties. This is the checklist that matters more than any product name.

1. A dedicated place for the connection to live

The connection should run on infrastructure whose only job is this — a dedicated server, not somebody’s laptop. That gives you a stable identity (one IP, one host) for the org to trust, credentials that live in one hardened place instead of scattered config files, and a machine that’s always on, so logs and snapshots don’t depend on whose MacBook is awake.

2. JWT authentication, not passwords

Salesforce supports the JWT Bearer Flow for server-to-server auth, built on an External Client App with a certificate: the server proves its identity with a signed token instead of a stored password. No password in any config file, no security token to rotate, access controlled by which user profiles you authorize. This is the connection pattern Salesforce built for exactly this job — a trusted system integrating with the org — and it’s what your AI’s bridge should use.

3. Scoped keys, so access has tiers

“Connected” shouldn’t mean “full control for everyone.” The AI side of the bridge should use its own keys with real tiers: read keys for querying and exploring — hand those out freely to your whole team — and write access that’s deliberately scarce. On Sentinel, that scarcity is structural: one write key per org at a time, unlimited read keys, so multiple people’s AI sessions can’t collide in the same org even if they try.

4. A recoverable path to production

Finally, the connection should enforce how changes reach production: deploys go to a sandbox first, tests are required, a snapshot is taken before anything ships, and every action lands in an audit log with who, what, and when. That’s the difference between “the AI changed something” and “here’s the change, here’s who made it, here’s the undo button.” The full mechanics are in how AI-written changes stay safe.

Step by step: the safe connection, end to end

Here’s the shape of a correct setup, whether you assemble it yourself or let Sentinel do it:

Step 1 — Stand up the bridge infrastructure. A dedicated VM with HTTPS and a real domain. On Sentinel this is the part you never do by hand: buying a Sentinel provisions the VM, static IP, DNS, and SSL automatically, in minutes.

Step 2 — Create the External Client App in Salesforce. In your org, set up the External Client App with a certificate for JWT, and authorize the profiles that should be able to authenticate. Use a permanent, full-access integration identity — a dedicated System Administrator user — so your AI isn’t riding on some employee’s login that gets deactivated when they leave.

Step 3 — Store credentials on the bridge, never in the AI. The consumer key and private key live on the VM. Claude never sees them — it holds only the VM’s address and its own scoped key. This is the hub model: if a credential rotates, you update the VM once, and nothing on the AI side changes.

Step 4 — Connect Claude over MCP with a read key. Point Claude at the bridge and start read-only. Ask it to describe your schema, query some records, summarize your automation. This proves the whole chain — Claude → bridge → org — with zero risk.

Step 5 — Take the write key and ship something small. Switch to write access and give it a bounded first build. Watch the pipeline do its job: sandbox deploy, tests, snapshot, promote, audit log entry. A small first automation is perfect for this.

Step 6 — Bring in the team. Read keys for everyone, the write key passed like a baton. Now you have multi-user AI development against one org without chaos — which is the point of doing all this correctly.

Common mistakes to avoid

Four errors show up constantly in AI-to-Salesforce setups, and each one quietly undoes a piece of the safety you built:

Using a free Integration-license user as the run-as identity. It looks like the “proper” choice — a dedicated API-only user at no license cost — but those users are effectively read-only for major operations, and your AI’s deploys will fail in confusing ways. Use a real System Administrator identity that’s permanent by design. This one bites people because it almost works.

Authorizing with a person’s login instead of a role. If the connection authenticates as Dave, everything breaks the day Dave leaves — and until then, the audit trail can’t tell Dave’s clicks from the AI’s changes. The integration needs its own identity, full stop.

Skipping the sandbox “just this once.” The pipeline only protects you if it’s not optional. The whole value of enforcing sandbox-first at the connection layer — rather than as a team habit — is that there is no “just this once.”

Letting the bridge and credentials sprawl. One VM, one credential store, one audit log. The moment a second copy of the private key exists on someone’s laptop “for convenience,” you’re back to the unsafe setup with extra steps.

What about rate limits and API usage?

A reasonable worry: won’t an AI hammering your org burn through API limits? In practice, development work is light on API calls compared to, say, a data-sync integration — a deploy is a handful of Metadata API calls, a query is one. Salesforce’s daily API allowances on Enterprise editions are far above what AI-driven development consumes. The place to pay attention is bulk data operations: if you ask your AI to update a hundred thousand records, that’s real API volume, and well-written bulk-safe code (which is what it should be writing anyway) keeps those operations efficient. The connection layer can also rate-limit for stability — protection for the infrastructure, not a gate on what you’re allowed to build.

The test that tells you if you did it right

Six months from now, someone will look at a trigger or a field and ask: where did this come from? The unsafe setup answers with a shrug. The safe one answers with a log line — this change, this date, this session, deployed sandbox-first, tests green, snapshot available.

If your connection can answer that question, you built it right. If it can’t, it doesn’t matter how good the AI is.

You can assemble all four requirements yourself — VM, External Client App, key tiers, pipeline — and if you do, this checklist is the spec. Or you can get the whole thing as the product: that’s exactly what a Sentinel is, the safe connection between your AI and your CRM, provisioned in minutes with the safety layer already on.

Connect your AI to Salesforce the safe way →

Ready to see what AI can do for your business?

Start a Conversation