The Open-Source Migration Engine for Salesforce Profiles
Decompose legacy monolith profiles into modular Permission Sets & Permission Set Groups with 100% mathematical parity verification, cross-profile clustering, automated muting, and native Model Context Protocol (MCP) server for AI coding agents.
npx permforge analyze --dir force-app/main/default/profiles
> permforge analyze -d force-app/main/default/profiles
ⓘ PermForge Profile Analyzer
Scanning 3 profile metadata files...
Profile: Custom: Sales Representative
• Objects: 42 (Account, Contact, Opportunity, Lead, Quote...)
• Field Permissions (FLS): 386
• Apex Classes: 14 | Visualforce Pages: 6
• Custom Permissions: 3
• High-Risk Flags: ModifyAllData (FALSE), ViewAllForecasts (TRUE)
• Complexity Score: 64 / 100 [Moderate Tech Debt]
✔ Analysis complete. Recommendation: Safe for automated decomposition.
> permforge cluster -d force-app/main/default/profiles -t 0.70
ⓘ PermForge Cross-Profile Clustering Engine
Comparing permission sets across 5 profiles using Jaccard Similarity index...
✔ Identified Shared Baseline: Standard_Employee_Baseline
• Common Object Grants: Account (Read), Contact (Read), Task (CRUD), Event (CRUD)
• Shared FLS Grants: 184 common fields
▸ Isolated Role Deltas:
• Sales_Ops_Delta: + Opportunity Delete, Transfer Leads
• Service_Rep_Delta: + Case Edit, Knowledge Access
✔ Generated 1 baseline set + 4 lean delta sets in output/permsets.
> permforge decompose -p "Custom: Sales Representative.profile-meta.xml" -o force-app/main/default
ⓘ PermForge Modular Decomposition
Decomposing monolithic profile into single-responsibility artifacts...
✔ Created: permissionsets/Sales_Account_Contact_Access.permissionset-meta.xml
✔ Created: permissionsets/Sales_Opportunity_Core_Access.permissionset-meta.xml
✔ Created: permissionsets/Sales_Apex_Class_Executions.permissionset-meta.xml
✔ Created: permissionsetgroups/Sales_Representative_Persona.permissionsetgroup-meta.xml
✔ Decomposition complete! 1 PSG and 4 domain Permission Sets created.
> permforge verify -p "Custom: Sales Representative.profile-meta.xml" -g force-app/main/default/permissionsetgroups/Sales_Representative_Persona.permissionsetgroup-meta.xml
ⓘ PermForge Mathematical Parity Engine
Auditing 42 objects, 386 FLS, 14 Apex classes, 6 VF pages bit-for-bit...
• Objects Matched: 42 / 42 (100.0%)
• FLS Matched: 386 / 386 (100.0%)
• Missing Grants: 0
• Unexpected Extra Grants: 0
✔ VERIFICATION SUCCESS: 100% ACCESS PARITY PROVEN. Zero regression risk.
> permforge mcp
ⓘ PermForge Model Context Protocol (MCP) Server Active
Protocol: JSON-RPC 2.0 (stdio) • SDK: @modelcontextprotocol/sdk v1.6.1
Connected AI Coding Agents: Claude Desktop / Cursor / Antigravity / Cline
Exposed Agent Tools (9):
[1] analyze_profiles [2] cluster_profiles [3] decompose_profile
[4] verify_parity [5] strip_profile [6] generate_uap
[7] generate_muting [8] lint_profiles [9] generate_migration_plan
[INFO] Listening for AI client requests on stdio...
Built for Complex Salesforce Architectures
Everything required to navigate Salesforce's upcoming Profile Retirement without human error, spreadsheets, or access disruptions.
Zero-Loss Decomposition
Intelligently decomposes monolithic profiles into modular, single-responsibility Permission Sets grouped by business domain (Object access, FLS, Apex classes, custom permissions).
Automated SlicingMathematical Parity Proof
Verifies decomposed Permission Set Groups against the original Profile bit-for-bit. Guarantees 0 missing grants and 0 unexpected privileges before pushing to production.
Zero RegressionCross-Profile Clustering
Leverages Jaccard similarity algorithms across your entire repository to
automatically extract a shared Standard_Employee_Baseline and isolate
role-specific delta sets.
Muting PSG Generator
Generate native .mutingpermissionset-meta.xml to handle subtractive
permissions inside Permission Set Groups without fragmenting your security
architecture.
Profile Stripper & Sanitizer
Strips all migratable permissions from target profiles while preserving non-migratable essentials: Login IP Ranges, Login Hours, Page Layout Assignments, and Desktop Integrations.
Non-DestructiveNative MCP Server
Built-in Model Context Protocol server exposing 12 structured tools. Connect Claude Desktop, Cursor, Antigravity, or Cline to autonomously audit, decompose, and verify your repo.
AI Agent ReadyUser Access Policies (UAP)
Generates native Salesforce User Access Policies
(.userAccessPolicy-meta.xml) to automate real-time and scheduled PSG
assignments based on user attributes.
Official GitHub Action Gate
Plug-and-play GitHub Action (uses: visparashar/permforge@main) that detects permission creep in PRs, enforces 100% mathematical parity gates, and posts interactive PR summary reports.
The 4-Phase Migration Methodology
A battle-tested workflow designed to move enterprise Salesforce orgs to the Principle of Least Privilege.
Scan & Audit
Audit complexity scores, inventory SObjects and FLS, detect high-risk system grants, and export an executive HTML dashboard.
permforge analyze && report
Cluster & Decompose
Extract shared baseline permissions across all profiles and slice role-specific grants into modular domain Permission Sets and PSGs.
permforge cluster && decompose
Parity Verification
Audit the generated sets against original profiles bit-for-bit. Math proof guarantees 100% equivalence before touching production.
permforge verify -p <prof> -g <psg>
Sanitize & Deploy
Strip legacy permissions from profiles, generate User Access Policies for auto-assignment, and produce rollback scripts.
permforge strip && uap && plan
Complete CLI Reference
15 purpose-built commands covering discovery, decomposition, verification, and automated assignment.
Multi-stage orchestration engine coordinating audit, clustering, domain decomposition, mathematical parity verification, UAP generation, and reporting in a single command.
permforge pipeline --run --cluster --strict --dry-run
Connects directly to an authenticated Salesforce org via sf/sfdx auth cache and retrieves profiles via Metadata API in batch chunks.
permforge retrieve -o my-org --all-custom
Inventories profile SObject & FLS permissions, computes 0-100 complexity debt score, and flags high-risk permissions.
permforge analyze -d force-app/main/default/profiles
Cross-profile similarity analyzer. Extracts shared Standard_Employee_Baseline and role-specific delta sets.
permforge cluster -d force-app/.../profiles -t 0.70
Modularizes a profile into single-responsibility domain Permission Sets and a persona Permission Set Group.
permforge decompose -p CustomSales.profile-meta.xml
Mathematically verifies 100% access parity between a source Profile and a target Permission Set Group.
permforge verify -p CustomSales.profile -g Sales.psg
Strips migratable permissions from profiles while keeping layout assignments, login hours, and IP ranges intact.
permforge strip -p CustomSales.profile -o cleaned/
Generates declarative User Access Policies (.userAccessPolicy-meta.xml) to automate PSG assignment on user record changes.
permforge uap -n Assign_Sales -g Sales_Rep_PSG
Generates Muting Permission Sets (.mutingpermissionset-meta.xml) for subtractive permissions within PSGs.
permforge mute -n Mute_Delete -s Account:delete
Pre-commit and pull request linter. Emits GitHub Actions annotations to prevent profile regression.
permforge lint -d force-app/.../profiles --strict
Visualizes PSG inheritance hierarchy and object grant dependencies as Mermaid diagrams or ASCII trees.
permforge graph -g Sales_Rep_PSG.permissionsetgroup
Generates a self-contained interactive HTML audit report with security debt charts, risk tables, and export options.
permforge report -d force-app/ -o audit.html
Generates complete migration runbook: user assignment CSVs, rollback scripts, and SF CLI deploy sequences.
permforge plan -p CustomSales.profile -o migration/
Interactive terminal wizard that guides admins step-by-step through discovery, clustering, decomposition, and parity checks.
permforge wizard
Starts the native Model Context Protocol (MCP) server over stdio for autonomous AI coding agents.
permforge mcp
Model Context Protocol (MCP) Integration
Let Claude Desktop, Cursor, Antigravity, or Cline refactor and verify your Salesforce permissions autonomously.
Automate Migrations with AI Agents
PermForge implements the official Model Context Protocol (MCP) standard. When running in your IDE or desktop AI client, agents have 12 native tools to inspect, plan, decompose, and verify changes safely.
✔ Example Prompt for Your Agent:
"Analyze all profiles in force-app/main/default/profiles, extract a shared baseline permission set, and generate a 100% parity verification report."
// ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"permforge": {
"command": "npx",
"args": ["-y", "permforge", "mcp"]
}
}
}
PermForge vs. Alternative Methods
See how PermForge compares to manual spreadsheet migrations and native tooling.
| Capability | PermForge (Open-Source) | Manual Spreadsheets & Metadata API | Salesforce Standard Setup UI |
|---|---|---|---|
| 100% Mathematical Parity Proof | ✔ Bit-for-bit mathematical audit | ✘ Manual sampling / High error rate | ✘ None |
| Cross-Profile Baseline Clustering | ✔ Jaccard similarity baseline extraction | ✘ Ad-hoc human guesswork | ✘ Not supported |
| Automated Muting PSG Generation | ✔ Native .mutingpermissionset-meta.xml | ✘ Manual XML authoring | ✔ Manual clicks per field/object |
| Profile Sanitizer (strip migratables) | ✔ Preserves layouts/IPs, strips perms | ✘ High risk of breaking layouts | ✘ Manual unchecking hundreds of boxes |
| Model Context Protocol (MCP) AI Tools | ✔ 9 tools for Cursor/Claude/Antigravity | ✘ None | ✘ None |
| CI/CD Linter & Pre-commit Gate | ✔ GitHub Actions annotations / strict mode | ✘ None | ✘ None |
| Runtime API / Org Connection Required | ✔ Zero (Local metadata driven) | Requires live sandbox login | Requires production/sandbox login |