← All insights

From Profiles to Capabilities: A Least-Privilege Authorization Framework for Salesforce

Strong authentication proves who is logging in. It says nothing about what that identity can do after login. This guide moves a profile-heavy org to a least-privilege capability model, using one example org so each design choice has a concrete place to land.

Strong authentication proves who is logging in. It says nothing about what that identity can do after login. A user with MFA and Modify All Data is still a large risk. So is an integration user with a narrow OAuth scope and a System Administrator profile.

This Insight shows how to move an org from profile-heavy access to a least-privilege capability model. It uses one example org throughout, so each design choice has a concrete place to land.

1. The example org

The org runs free-zone operations. It manages leads, accounts, license applications, compliance documents, invoices and payment status. Internal teams, channel partners, customers, a payment integration and a service agent all use it. All sensitive objects have a Private org-wide default.

This is the target state. The sections that follow explain each part of it.

PersonaLicense and baseline profileAccess packageAssignment
Ops SpecialistSalesforce, Minimum AccessPSG_Ops_SpecialistUAP: Department = Operations (higher Order value)
Operations LeadSalesforce, Minimum AccessPSG_Ops_Lead (specialist sets plus Queue_Management)UAP: Department = Operations, Role Level = Lead (lower Order value)
Compliance ReviewerSalesforce, Minimum AccessPSG_Compliance_ReviewerUAP: Department = Compliance
Finance AnalystSalesforce, Minimum AccessPSG_Finance_StandardUAP: Department = Finance (higher Order value)
Finance ApproverSalesforce, Minimum AccessPSG_Finance_ApproverUAP: Department = Finance and Approver Level = approved value (lower Order value)
Channel PartnerPartner Community, external partner baselinePSG_Partner_UserUAP on partner user type
CustomerCustomer Community, external customer baselinePSG_Customer_UserRegistration handler
Payment integrationSalesforce Integration, Minimum Access - API Only IntegrationsIntegration_Payment_UpdateDirect, through CI/CD
Service agentEinstein Agent, Einstein Agent UserAgent action sets for status checks and request creationFixed agent user

The Order labels mark which policy wins when a user matches both policies in a pair. “Automate assignment with User Access Policies” explains the rule.

2. Authorization is a stack, not a setting

For operations that enforce the running user’s access, review four layers: org and session controls, object permissions, field permissions, and record access. The user must pass every layer, and a grant at a lower layer cannot repair a gap at a higher layer. System-context automation requires a separate review, covered in “Enforce on the server” and “Agentforce agents”.

LayerMechanismsQuestion it answers
1. Org and sessionUser and feature licenses, login hours, login IP ranges, session security, system permissionsCan this identity get in, and is the feature available to it at all?
2. Object accessCreate, Read, Edit, Delete; View All and Modify AllCan it act on this type of record?
3. Field-level securityField Read and EditWhich attributes can it see or change?
4. Record sharingOWDs, role hierarchy, sharing rules, teams, territories, manual and Apex managed sharing, restriction rulesWhich specific records can it see or change?

If a user has no object Read, no sharing rule can show them a record. If they have object Read, they still see only the records that sharing opens to them.

Two errors come from ignoring the stack. The first is treating FLS as a UI setting. A field removed from a page layout is still available through reports, list views, SOQL, the APIs and automation that runs as the user. Use field-level security to enforce the access your data classification requires.

The second error is trying to subtract access. Permissions are additive, so a “powerful base profile, then remove what is not needed” design fails as soon as another set grants the same permission again. Design top-down from business trust boundaries, then test bottom-up with real personas.

3. Profiles become a thin baseline

Every user has exactly one profile. That makes the profile a good place for settings that are one-per-user and change rarely. It is a bad place to model job roles, which change often and overlap.

Using profiles for roles leads to proliferation: dozens of near-identical clones with undocumented differences. Profile deployments also carry risk. A profile retrieve contains only the permissions for components in the same manifest, so a deployment can look complete and still miss or change access. The table shows which settings stay on the profile and which move to permission sets.

SettingBaseline profilePermission sets and groups
Login and sessionLogin IP ranges, login hours, session security levelNot used
Presentation defaultsDefault record types, page layout assignments, default appNot used
Data accessNone beyond Minimum AccessObject CRUD, FLS, custom permissions
Functional accessNoneApex class access, Flow access, external credential principal access
System permissionsNoneGranular system permissions, in separate privileged sets

