The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Recommended

Staging an AI agent's Salesforce access in three permission levels (opens in a new tab)

You will learn a staged way to grant an AI agent access to Opportunity data: read first, then propose tasks, then write a few fields.

Why read this

You will also see how the staging exposes data gaps and undocumented exceptions before any record changes.

  1. Level 1: read Opportunity and activities
  2. Level 2: propose Tasks for the owner
  3. Level 3: write a few fields
The agent gains write access only after each lower level works

The author describes an AI agent that reviews Salesforce Opportunities with no activity for 30 days, checks recent interactions and prepares follow-up actions. The design question is what the agent is allowed to do, and the author splits this into three permission levels that the agent moves through only once the level below works.

At level 1 the agent only reads Opportunity, its activities and OpportunityHistory. It runs under its own integration user with a Permission Set limited to the objects and fields it needs, and any tool layer such as MCP exposes read tools only. Every query is logged with its filter. This level shows whether no movement is defined well, since LastActivityDate, stage changes in OpportunityHistory and LastModifiedDate give different lists, and LastModifiedDate also moves when a Flow, integration or bulk load touches a record.

At level 2 the agent proposes rather than edits, creating a Task for the Opportunity owner with the suggested next step, WhatId set to the Opportunity, OwnerId set to the owner and a subject prefix that marks it as agent-written. A person decides what happens. This level reveals exceptions, such as deals deliberately paused, which the agent cannot know unless they are stored in a field, and data gaps, such as calls logged outside Salesforce. The author suggests counting open Opportunities with no LastActivityDate and fixing the data before moving on.

At level 3 the agent writes a few fields, such as a next step or follow-up date, with field-level security keeping the rest read-only. Exceptions are encoded in the query, for example skipping records with a future resume date, and changes are tested in a sandbox with realistic data. Because the agent has its own user, LastModifiedById and field history separate its changes from people’s. The author’s point is that a wrong filter at level 3 corrupts every matching record at once, so the staging keeps mistakes cheap.

Read the original at dev.to (opens in a new tab)

Worth reading?