Dev.to Security 🔐 Cybersecurity 👁 0 📖 3 min read

Read, propose, write: three permission levels for an AI agent working on Salesforce opportunities

I wrote today, in Spanish, about how the word agent now gets attached to anything with an LLM behind it. One example in that post was an AI agent that reviews Salesforce opportunities with no movement in 30 days, checks

I wrote today, in Spanish, about how the word agent now gets attached to anything with an LLM behind it. One example in that post was an AI agent that reviews Salesforce opportunities with no movement in 30 days, checks the latest interactions and prepares follow-up actions. It could even update records, if it has authorization.

That last clause is where most of the design work lives. The way I split it is three permission levels, and the agent only moves up when the level below works.

The Spanish original, with the five concepts behind an agent (LLM, RAG, MCP, Skills and the agent itself): https://discover.egafutura.com/que-es-realmente-un-agente-de-ia/?utm_source=devto&utm_medium=referral&utm_campaign=amplify

Level 1: read

The agent can query Opportunity, its activities and OpportunityHistory. Nothing else.

  • Run it under its own integration user, with a permission set that grants read access only to the objects and fields it needs.
  • If it reaches Salesforce through MCP or another tool layer, expose read tools first. No tool that writes exists yet, so no prompt can trigger one.
  • Log every query it runs, with the filter it used.

What this level tells you is whether "no movement" is defined well. LastActivityDate, stage changes in OpportunityHistory and LastModifiedDate return different lists. LastModifiedDate also moves when a Flow, an integration or a bulk load touches the record, so it is a weak signal for sales activity.

Level 2: propose

Instead of editing the opportunity, the agent creates a Task for the opportunity owner with the suggested next step: WhatId pointing to the opportunity, OwnerId set to the owner, and a subject prefix that makes it obvious the agent wrote it.

A person reads it and decides. Two things become visible here that were invisible at level 1:

  • Exceptions. Some opportunities are quiet on purpose, for example when the customer asked to pick the conversation up later. If that is not stored in a field, the agent cannot know it, and the owner will tell you quickly.
  • Data gaps. If calls and emails live in a tool that does not create Salesforce activities, the agent will propose follow-ups on deals the team is already working.
SELECT COUNT()
FROM Opportunity
WHERE IsClosed = false AND LastActivityDate = null

If that count is high, fix the data before you move to level 3.

Level 3: write

Only now does the agent update records, and only a few fields, such as a next step or a follow-up date. Field-level security keeps the rest read-only for its user.

  • Encode the exceptions in the query, for example skipping records where a custom "resume on" date is in the future.
  • Test against a sandbox with realistic data before production.
  • Because the agent runs under its own user, LastModifiedById and field history show which changes it made and which a person made.

Why go level by level

The original post has a line that sums it up: a badly configured agent can be wrong at an impressive speed. The levels are a way to find the bad configuration while the cost is a wrong suggestion, not a wrong record.

At Vantegrate, the company I co-founded with Francisco Morales, we build AI agents for companies. EGA Futura, which I founded, builds a native ERP on Salesforce for mid-sized companies, and building enterprise software there is where we learned how much permissions, exceptions and data quality matter.

At level 3, a wrong filter means a bad update on every record in the list, all in the same minute.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.