Choose a minimal profile that is compatible with the user’s license. Keep the profile’s baseline grants minimal, and add business capabilities through permission sets that you can name, own, review and remove.

4. Two release updates to act on

Two recent authorization updates support this model. They have different timing, so review each one separately in your org’s Release Updates page.

Profile Filtering, enforced in Winter ’27

The Enable Profile Filtering release update was first available in Summer ’26 and is enforced in Winter ’27. After enforcement, a user sees only their own profile name unless they have View All Profiles. This removes an easy reconnaissance path for a compromised account.

Three details matter for architects:

  • View All Profiles is not the only bypass. Customize Application, Manage Users, Manage Profiles and Permission Sets, Create and Set Up Experiences, Manage Customer Users, Manage External Users and Delegated External User Administrator also let a user see all profiles. Review who holds these permissions too.

  • Logic that reads another user’s profile name can fail without an error. Formulas, flows and Apex that check values such as Owner.Profile.Name can return empty for users without the permission. Checks on the running user’s own profile, such as $Profile.Name, keep working.

  • Login flows need View All Profiles. With Profile Filtering on, admins need View All Profiles to create or edit login flows. Grant it through a permission set to the admins who maintain them.

View Setup Audit Trail, enforced in Spring ’27

Reading the Setup Audit Trail has required View Setup and Configuration, which exposes far more than audit history. This update adds a dedicated View Setup Audit Trail permission. Salesforce preserves existing access automatically, so nobody loses access. The update is an opportunity, not a forced change: auditors can now get audit history without broad Setup visibility. Use these queries to find who holds it today:

-- Profiles and permission sets with audit-trail access
SELECT Id, Name, IsOwnedByProfile, Profile.Name,
       PermissionsViewSetup,
       PermissionsViewSetupAuditTrail
FROM PermissionSet
WHERE PermissionsViewSetupAuditTrail = true
ORDER BY IsOwnedByProfile DESC, Name

-- Active users who receive it, and whether the grant expires
SELECT Assignee.Name, PermissionSet.Name,
       PermissionSet.IsOwnedByProfile, PermissionSet.Profile.Name,
       PermissionSetGroup.DeveloperName, ExpirationDate
FROM PermissionSetAssignment
WHERE PermissionSet.PermissionsViewSetupAuditTrail = true
AND Assignee.IsActive = true

In the Developer Edition org used for this example, checked on 20-10-2026, the first query returned 28 permission-set records. The second returned three active users, all with profile-based audit-trail access: System Administrator, Analytics Cloud Integration User and Analytics Cloud Security User. Your counts will differ. The point is that inherited profile grants exist even in a new org. A profile-owned permission set has a system name such as X00e…, so read Profile.Name to see which profile it belongs to.

Then remove View Setup and Configuration from roles that need only audit evidence, and give them a dedicated permission set with View Setup Audit Trail.

5. Design permission sets around capabilities

Atomic permission sets

An atomic permission set represents one business capability. You can name it, give it an owner and audit it. You can also review and deploy it as a defined unit, while checking the impact on every group and persona that uses it. Build the boundary from business purpose and change lifecycle, not job titles. Permissions that change together belong together. Permissions with different risk, or different owning teams, belong in separate sets. The table compares capability-based sets with common anti-patterns.

DomainCapability-based designAnti-patternResult of the anti-pattern
Application intakeApp_Intake_Create: Create and Edit on applications, Edit only on intake fieldsSales_And_Intake_General: CRUD on accounts, applications, leads and invoicesIntake staff can see financial data they do not need
FinanceFee_Adjustment_Approver: Edit on fee fields, Can_Approve_Fee_Waiver custom permissionExtra_Access_John: one person’s catch-all setAccess stays after the person changes job
IntegrationIntegration_Payment_Update: Read on invoices, Edit only on payment status fieldsAPI_Integration_All_Objects: broad CRUD and Modify All DataOne leaked credential exposes the whole org

Custom permissions as feature gates

Custom permissions decouple code from profiles and user IDs. Apex checks FeatureManagement.checkPermission('Can_Approve_Fee_Waiver'). Flows, validation rules and formulas check $Permission.Can_Approve_Fee_Waiver. LWCs import the permission from @salesforce/customPermission to adjust the UI, while Apex enforces it on the server. Admins decide who has the capability through permission set assignment.

