AI agents can now make real changes inside Salesforce. Setup with Agentforce lets admins create objects, troubleshoot user access and draft flows by describing what they want (Salesforce Admins blog). The Salesforce DX MCP server and Salesforce's official Claude Code plugin let coding agents deploy metadata and run Apex tests (Salesforce Developers blog). Third-party MCP servers let general-purpose assistants edit fields, layouts and permissions in a connected org.
Speed is no longer the hard part. Control is. One wrong permission set, or a record-triggered flow that fires on every Account update, can cost a team a week of cleanup and a client's trust. This guide sets out the six controls we use before an agent touches an org, whether the agent is Agentforce, Claude Code or something else.
1. Start in a sandbox, never in production
An agent's first run in any org is exploration, and exploration belongs where mistakes are free.
- Developer or Developer Pro sandbox for configuration work: objects, fields, layouts, permission sets. Both refresh daily.
- Partial Copy sandbox when the change depends on real data patterns, such as a flow that branches on record type. It refreshes every 5 days.
- Full sandbox for the final check before release, because it mirrors production data and configuration. It refreshes every 29 days, so book it.
- Scratch orgs if your team works source-first. An agent can create one, build in it, and throw it away.
The rule is simple: agents write to sandboxes, and production only receives changes through a deployment that a human approved (section 4).
2. Give the agent its own identity and the least access it needs
Never let an agent work as your admin user. If it does, every change in the Setup Audit Trail carries your name, and you cannot tell your work from the agent's.
- Create a dedicated integration user for agent work, and grant permission sets scoped to the job. A layout change does not need Modify All Data.
- Connect through OAuth with a connected app or external client app, so access can be revoked in one place without touching anyone's password.
- If you use the Salesforce DX MCP server, list the exact orgs it may use. Salesforce's own docs warn against the ALLOW_ALL_ORGS setting and recommend naming only the orgs you want the server to reach (DX MCP server docs). Enable only the toolsets the task needs, too: the server ships over 60 tools.
3. Make the agent plan before it acts
A good agent workflow has three modes: explore (read only), plan (propose, change nothing) and act (apply an approved plan). The plan should list every metadata component it will touch, the current value, the new value, and how to undo it.
Then match the approval to the risk. A tiering that works for most teams:
| Tier | Examples | Who approves |
|---|---|---|
| 0: Read | Describe objects, query records, explain why a user can't see a field | No approval |
| 1: Low-risk change | Picklist value, list view, report, page layout in a sandbox | The person who asked |
| 2: Elevated change | Flows, validation rules, permission sets, sharing rules | A named reviewer |
| 3: Critical | Apex, data updates or deletes, anything bound for production | Reviewer plus org owner |
Salesforce builds part of this into Setup with Agentforce: the agent asks for confirmation before it changes anything, and you can approve or pause (Trailhead). Whatever tool you use, make approval a recorded step, not a click nobody remembers.
4. Ship agent changes the way you ship human changes
Agent-built work should reach production through the same path as a developer's work, with no shortcuts because "the AI already tested it".
- Retrieve the changed metadata into source control, so every change has a commit and a diff.
- Run a validation (check-only) deployment against production. Apex still needs 75% test coverage across the org, and the agent should write and run the tests.
- Approve the validated deployment, then quick deploy it. A validation can be quick-deployed for 10 days.
- Release inside an agreed window, and tell the client what changed.
If a change cannot be expressed as metadata in source control, such as a bulk data update, it is a Tier 3 change and gets its own plan, backup and sign-off.
5. Keep evidence you can hand to a client or an auditor
The Setup Audit Trail records what changed and who changed it, and you can download about six months of history. It does not record why, who approved it, or what the change looked like before. Consultants have to prove their work to clients, and admins have to prove it to auditors.
For every agent run, keep:
- the original request, in the user's words
- the plan the agent proposed, and who approved it, when
- the diff of every component changed
- the deployment ID and test results
- the rollback package (next section)
Store this outside the org, attached to the project or ticket it belongs to, so it survives sandbox refreshes.
6. Plan the rollback before you need it
Before an agent applies a plan, retrieve the current version of every component it will touch. That retrieved package is your rollback: redeploy it to undo the change.
Some changes cannot be fully undone this way, and the agent should flag them in the plan:
- Deleted custom fields go to the recycle area for 15 days, then their data is gone for good.
- Data updates and deletes need a backup taken immediately before the run.
- Sharing model changes can trigger long recalculations in large orgs.
Keep these behind Tier 3 approval.
A checklist you can use this week
| Control | Minimum | Better |
|---|---|---|
| Where the agent works | A Developer sandbox | A fresh scratch org or sandbox per task |
| Identity | A dedicated user with scoped permission sets | Per-client, per-org credentials in a vault, revocable in one click |
| Approval | Confirmation before each change | Tiered approvals with a named reviewer |
| Path to production | Validated deployment with tests | Source control, validated deploy, release window |
| Evidence | Setup Audit Trail | A per-run evidence pack attached to the project |
| Rollback | Manual retrieve before changes | Automatic pre-change snapshot for every run |
Where Cenario fits
We are building these controls into Cenario Terminal, a chat window where Salesforce admins and consultants describe a change in plain English and an agent explores the org, writes the plan, waits for the approvals the risk requires, applies the change in a sandbox and promotes it through a validated deployment. Every run becomes a completed task on the client's project in Cenario, with its evidence attached. Cenario Terminal is in development; if you want to see it on one of your own orgs, book a demo.
The controls in this guide work without Cenario too. Start with sections 1 and 2 this week, and you remove most of the risk. For the developer side, see our Claude Code for Salesforce development setup guide.
Questions people ask
Can Setup with Agentforce change my org without asking? No. Salesforce's Trailhead module says the agent asks for confirmation before it makes a change, and you can approve or pause.
Should an AI agent ever connect to production? Read-only access to production can help an agent understand a problem. Changes should still reach production only through an approved, validated deployment.
What should an AI agent never do in Salesforce without a human? Delete fields or records, change the sharing model or org-wide defaults, edit profiles directly in production, or run bulk data updates.
Sources
- 5 Use Cases to Get Started With Setup with Agentforce, Salesforce Admins blog
- Get to Know Setup with Agentforce, Trailhead
- Install and Configure the Salesforce DX MCP Server, Salesforce DX Developer Guide
- Headless Development with Skills and a Claude Code Plugin, Salesforce Developers blog