---
schema_version: "1"
id: 17a3df1bbc4c2c075ad9debfac680b84644fb350d4dcf98991d78909d008cf40
title: MobileSecurityPolicy
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_mobilesecuritypolicy.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_mobilesecuritypolicy.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 2e7101bedb2093897db40cd445ca73ce5906e2430f186d7ccac4657a3354bd81
description: Represents a mobile app security policy on the Salesforce mobile app with Enhanced Mobile App Security enabled. For a full description of each policy, see Enable and Configure Mobile App Security Policies.
---
# MobileSecurityPolicy

Represents a mobile app security policy on the Salesforce mobile app with Enhanced Mobile App Security enabled. For a full description of each policy, see [Enable and Configure Mobile App Security Policies](https://help.salesforce.com/s/articleView?id=xcloud.mobile_security_mam_setup_ui.htm&type=5&language=en_US).

![Important](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/images/icon_note_important.png)

#### Important

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

## Parent Type

This type extends the [Metadata](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/metadata.htm "The base class for all metadata types. You can’t edit this object. A component is an instance of a metadata type.") metadata type and inherits its fullName field.

## File Suffix and Directory Location

MobileSecurityPolicy components have the suffix .mobileSecurityPolicy and are stored in the mobileSecurityPolicies folder.

## Version

MobileSecurityPolicy components are available in API version 53.0 and later.

## Special Access Rules

The Enhanced Mobile App Security add-on subscription and the Enforce Enhanced Mobile App Security user permission are required to use this metadata type.

## Fields

| Field Name | Description |
| --- | --- |
| effectiveDate | 
Field Type

dateTime

Description

The date that a mobile security policy is enforced.



 |
| isEnabled | 

Field Type

boolean

Description

Required. Indicates whether the mobile security policy is enabled. The default value is false, which means that the policy is disabled.





 |
| isProtected | 

Field Type

boolean

Description

An auto-generated value that doesn’t impact the behavior of the metadata type. The default value is false.



 |
| masterLabel | 

Field Type

string

Description

Required. ​​A user-friendly name for MobileSecurityPolicy, which is defined when the MobileSecurityPolicy component is created.





 |
| mobilePlatform | 

Field Type

MobileSecurityMobilePlatform (enumeration of type string)

Description

The mobile operating system of the mobile security policy.

Values are:

- Android
- iOS





 |
| mobileSecurityAssignment | 

Field Type

string

Description

The name of the mobile security assignment associated with the mobile security policy. See [MobileSecurityAssignment](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_mobilesecurityassignment.htm "Represents the assignment of mobile app security policies to a profile. The policies apply to the Salesforce mobile app with Enhanced Mobile App Security enabled.").



 |
| ruleValue | 

Field Type

string

Description

Required. The value of the mobile security policy rule.





 |
| ruleValueType | 

Field Type

MobileSecurityPolicyRuleValueType (enumeration of type string)

Description

Required. The type of mobile security policy rule.

Values are:

- Boolean
- Text
- TextList





 |
| severityLevel | 

Field Type

MobileSecurityPolicySeverityLevel (enumeration of type string)

Description

Required. The severity level of a mobile security policy.

Values are:

- Critical— Wipes app data and logs user out
- Error—Blocks access to the app until the issue is resolved, but doesn’t log user out
- Info— Blocks prohibited action or logs user action and informs user
- Warn—Notifies the user of the violation and recommends how to resolve, but user is able to continue using the app





 |
| type | 

Field Type

MobileSecurityPolicyType (enumeration of type string)

Description

Required. The type of mobile security policy.

Values are:

- AllowedDeviceList
- Block3dTouch
- BlockCalendar
- BlockCamera
- BlockContacts
- BlockCustomKeyboard
- BlockFileBackup
- BlockMicrophone
- BlockOsSharing
- BlockedDeviceList
- BrowserUriScheme
- CheckBiometric
- DevicePasscode
- DisableUrlCaching
- JailbrokenDevice
- LogCertPin
- LogEmail
- LogPhonecall
- LogPolicyResult
- LogScreenshot
- LogTextmessage
- LogoutAfterRestart
- LogoutOnBiometricChange
- MalwareDetection
- ManInMiddle
- MaxOffline
- MaximumAppVersion
- MaximumOsVersion
- MinimumAppVersion
- MinimumOsVersion
- MinimumSecurityPatchVersion
- MininumAppVersion
- PhonecallUriScheme
- Screenshot





 |

## Declarative Metadata Sample Definition

The following is an example of a MobileSecurityPolicy component.

<?xml version="1.0" encoding="UTF-8"?>
<MobileSecurityPolicy xmlns="http://soap.sforce.com/2006/04/metadata">
    <effectiveDate\>2022-08-09T22:04:56.000Z</effectiveDate\>
    <isEnabled\>true</isEnabled\>
    <isProtected\>false</isProtected\>
    <masterLabel\>MyMobileSecurityPolicy</masterLabel\>
    <mobileSecurityAssignment\>MyMobileSecurityAssignment</mobileSecurityAssignment\>
    <ruleValue\>true</ruleValue\>
    <ruleValueType\>Boolean</ruleValueType\>
    <severityLevel\>info</severityLevel\>
    <type\>BlockCalendar</type\>
    <mobilePlatform\>Android</mobilePlatform\>
</MobileSecurityPolicy\>

The following is an example package.xml that references the previous definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types\>
        <members\>\*</members\>
        <name\>MobileSecurityPolicy</name\>
    </types\>
    <version\>61.0</version\>
</Package\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based_zip_file.htm "The deploy() and retrieve() calls are used to deploy and retrieve a .zip file. Within the .zip file is a project manifest (package.xml) that lists what to retrieve or deploy, and one or more XML components that are organized into folders.").