Custom permissions are also the usual replacement for profile-name checks that Profile Filtering breaks. Keep the original business meaning when you replace them. A check on Owner.Profile.Name classifies the record owner. A custom permission check answers a question about the acting user. If the logic really needs an attribute of the owner, use a governed User field, a role or public group membership instead.

Permission set groups and muting

Permission set groups (PSGs) combine atomic sets into job-function packages. PSG_Ops_Specialist combines App_Intake_Create, Account_Read, Doc_Upload_Support and Standard_Reporting. PSG_Ops_Lead includes the same sets and adds Queue_Management.

A muting permission set removes specific permissions inside one group without changing the atomic sets. It applies only to permissions that come through that group. It is not a global deny.

Example: a managed package update adds Edit on Vendor_Sync__c to its Managed_Core_Set. You mute that Edit in PSG_Ops_Specialist. Later, an admin assigns Managed_Core_Set directly to one specialist, and that user has Edit again. Use muting for narrow cases, such as a package set you cannot edit. Do not use it to hide messy assignments.

When a set or muting set inside a PSG changes, Salesforce recalculates the group in the background. The status is Updating until it finishes, and users may not have the new access yet. CI/CD scripts should wait for recalculation before they run persona tests:

SELECT DeveloperName, Status
FROM PermissionSetGroup
WHERE Status != 'Updated'

Treat Failed and Outdated as pipeline failures, not warnings.

6. Separate identities by risk

Human users, privileged admins, integrations and AI agents have different risk profiles. Each needs its own identity and its own guardrails.

Privileged administrators

In this reference model, business users do not hold administration permissions. Manage Users, Author Apex, Customize Application, View All Data and Modify All Data live only in dedicated privileged sets, granted for one working day at most through the time-bound process described later.

Integration users

Give each external interface its own integration user. A shared integration user makes the blast radius large and the audit trail unclear.

  • Use the Salesforce Integration user license with the Minimum Access - API Only Integrations profile, and assign the Salesforce API Integration permission set license.

  • Build object and field permission sets with that license type, so they cannot hold permissions the license does not support. These sets do not show Apex Class Access, Named Credential Access or Custom Permissions. Grant those through a second set with no license, where the user’s entitlements support it.

  • Restrict each set to the objects and fields of one interface contract.

Apply minimum access at two layers. OAuth scopes limit what the token can call. Permission sets limit what the user can do in the data. A narrow scope does not protect an integration user that holds Modify All Data. In the example org, an attacker with the payment integration’s credential can read invoice status and update payment results. Queries on compliance documents or setup data fail.

Agentforce agents

The agent uses a model to choose which action to run. The action itself must stay deterministic and inside normal authorization controls. Two separate questions decide what an action can reach:

  1. Which user does it run as? This is the execution identity. It decides whose profile, permissions and sharing are available.

  2. Which access mode does the action use? A flow runs in user context, system context with sharing, or system context without sharing. Apex runs in user mode or system mode. A system-context flow can read all objects and fields, and without sharing it ignores sharing too, whatever user the agent runs as.

The diagram shows how Salesforce chooses the execution identity, and what each action must add when it runs as the agent user.

Decision diagram: which user an Agentforce action runs as. Employee agents run as the logged-in employee. Service agents run as the Agent User, except on an Experience Cloud site using Enhanced Chat with credential-based user verification, where they run as the logged-in site user. Customer context variables identify the customer but do not limit data, so the action needs a trusted identity, scoped queries and a block on private actions until that identity is set. The flow run context and Apex access mode decide what is enforced.
  • Employee agents run as the logged-in employee. That user’s profile, permission sets, FLS and sharing apply, provided each action runs in user context or user mode.

  • Service agents run as a dedicated agent user by default, with the Einstein Agent license and the Einstein Agent User profile.

  • The one exception is a service agent on an Experience Cloud site through Enhanced Chat with credential-based user verification turned on. The agent then runs as the logged-in site user, and that customer’s access applies. Salesforce’s execution-context summary lists this for Enhanced Chat v1, so confirm it for your channel version.

