title: Passcode description: The payload that configures a passcode policy. payload: payloadtype: com.apple.mobiledevice.passwordpolicy supportedOS: iOS: introduced: '4.0' deprecated: '27.0' multiple: true supervised: false allowmanualinstall: true sharedipad: mode: forbidden userenrollment: mode: allowed macOS: introduced: '10.7' deprecated: '27.0' multiple: true devicechannel: true userchannel: true supervised: false requiresdep: false userapprovedmdm: false allowmanualinstall: true userenrollment: mode: forbidden tvOS: introduced: n/a visionOS: introduced: '2.0' deprecated: '27.0' multiple: true supervised: false allowmanualinstall: true userenrollment: mode: allowed watchOS: introduced: '10.0' deprecated: '27.0' multiple: true supervised: false allowmanualinstall: true payloadkeys: - key: allowSimple title: Allow simple value supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored type: presence: optional default: true content: If `false`, the system prevents use of a simple passcode. A simple passcode contains repeated characters, or increasing or decreasing characters, such as `123` or `CBA`. - key: forcePIN title: Require passcode on device supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored type: presence: optional default: false content: If `true`, the system forces the user to enter a PIN. - key: maxFailedAttempts title: Maximum number of failed attempts supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored type: presence: optional range: min: 2 max: 11 default: 11 content: |- The number of failed passcode attempts that the system allows the user before it erases or locks the device. After six failed attempts, the device imposes a time delay before the user can enter a passcode again. The time delay increases with each failed attempt. On macOS, set `minutesUntilFailedLoginReset` to define the time delay. The time delay begins after the sixth attempt, so if `MaximumFailedAttempts` is six or lower, the system has no time delay and triggers the erase or lock as soon as the user exceeds the limit. After the final failed attempt, the system locks a macOS device, or securely erases all data and settings from an iOS, visionOS, or watchOS device. - key: maxInactivity title: Auto-lock supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored type: presence: optional range: min: 0 max: 15 content: |- The maximum number of minutes for which the device can be idle without the user unlocking it, before the system locks it. When this limit is reached, the system locks the device and the passcode is required to unlock it. The user can edit this setting, but the value can't exceed the `maxInactivity` value. On macOS, the system translates this inactivity value to screen-saver settings. The maximum value for macOS is `60`. Setting this key removes the `never` option in the Settings UI on user enrolled devices. - key: maxPINAgeInDays title: Maximum passcode age supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored type: presence: optional range: min: 1 max: 730 content: The number of days for which the passcode can remain unchanged. After this number of days, the system forces the user to change the passcode before it unlocks the device. - key: minComplexChars title: Minimum number of complex characters supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored watchOS: introduced: n/a type: presence: optional range: min: 0 max: 4 default: 0 content: |- The minimum number of complex characters that a passcode needs to contain. A _complex_ character is a character other than a number or a letter, such as `&`, `%`, `$`, and `#`. The system ignores this property for user enrollments. - key: minLength title: Minimum passcode length supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored type: presence: optional range: min: 0 max: 16 default: 0 content: The minimum overall length of the passcode. This value is independent of the value for `minComplexChars`. - key: requireAlphanumeric title: Require alphabetic value supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored watchOS: introduced: n/a type: presence: optional default: false content: If `true`, the system requires alphabetic characters instead of only numeric characters. - key: pinHistory title: Passcode history supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored type: presence: optional range: min: 1 max: 50 content: This value defines _N_, where the new passcode must be unique within the last _N_ entries in the passcode history. - key: maxGracePeriod title: Grace period for device lock supportedOS: iOS: userenrollment: mode: ignored visionOS: userenrollment: mode: ignored type: presence: optional default: 0 content: The maximum grace period, in minutes, to unlock the phone without entering a passcode. The default is `0`, which is no grace period and requires a passcode immediately. On macOS, the system translates this grace period value to screen-saver settings. - key: minutesUntilFailedLoginReset supportedOS: iOS: introduced: n/a macOS: introduced: '10.10' userenrollment: mode: ignored visionOS: introduced: n/a watchOS: introduced: n/a type: presence: optional content: The number of minutes before the system resets the login after the maximum number of unsuccessful login attempts is reached. This key requires setting `maxFailedAttempts`. - key: changeAtNextAuth supportedOS: iOS: introduced: n/a macOS: introduced: '10.13' userenrollment: mode: ignored visionOS: introduced: n/a watchOS: introduced: n/a type: presence: optional default: false content: If `true`, the system causes a password reset to occur the next time the user tries to authenticate. If this key is set in a device profile, the setting takes effect for all users, and admin authentications may fail until the admin user password is also reset. - key: customRegex supportedOS: iOS: introduced: n/a macOS: introduced: '14.0' visionOS: introduced: n/a watchOS: introduced: n/a type: presence: optional content: Specifies a regular expression, and its description, used to enforce password compliance. Use the simpler passcode restrictions whenever possible, and rely on regular expression matching only when necessary. Mistakes in regular expressions can lead to frustrating user experiences, such as unsatisfiable passcode policies, or policy descriptions that don't match the enforced policy. subkeys: - key: passwordContentRegex type: presence: required content: A regular expression string that the system matches against the password to determine whether it complies with a policy. The regular expression uses the ICU syntax ([https://unicode-org.github.io/icu/userguide/strings/regexp.html](https://unicode-org.github.io/icu/userguide/strings/regexp.html)). The string must not exceed 2048 characters in length. - key: passwordContentDescription type: presence: optional content: Contains a dictionary of keys for supported OS language IDs (for example, "en-US"), and whose values represent a localized description of the policy enforced by the regular expression. Use the special `default` key can for languages that aren't contained in the dictionary. subkeys: - key: ANY type: presence: optional content: A localized description. notes: - title: '' content: |- The presence of this payload type causes the device to present the user with a passcode entry mechanism. The payload controls the complexity of the passcode. For user enrollments, the system allows this payload type, but ignores most of the keys. Instead, the presence of the payload forces only these settings: - `allowSimple`: always set to `false` - `forcePIN`: always set to `true` - `minLength`: always set to `6` - `maxInactivity`: if this key is present its value is ignored, but the `never` option is removed in the Settings UI. examples: - title: Profile example files: - file: examples/mdm/profiles/com.apple.mobiledevice.passwordpolicy/example1.plist