Prompt
What should I use to build an agent that can act in Salesforce?
Latest observation
Oct 9, 2026
OpenAI APIWeb search: off
To build an agent that can act in Salesforce, you generally want this stack:
-
An LLM agent framework: to reason, plan, and choose actions
Examples: LangGraph, OpenAI Agents SDK, Microsoft AutoGen, CrewAI -
Salesforce APIs / integration layer: to actually perform actions in Salesforce
Most common options:- Salesforce REST API for CRUD on records
- Salesforce Bulk API for large data operations
- Salesforce Tooling / Metadata APIs for config/dev tasks
- Apex / Flow / Platform Events if you need Salesforce-native automation
-
A secure tool-calling layer: expose only the actions the agent is allowed to do
For example:create_caseupdate_contactsearch_accountslog_tasksend_email
Each tool should validate inputs, enforce permissions, and log actions.
-
Auth and permissions:
- Use OAuth 2.0 connected app / service account
- Apply least privilege
- Prefer a dedicated integration user
- Consider field-level and object-level access rules
-
Guardrails / human approval for risky actions:
- Require confirmation before deleting records, sending emails, changing ownership, etc.
- Add policy checks and audit logging
Recommended practical setup
If you want the simplest robust approach:
- LangGraph or OpenAI Agents SDK for orchestration
- Salesforce REST API wrapped as tools
- OAuth connected app for authentication
- A policy/approval layer for sensitive actions
If you want the agent inside Salesforce
Use:
- Salesforce Flow + Apex for native workflows
- Or a service running externally that Salesforce calls via API/webhooks
Best choice by use case
- Basic CRUD assistant: LLM + Salesforce REST API
- Complex multi-step workflows: LangGraph + tools + approval steps
- Enterprise governance-heavy use: external orchestrator + Salesforce APIs + audit/policy engine
If you want, I can sketch a reference architecture or give you a minimal Python example for a Salesforce agent.