Teams miss the default case. Context variables such as MessagingSession.ContactId tell the agent who the customer is. They do not control data access. Without extra design, a customer can reach every record the agent user can see. So each private action needs three controls:

  • A trusted identity. The standard Customer Verification subagents store it in VerifiedCustomerId. A site or app with its own login can pass a signed identifier through User Verification, stored on MessagingEndUser, with a short token expiry. A MessagingSession record alone is not proof; use it only if your implementation binds and validates that session.

  • Scoped queries and updates. Filter by that identity, never by an identifier the customer types. Decide whether the boundary is the contact or the account. An account-level check lets one contact act on another contact’s records at the same company.

  • A gate. Add a filter such as VerifiedCustomerId is not None to subagents and actions that touch private data.

In the example org, a customer who verified with an email code asks the agent to “create a ticket for application 1049”. The flow runs as the agent user and checks that the applicant contact on that application matches VerifiedCustomerId before it creates the case. The agent user cannot edit fees or change users, so a manipulated prompt cannot reach those actions. Review the sets Salesforce assigns when it creates a service agent, such as AgentforceServiceAgentUserPsg, and keep the rest limited to what the subagents need.

7. Automate assignment with User Access Policies

How UAPs behave

User Access Policies (UAPs) grant and revoke access based on user fields such as department, region, title or license. A policy can manage permission sets, permission set groups, permission set licenses, package licenses, public groups and queues, with up to 20 actions. Active policies run when a matching user is created or updated. Manual policies run when an admin applies them, which suits one-time migrations.

  • An org can have up to 200 active policies. One policy per micro-role still becomes hard to maintain, so design around attribute bundles.

  • Activating a policy does not backfill existing users. A policy applies when a user’s record is created or updated to meet its criteria. Use a manual run for existing users.

  • When a user matches more than one active policy, only the policy with the lowest Order value applies. So the more specific policy in an overlapping pair needs the lower Order value. In the example org, a lead receives PSG_Ops_Lead and an approver receives PSG_Finance_Approver. One policy’s action cannot trigger another policy, so do not design chains.

  • The policy’s Recent User Access Changes tab shows when the policy applied and which users it affected. Use it to find failed actions too.

Make revocation explicit

The mover phase causes most permission creep. A user changes team, receives the new bundle and keeps the old one. A grant policy does not undo its earlier grants when a user stops matching its criteria. The policy that matches next must revoke the old access, or another controlled process must.

Example: an Ops Specialist moves into an authorized Finance Approver role. HR updates Department to Finance and the governed Approver Level to the approved value. UAP_FinanceApprover_AutoProvision matches both attributes and runs these actions:

  • Grant PSG_Finance_Approver.

  • Revoke PSG_Ops_Specialist and PSG_Ops_Lead.

  • Revoke the Operations queue and public group.

Moving into Finance without the required approval level grants only the standard Finance package, PSG_Finance_Standard. That standard Finance policy needs the same Operations revoke actions.

Policy order has a practical consequence here. If a broader policy with a lower Order value also matches finance approvers, that policy applies instead, and the approver grant and its revoke actions never run. A scheduled reconciliation that compares assignments with current attributes catches users who match no policy at all.

UAPs are only as good as the attributes they read. Policy filters accept Text fields, but free-text values produce wrong grants at scale. Use a governed custom picklist or a controlled mapping sourced from HR or the identity provider, and restrict who can edit the fields that drive access. A JIT provisioning handler follows the same rule: it validates claims against an allow-list and never maps raw assertion values to an elevated permission set.

Give each assignment type one owner, so two mechanisms do not fight over the same access:

Assignment typeOwning mechanism
Core workforce accessUAPs driven by governed HR or IdP attributes
Temporary elevated accessApproved request with automatic revocation
Integration and agent accessCI/CD deployment scripts
Manual admin assignmentsNot used for routine provisioning; exceptions are logged and detected by audit

Time-bound access

Native expiration works on permission set and permission set group assignments. Access ends at 11:59 PM on the chosen date in the chosen time zone, so it works in days, not hours. It has a limit that matters for privileged access: a set or group that contains Assign Permission Sets, Manage Profiles and Permission Sets, or Manage Users cannot have an expiration date. Expired assignments are soft-deleted, so audit queries need ALL ROWS to see them.

Use native expiration wherever it is supported. For privileged permissions it does not cover, or windows shorter than a day, use an approved elevation process that grants the assignment, removes it at the end time through a scheduled job, and verifies the removal. A session-based permission set does not solve this alone. It limits access to sessions where the set is activated, but it does not set a duration.

Recertification works only when reviewers understand what they approve. Each review line should show the capability description, its risk class, the assignment source (UAP or direct) and the last observed relevant activity, where evidence is available.

