Salesforce profile deployment is an overlay: the Metadata API Developer Guide says it overlays the target org's existing settings. Permissions in your XML file are applied, and permissions missing from it stay as they are.
To deploy profile metadata safely, retrieve the profile with every object, field and component it controls, check the XML and set anything you want to revoke to false. Then validate and deploy, knowing that a retrieved profile isn't a backup and deleting a line from the XML revokes nothing.
What is profile metadata in Salesforce?
A profile defines what its users can do, and in Metadata API it's an XML file with a .profile suffix. The Profile reference lists objectPermissions for create, read, edit, delete, view all and modify all on each object, and fieldPermissions for readable or editable fields.
It also covers userPermissions such as API Enabled, loginHours and loginIpRanges for when and where users sign in, and class, page and flow access. App, tab and record type visibility live in the same file.
One node can reach a long way. The same guide says modifyAllRecords works like Modify All Data for one object, letting every user on the profile read, edit or delete its records "regardless of the sharing settings for the object."
That's why many teams keep profiles thin and grant extra permissions through permission sets. For API access in particular, see our post on the API Enabled permission.
How does profile retrieval work?
Retrieval is scoped by your manifest: the Metadata API guide says a retrieved .profile file only includes security settings for "the other metadata types referenced in the retrieve request." User permissions, IP address ranges and login hours are the exceptions, and they're always retrieved.
So a retrieved profile is only a partial extract, even though it's valid XML and looks complete. The guide adds that objectPermissions only come back where allowRead is true.
Standard objects need care too, since the * wildcard on CustomObject returns permissions for your custom objects but not standard ones such as Account. Name each component whose permissions you need in package.xml, as in this example built on the guide's samples:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Sales User</members>
<name>Profile</name>
</types>
<types>
<members>Account</members>
<members>Invoice__c</members>
<name>CustomObject</name>
</types>
<types>
<members>Invoice_Approval</members>
<name>Flow</name>
</types>
<version>68.0</version>
</Package>Check the retrieved file before you edit it, because a missing node usually means a gap in your manifest. Our metadata backup guide shows how to list each type in a package.xml.
What makes profile changes risky?
Deployment follows the opposite rule to retrieval. Here are the three states a permission can be in, as the Metadata API guide's overlay note describes them.
| State in the XML | What it looks like | What happens on deploy |
|---|---|---|
| Enabled | The node is in the file, set to true | The permission is granted in the target org |
| Disabled | The node is in the file, set to false | The permission is revoked in the target org |
| Omitted | The node isn't in the file at all | Nothing, because the overlay leaves it as it is |
The worst result is silent over-provisioning: you delete a fieldPermissions node, the deployment succeeds and the user keeps the permission. To revoke it, the guide's fix is to mark a disabled permission explicitly, with a value of false, before you deploy.
New profiles have their own trap: per Salesforce's Profile reference, a new profile with no permissions specified gets everything in the Minimum Access - Salesforce profile. That applies in API version 60.0 and later, while 59.0 and earlier used the Standard User profile.
How do you go about deploying Salesforce profile changes?
The deployment steps follow the order the overlay rule forces on you. Each section below covers one stage, and the infographic sums them up.

Scope, snapshot and compare
Build a manifest with the profile plus every object, field, class, page and flow the change touches. Anything you leave out stays as it is in the target under the overlay rule, so keep a complete rollback point first, ideally in source control.
Diff the profile XML between the source and target orgs, including what's missing from your file, and have someone from security or compliance approve the diff. A second reviewer is your best chance to catch an unintended modifyAllRecords before every user on the profile gets it.
Write revocations, then validate
Set every permission you want to remove to false and keep it in the file, as Salesforce's Profile reference says, and grant new permissions with permission sets where you can. Our post on the Salesforce security model shows where profiles and permission sets sit.
Before any production deployment, validate in a sandbox that mirrors production's profiles and record types. The Salesforce DX Developer Guide shows sf project deploy validate checking a manifest deployment "without saving the components in the target org."
Change sets, the CLI and other tools
For the limits change sets and the Metadata API run into, see our post on async metadata retrieval. Whichever deployment tool you use, review the diff before the deployment runs.
Deploy with Flosum
Flosum's Overwrite Protection compares branch components with the live org and opens each Different one side by side, so you keep only the profile changes you meant. Our post on Salesforce overwrite protection walks through a full job.
Flosum's deployment settings include Deploy profile settings only for selected components, and its best practices say to use Profile and Permission Set scoping to avoid unnecessary overwrites. Its PreDeploy Fix lists missing components with the component that references each one.
How do you check and roll back a profile deployment?
Right after the deployment, check the change from both directions before you call it done:
- Access you meant to grant works for a test user on the profile
- Anything you revoked with an explicit false is gone
- The permissions before and after match the change that was approved
- Power users can still run their normal work
A rollback is a new deployment, so the overlay rule still applies and any permission your change granted has to be set back to false. In Flosum, Rollback uses the backup snapshot each Deploy job stores, and you select which components to revert.
Where does Flosum fit?
Flosum's DevOps platform applies merge logic component by component, because "a Profile merges differently than an Apex class," and validates each change against a dependency graph of your org. Our guide to Salesforce Event Monitoring covers watching what happens after release.
Pull request approval rules let admins require a minimum number of approvals before a merge. Flosum DevOps runs in Flosum's cloud or in your own cloud.
FAQs
How do I deploy profile metadata in Salesforce?
Retrieve the profile with its related objects, fields, classes and flows in one package.xml, set anything you want to revoke to false, then validate and deploy. The Metadata API guide describes profile deployment as an overlay, so check grants and revocations afterward.
Why are field permissions missing from my retrieved profile?
A retrieved profile only includes security settings for the other metadata types in the same retrieve request, according to the Metadata API guide. Add the objects and fields to package.xml and retrieve again.
Does Salesforce remove profile permissions that are missing from the XML?
No. The Metadata API guide says profile deployment overlays the target org's settings, so a missing node keeps its permission until you set it to false.
How do I roll back a Salesforce profile deployment?
Deploy the previous state and set any permissions your change granted back to false, because the overlay rule ignores missing nodes. In Flosum, Rollback restores the components you pick from the backup the Deploy job stored.
Book a demo to see Flosum compare and move profile changes between your Salesforce orgs.
Thank you for subscribing




