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?

Design the permission model before the screens in occupational health cases (opens in a new tab)

You will see how to split an occupational health case across objects so an employer sees fitness outcomes but never clinical detail.

Why read this

You will also see why governed picklists, data-driven thresholds and an external community help with privacy and audit.

Occupational health case

  • Case
  • Encounter
  • Exposure event
  • Restriction
  • Surveillance result
  • Employer account
A single case is split into separate objects so each role sees only its own slice

The article frames occupational health case management as a permission problem. Five roles touch each case, and the employer may learn whether a worker can lift or drive but not why. Spreadsheets and shared drives fail because they cannot enforce who sees what or show afterwards who looked.

The author argues against a single large record. The case should be split into objects for the encounter, exposure event, restriction, surveillance result, employer account and worker record, with a junction object where the employer of record differs from the work site. Restrictions carry start and end dates and a review owner, so expiry becomes a tracked state. Record types and field-level security then separate employer-visible outcomes from clinical detail.

Free text classification is treated as a privacy risk as well as a reporting problem, because a diagnosis typed into a notes field escapes every Sharing Rule. Governed picklists close that gap. Regulated rules such as blood lead level monitoring thresholds and testing frequency should live as records rather than code, so regulatory changes become configuration edits and reports draw on the same data as the rules. Correspondence is logged as case activity, and documents carry version history, classification and retention rules.

For employers and referring clinicians, the article recommends an external community rather than a hidden-field copy of the internal app, which also avoids consuming internal user licences. Migration is where legacy duplicates and inconsistent classifications surface, so it should be rehearsed in a full sandbox and validated against historical caseloads. The closing advice is to settle the permission model first, since it is the expensive part to retrofit.

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

Worth reading?

Recommended

Fixing the field-access error in Agentforce Answer Questions with Knowledge (opens in a new tab)

You will learn the five checks to run when an Agentforce Service Agent fails with a field-access error while answering from Knowledge articles, and the order to run them in.

Why read this

The piece is a practical troubleshooting guide rather than new platform news.

  1. Assign Data Cloud User Permission Set
  2. Grant Read on Knowledge and mapped fields
  3. Enable Allow View Knowledge
  4. Verify data space access
  5. Confirm search index is Ready
The five checks to run in order when the field-access error appears

The article covers an error that appears when the Answer Questions with Knowledge action runs against an Agentforce data library: the agent’s running user cannot read one or more fields the library depends on. The usual causes are missing permissions, missing field-level security, or an incomplete Data Cloud setup. The agent runs as the user with the Einstein Agent User profile, and every object, field and Data Cloud resource the data library touches must be readable by that user.

The guide gives five checks in order: confirm the Data Cloud User Permission Set is assigned to the agent user, confirm Read access on the Knowledge object and every mapped field, enable Allow View Knowledge, verify the user’s data space access in Agent Studio, and confirm the search index for the Knowledge data library is Ready. It also recommends a dedicated Permission Set for the agent user, re-auditing field-level security whenever the library changes, granting least privilege, and testing as the agent user rather than as an admin.

The author notes that the source material contained no code, and that the link between an unready search index and this specific message is not confirmed in the source, so it should be checked as a separate cause.

Read the original at InfallibleTechie (opens in a new tab)

Worth reading?

Recommended

Securing Salesforce to LLM integrations with Apex and scoped permissions (opens in a new tab)

Readers will learn how to enforce least-privilege access when calling external language models from Apex, including proper use of WITH USER_MODE, Named Credentials, and response validation.

The article argues that connecting Salesforce to a large language model takes more than an API key. The integration should control which records and fields the model can reach, protect credentials, minimize the data sent, and stop AI output from triggering unauthorized actions. It proposes an architecture with five parts: Salesforce enforcing permissions, Apex or middleware handling authorization and request building, Named Credentials managing the endpoint and authentication, the LLM API generating output, and a validation layer checking results before they are shown or used. A support assistant summarizing Cases, for example, needs only subject, description and status, not full contact or financial history. Authorization should happen before data is sent to the model and again before any business action follows its response.

The piece distinguishes several permission mechanisms that must be combined rather than relying on OAuth scopes alone: integration identity, object permissions, field-level security, record sharing and application-level restrictions. In Apex, declaring a class with sharing does not enforce object and field permissions, so the article recommends WITH USER_MODE on supported SOQL queries, with Security.stripInaccessible() as an alternative for removing inaccessible fields. For credentials, it recommends never hardcoding API keys and instead using External and Named Credentials, granting access through Permission Sets, and keeping separate configurations for each environment. A sample Apex class summarizes a Case through the OpenAI Responses API, querying only needed fields, sending a minimal payload, and checking the HTTP status and response structure before returning text.

The article also covers defending against prompt injection, since record text from emails or tickets may contain malicious instructions. Its safeguards include treating retrieved text as untrusted, limiting fields and records, avoiding unrestricted query or tool access for the model, checking proposed operations against a server-side allowlist, requiring human approval for consequential changes, and filtering documents by user access before they reach the model in retrieval-based designs. For scale, it suggests asynchronous processing with Queueable Apex or middleware for longer tasks, bounded retries with backoff only for suitable errors, request identifiers to prevent duplicate actions, token and latency monitoring, and cache designs that respect permission changes. The conclusion urges starting with a read-only use case and adding write capabilities only after authorization and failure handling are tested.

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

Worth reading?

Must-read

Configuring permissions and security guardrails for Agentforce and Prompt Builder (opens in a new tab)

Readers will learn how to structure Permission Sets and groups for different AI roles, understand how field-level security applies at runtime, and implement human-in-the-loop controls for autonomous agents.

Generative AI Security Setup

  • License and Permission Set Allocation
  • Field-Level Security Inheritance
  • Agentforce Action Boundaries
Breakdown of the three core pillars for AI governance

The article outlines a structured approach to managing generative AI access by separating feature availability through Permission Set Licenses from functional capabilities via Permission Sets and Permission Set Groups. It defines four core roles, including an AI System Administrator, Prompt Template Author, Standard End-User, and Agentforce Runtime User, emphasizing that bundling permissions into groups prevents security drift when users change departments.

When prompts execute on record pages, Prompt Builder enforces security before data reaches the large language model. The system validates object read access, applies field-level security by nullifying restricted merge fields, and respects Sharing Rules. A practical example shows how a customer support representative without access to a profit margin field receives a blank value, ensuring sensitive financial data never leaves the organization or enters the model cache.

For autonomous execution, Agentforce supports three action modes ranging from full autonomy to requiring explicit user approval. The piece recommends starting with safe defaults that allow read-only lookups while triggering human confirmation for write operations. It demonstrates a human-in-the-loop pattern where an agent drafts an email via a flow, leaving the final review and send capability restricted to a human user.

Finally, the guide provides a deployment checklist covering permission group assembly, field security verification, action boundary configuration, and Einstein Trust Layer settings like zero data retention and data masking to ensure compliance before production rollout.

Read the original at Salesforce Break (opens in a new tab)

Worth reading?