8. Keep sharing separate from permissions

A common shortcut is to grant View All or Modify All on an object when a user cannot see a record. This bypasses sharing for every record of that object. It solves one ticket and widens the blast radius of that user’s credential. Object and field permissions say what a user can do. Sharing says which records. Solve visibility problems in the sharing layer:

MechanismUse it for
Org-wide defaultsThe strictest baseline, usually Private for sensitive objects
Role hierarchyManagers seeing their team’s records
Criteria and owner-based sharing rulesStable groups across the hierarchy
Teams and territoriesCollaboration on specific accounts or deals
Apex managed sharingOnly when declarative rules cannot express the logic
Restriction rulesNarrowing visibility on supported objects

Experience Cloud users need their own design. Set external org-wide defaults separately, Private for sensitive objects. Grant access with sharing sets, share groups, the external role hierarchy and account relationships. In the example org, partners see accounts through sharing sets on their own account, customers see only their own applications, and compliance documents have no external access at all.

9. Enforce on the server

Hiding a button in an LWC does not replace server-side authorization. A user with access to an Apex class can invoke its exposed @AuraEnabled methods without using the intended screen. Review REST endpoints separately because they have their own entry requirements.

Apex pattern

The class below is illustrative. It was written for this article and has not been deployed against a live Application__c schema. Two behaviours it relies on were checked separately in a Developer Edition org at API version 68.0: the WITH USER_MODE and FOR UPDATE combination compiles and runs, and the insert exception types described below. The class combines three controls: it declares sharing, it runs SOQL and DML in user mode, and it checks a custom permission before each sensitive operation.

public with sharing class FreeZoneApplicationService {

    @AuraEnabled
    public static Id createApplication(String companyName, String licenseType) {
        requirePermission('Can_Submit_Application');
        if (String.isBlank(companyName) || String.isBlank(licenseType)) {
            throw buildError('Company name and license type are required.');
        }
        // Build the record on the server. The caller cannot set
        // fee, status or approval fields through this method.
        Application__c app = new Application__c(
            Company_Name__c = companyName.trim(),
            License_Type__c = licenseType,
            Application_Status__c = 'Submitted');
        try {
            Database.insert(app, AccessLevel.USER_MODE);
        } catch (SecurityException e) {
            // For example, missing object Create access
            throw buildError('Unauthorized: no access to create applications.');
        } catch (DmlException e) {
            // For example, an inaccessible field or a failed validation
            throw buildError('Application could not be saved.');
        }
        return app.Id;
    }

    @AuraEnabled
    public static void approveFeeWaiver(Id applicationId, Decimal waiverAmount) {
        requirePermission('Can_Approve_Fee_Waiver');

        List<Application__c> apps;
        try {
            apps = [
                SELECT Id, Fee_Amount__c, Waiver_Approved__c
                FROM Application__c
                WHERE Id = :applicationId
                WITH USER_MODE
                FOR UPDATE
            ];
        } catch (QueryException e) {
            // Missing object or field Read, or a lock timeout
            throw buildError('Application fees are not accessible right now.');
        }
        if (apps.isEmpty()) {
            throw buildError('Application not found or not accessible.');
        }

        Application__c app = apps[0];
        if (app.Waiver_Approved__c) {
            throw buildError('A fee waiver is already approved.');
        }
        if (app.Fee_Amount__c == null || waiverAmount == null
                || waiverAmount <= 0 || waiverAmount > app.Fee_Amount__c) {
            throw buildError('Invalid waiver amount.');
        }

        app.Fee_Amount__c -= waiverAmount;
        app.Waiver_Approved__c = true;
        try {
            Database.update(app, AccessLevel.USER_MODE);
        } catch (SecurityException e) {
            throw buildError('Unauthorized: no access to update applications.');
        } catch (DmlException e) {
            throw buildError('Fee waiver could not be saved.');
        }
    }

    private static void requirePermission(String customPermission) {
        if (!FeatureManagement.checkPermission(customPermission)) {
            throw buildError('Unauthorized: missing ' + customPermission + '.');
        }
    }

    private static AuraHandledException buildError(String message) {
        AuraHandledException ex = new AuraHandledException(message);
        ex.setMessage(message); // keeps getMessage() readable in tests
        return ex;
    }
}

