
OWD Sharing Configuration
OfficialFreeManage Salesforce Organization-Wide Default settings effectively.
Free · Opens the source repo
What OWD Sharing Configuration does
The OWD Sharing Configuration skill is designed for Salesforce administrators and developers who need to manage Organization-Wide Default (OWD) sharing settings for both standard and custom objects within a Salesforce organization. This skill allows users to retrieve current OWD settings and update access levels, ensuring that the visibility of records aligns with organizational policies. OWDs establish the baseline access level for users to records they do not own, making it crucial for maintaining data security and compliance.
With this skill, users can execute two primary operations: retrieving the current OWD settings and updating them as necessary. When retrieving settings, the skill queries the Salesforce CLI Tooling API to provide a clear view of the internal and external sharing models for specified objects. This is particularly useful for organizations that need to assess their current sharing configurations before making changes. The skill also enables updates to the OWD settings, allowing users to set access levels such as Private, Public Read Only, Public Read/Write, or Controlled by Parent, depending on their specific requirements.
The skill is particularly valuable in scenarios where organizations need to restrict record visibility or control default access for specific objects. By confirming the necessary inputs—such as the target organization, object names, and desired access levels—users can execute changes confidently. The skill also includes validation steps to ensure that updates comply with Salesforce constraints, helping to prevent errors during deployment. This makes it an essential tool for any Salesforce professional looking to streamline their OWD management processes.
When to use it
Use this skill when you need to check or modify the OWD settings for Salesforce objects to ensure proper data access levels.
When not to use it
This skill is not suitable for managing sharing rules, role hierarchy, or manual sharing configurations; those should be handled by other dedicated skills.
What you can build with it
Retrieve Current OWD Settings
Use the skill to query and display the current OWD settings for specific Salesforce objects, ensuring you have the latest visibility configurations.
Update OWD Access Levels
Modify the OWD settings for an object to restrict or expand access levels, adjusting to changing organizational needs.
Verify OWD Changes
After making updates, run the retrieval command again to confirm that the new access levels are correctly applied.
How to install OWD Sharing Configuration
View source1. Install with the skills CLI
npx skills add forcedotcom/sf-skills/platform-sharing-owd-configure --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by forcedotcomManaging Org-Wide Defaults
Retrieve and update Organization-Wide Default (OWD) sharing settings for standard and custom objects in a Salesforce org. OWDs define the baseline level of access users have to records they do not own.
Scope
- In scope: Retrieving current OWD settings, updating internal/external access levels for standard and custom objects
- Out of scope: Sharing rules, role hierarchy configuration, manual sharing, permission sets, criteria-based sharing — delegate to appropriate skills
Clarifying Questions
Before proceeding, confirm with the user if not already clear:
- Which object(s) do you want to get or update OWD settings for?
- What access level do you want to set? (Private, Public Read Only, Public Read/Write, Controlled by Parent)
- Do you need to change both internal and external access, or just one?
Required Inputs
Gather or infer before proceeding:
- Target org: The org alias or username to query/update (use default org if not specified)
- Object name(s): Standard object API name (e.g.,
Account,Contact) or custom object API name (e.g.,Invoice__c) - Operation: Get (retrieve current settings) or Update (change access levels)
- Access levels (for update): Internal access and/or external access values
Defaults unless specified:
- Use the default connected org
- If only one access level is provided, assume it applies to internal access
Workflow
All steps are sequential. Do not skip or reorder.
Phase 1 — Retrieve Current Settings
-
Query current OWD settings using the Salesforce CLI Tooling API:
sf data query --query "SELECT QualifiedApiName, InternalSharingModel, ExternalSharingModel FROM EntityDefinition WHERE QualifiedApiName = '<ObjectName>'" --use-tooling-api --target-org <org> -
For retrieving all OWD settings at once:
sf data query --query "SELECT QualifiedApiName, InternalSharingModel, ExternalSharingModel FROM EntityDefinition WHERE IsCustomizable = true ORDER BY QualifiedApiName" --use-tooling-api --target-org <org> -
Present results clearly — read
references/access_levels.mdfor valid values and display a formatted table to the user.
Phase 2 — Update Settings (if requested)
-
Validate the requested access level — read
references/access_levels.mdto confirm the value is valid for the target object. -
Retrieve the object metadata using the Metadata API (same command for both standard and custom objects):
sf project retrieve start --metadata CustomObject:<ObjectName> --target-org <org>. This retrieves<ObjectName>.object-meta.xmlcontaining<sharingModel>and<externalSharingModel>. Seereferences/metadata_api_approach.mdfor the full procedure. -
Modify the sharing settings — update the
<sharingModel>(internal access) and/or<externalSharingModel>(external access) in the object's.object-meta.xml. Readreferences/metadata_api_approach.mdfor details. -
Pre-deploy verification — before deploying, confirm:
- External access is not more permissive than internal access
- Objects with Master-Detail relationships use
ControlledByParent - The requested access level is valid for the target object (see
references/access_levels.md) - Cross-object constraints are satisfied (see "Cross-Object Constraints" in
references/access_levels.md)
-
Deploy the updated settings:
sf project deploy start --metadata CustomObject:<ObjectName> --target-org <org>. If the deploy fails, check the error message for the specific cause (see Gotchas table). A failed deploy does not change the org. To discard local edits, re-retrieve from the org:sf project retrieve start --metadata CustomObject:<ObjectName> --target-org <org>. -
Verify the change by re-running the query from Step 1.
Rules / Constraints
| Constraint | Rationale |
|---|---|
Objects with Master-Detail relationships must use ControlledByParent | Platform enforces this — attempting other values fails |
| External access cannot be more permissive than internal access | Salesforce rejects configurations where external > internal |
| Some standard objects have fixed OWD (e.g., User, Activity) | Not all objects support OWD changes |
| Changing OWD to more restrictive triggers sharing recalculation | This can take significant time on large orgs — warn the user |
Custom objects default to Public Read/Write when created | Users may not realize the default is permissive |
For managed package custom objects, use the full API name including namespace prefix (e.g., ns__Object__c) | Namespace-prefixed objects require the prefix in both queries and metadata retrieval |
| Always verify the org connection before querying | Prevents confusing error messages |
Gotchas
| Issue | Resolution |
|---|---|
INSUFFICIENT_ACCESS error when updating | User needs Manage Sharing permission or System Administrator profile |
| OWD change appears stuck | Sharing recalculation is running — check Setup > Sharing Settings for progress |
| Custom object not found in query | Use the full API name including __c suffix |
ControlledByParent not available | Object has no Master-Detail relationship — use Private, Public Read Only, or Public Read/Write |
| External access field not showing | External sharing model only appears when external org-wide defaults are enabled |
| Query returns no results | Object may not be customizable or API name may be incorrect — verify spelling |
Output Expectations
Deliverables:
- For get operations: Formatted table showing object name, internal access level, and external access level
- For update operations: Confirmation of the change with before/after comparison
Cross-Skill Integration
| Need | Delegate to |
|---|---|
| Creating sharing rules after restricting OWD | platform-sharing-rules-generate skill |
| Deploying metadata changes to another org | platform-metadata-deploy skill |
Reference File Index
| File | When to read |
|---|---|
references/access_levels.md | When validating or explaining OWD access level values |
references/metadata_api_approach.md | When using Metadata API to update OWD instead of Tooling API |
examples/get_owd_output.md | To verify formatted output matches expected structure |
examples/update_owd_output.md | To verify update confirmation matches expected structure |
Frequently asked questions about OWD Sharing Configuration
Similar skills
WinMD API Search
Easily find and explore Windows desktop APIs.
WebMCPify
Transform any web app into an agent-ready platform.
Phoenix Tracing
Instrument LLM applications with OpenInference tracing.
Foundry Hosted Agent CopilotKit
Guidance for developing agentic web apps on Azure.
Power Automate Foundation
Connect AI agents to Power Automate seamlessly.
Power Automate Flow Builder
Efficiently build and deploy Power Automate flows programmatically.