From API version 67.0 (Summer ’26), SOQL, SOSL, DML and Database methods run in user mode by default. Triggers still run in system mode, so review any elevated automation the DML fires. Keep the explicit access modes anyway. They document intent and protect classes saved at older API versions.

Three design choices are deliberate:

  • Every user-mode operation translates its access errors. User-mode queries can throw QueryException for missing object or field access. In the tested insert cases, missing object Create access threw SecurityException, while an inaccessible field caused DmlException. The method handles both DML exception types. A query that finds no visible matching record returns an empty list. Each case reaches the client as a clear message, not a raw system error.

  • createApplication accepts specific inputs, not a full record. FLS decides whether a user can edit a field in general. It does not express the business rule for this operation. Building the record on the server prevents callers from supplying fields such as Waiver_Approved__c through this method.

  • The fee-waiver transition is defined. The permission check proves the user may approve waivers. The method also rejects a second approval, a missing fee and an invalid amount, and FOR UPDATE stops two concurrent approvals from both passing.

These checks protect this service entry point. If the same fields can be changed through another UI, API or automation path, enforce the same approval rules there or restrict that path.

Flow contexts and system mode

Record the run context of every flow in design reviews: user context, system context with sharing, or system context without sharing. Use system context only for background automation that cannot run as the user. Treat every without sharing Apex class the same way. When system mode is necessary, add compensating controls: check a custom permission for the caller, validate every input, and log the elevated operation.

Negative tests

Positive tests prove that the right persona can act. Negative tests prove that the wrong persona cannot. An access test suite is incomplete if it covers only successful operations. Tests that run only as an admin do not demonstrate the access boundaries of the intended business personas.

@IsTest
private class AuthorizationBoundaryTests {

    @IsTest
    static void opsSpecialistCannotApproveFeeWaiver() {
        User opsUser = createUser('Minimum Access - Salesforce', 'opsspec');

        // The permission check runs before any query, so a fake Id is enough
        Id fakeAppId = Id.valueOf(
            Application__c.SObjectType.getDescribe().getKeyPrefix()
            + '000000000001');

        System.runAs(opsUser) {
            Test.startTest();
            try {
                FreeZoneApplicationService.approveFeeWaiver(fakeAppId, 500);
                Assert.fail('User without Can_Approve_Fee_Waiver approved a waiver.');
            } catch (AuraHandledException ex) {
                Assert.isTrue(ex.getMessage().startsWith('Unauthorized'),
                    'Expected an authorization error, got: ' + ex.getMessage());
            }
            Test.stopTest();
        }
    }

    private static User createUser(String profileName, String aliasValue) {
        Profile p = [SELECT Id FROM Profile WHERE Name = :profileName LIMIT 1];
        String uname = aliasValue + '.' + System.now().getTime() + '@example.test';
        User u = new User(
            ProfileId = p.Id, Username = uname, Email = uname,
            LastName = 'Persona', Alias = aliasValue,
            TimeZoneSidKey = 'Asia/Dubai', LocaleSidKey = 'en_US',
            EmailEncodingKey = 'UTF-8', LanguageLocaleKey = 'en_US');
        insert u;
        return u;
    }
}

This test covers one control: the custom-permission gate. It proves that a user without Can_Approve_Fee_Waiver is rejected before the record query. It does not prove object permissions, field permissions, record sharing or a successful update. A direct Apex call inside System.runAs also skips the Apex class access check that applies at the client entry point.

Add separate tests for missing object access, missing field access, an inaccessible record, invalid inputs, a second approval and an authorized successful update. Verify class access through the real client entry point.

10. Ship authorization metadata like code

Store PermissionSet, PermissionSetGroup, MutingPermissionSet, UserAccessPolicy and CustomPermission metadata in source control and deploy it through the pipeline. Use one naming pattern per type:

Metadata typePatternExample
PermissionSet (capability)Domain_Capability_LevelApp_Intake_Create
PermissionSet (privileged)Privileged_Domain_CapabilityPrivileged_Identity_ManageUsers
PermissionSet (integration)Integration_Service_ContractIntegration_Payment_StatusUpdate
PermissionSetGroupPSG_PersonaPSG_Ops_Specialist
MutingPermissionSetMuting_PSG_TargetMuting_PSG_Ops_Specialist_CorePackage
UserAccessPolicyUAP_Persona_TriggerUAP_OpsSpecialist_AutoProvision
CustomPermissionCan_ActionCan_Approve_Fee_Waiver

Make the description field mandatory. It names the business owner, the technical owner, the risk class and the decision record that approved the set.

Ensure that every permission set referenced by a group either already exists in the target org or is included in the deployment. When deploying in separate stages, deploy the dependencies first. The recommended stage order is:

  1. Schema and code: CustomObject, CustomField, ApexClass, LightningComponentBundle, Flow.

  2. Authorization and credential dependencies: CustomPermission, ExternalCredential.

  3. Capabilities: PermissionSet.

  4. Composition: MutingPermissionSet, then PermissionSetGroup.

  5. Automation: UserAccessPolicy.

Production emergencies do not justify permanent admin access. A break-glass procedure checks out vault credentials, which alerts security operations. It grants privileged access through the time-bound process above, monitors the session through Setup Audit Trail and Event Monitoring, and confirms the removal. Every production change is then retrieved into source control, so the next deployment does not overwrite the fix.

11. Monitor and measure

Three native tools show who has access and what changed:

ToolWhat it showsRetention
User Access SummaryA user’s effective permissions and their sourcesPoint in time
Setup Audit TrailSetup and permission changes180 days; export on an automated monthly schedule for longer evidence
Event MonitoringLogins, API calls, report exports, URI eventsWith Shield or the Event Monitoring add-on, event log files are kept 30 days by default and can be extended to one year; stream to a SIEM for long-term evidence

Treat admins, deployment users, integration users and agent users as tracked assets, each with a named owner. In this reference model, integrations authenticate with certificate-based JWT or client credentials, not a shared password.

Alert on large exports through reports or APIs, admin logins from unapproved networks, permission set assignments changed outside a deployment window, integration users touching objects outside their contract, and agent users running actions at unusual volume.

The metrics below are example targets for this reference model. They are design choices, not Salesforce requirements.

MetricCalculationExample target
Users on a minimal baselineUsers on a minimal profile for their license / all users, with documented exceptions100%
Direct-to-group assignment ratioDirect permission set assignments / PSG assignments, excluding integration and agent usersUnder 0.1
Elevated grants with automatic endElevated grants with native expiry or scheduled removal / all elevated grants100%
Stale accountsActive users with no login in 90 days0
Failed UAP actionsFailed or unresolved policy actions per week0
Recertification completionCompleted reviews / scheduled reviews100%
Time to revokeTime from HR role change to access removalUnder 1 hour

12. Migration roadmap

Move a profile-heavy org in seven phases. Each phase has an exit criterion, so progress is measurable.

PhaseWorkExit criterion
1. DiscoveryInventory profiles, permission sets, groups, licenses, integrations and agent usersEvery high-risk grant listed with an owner
2. Capability modellingInterview teams; separate job titles from capabilitiesCapability matrix signed off by business leads
3. BuildMinimal profiles, atomic sets and PSGsAll new sets in version control
4. PilotMigrate one bounded team; run positive and negative testsPilot live with no severity-1 defects
5. AutomationClean HR attributes; build and activate UAPs with explicit revoke actionsAttribute data validated and policies active
6. Identity hardeningSplit shared integration users; move admin access to time-bound elevationEvery integration on a dedicated API-only user
7. OperatePipeline gates, monitoring alerts, recertificationPipeline blocks builds that fail persona tests

13. A decision guide for new requests

Ask three questions in order for each new access request. First, is it about which records the user can see? Then it belongs in the sharing layer. If not, it is a capability in an atomic permission set, with a custom permission when code must check it. Finally, decide who receives it and for how long.

Decision diagram: where an access requirement belongs. Record visibility goes to the sharing layer. Everything else is a capability in an atomic permission set inside a permission set group, with a custom permission when code must check it. Assignment is by User Access Policy for workforce roles, direct through CI/CD for integration and agent users, and time-bound for temporary or privileged access, using native expiry where supported or approved elevation with automatic revocation.

14. Official References

Use these official sources to confirm release timing, platform limits and behaviour before you apply the design in your org.

Release updates and Apex access modes

Permission assignment and User Access Policies

Integration users and Agentforce

Monitoring

Conclusion

Do not start with the whole org. Pick one high-risk persona, such as Finance Approver or the payment integration. Inventory where its access comes from today. Rebuild it as atomic sets in one group on a minimal profile, assign it through one policy or one pipeline step, and write the negative tests first. That single pilot shows whether your capability boundaries hold.