<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeviceManagement",
  "identifier" : "/documentation/DeviceManagement/PasscodeSettings",
  "metadataVersion" : "0.1.0",
  "role" : "Object",
  "symbol" : {
    "kind" : "Object",
    "modules" : [
      "Device Management"
    ],
    "preciseIdentifier" : "rmdm-declarations:PasscodeSettings"
  },
  "title" : "PasscodeSettings"
}
-->

# PasscodeSettings

The declaration to configure passcode policy settings.

```
object PasscodeSettings
```

## Discussion

Specify `com.apple.configuration.passcode.settings` as the declaration type.

The presence of this configuration type causes the device to present the user with a passcode entry mechanism. The configuration controls the complexity of the passcode.

For user enrollments, the system allows this configuration type, but ignores most of the keys. Instead, the presence of the configuration forces only these settings:

- `RequirePasscode`: always set to `true`
- `RequireComplexPasscode`: always set to `true`
- `MinimumLength`: always set to `6`
- `MaximumInactivityInMinutes`: if this key is present its value is ignored, but the `never` option is removed in the Settings UI.

### Configuration availability

|||
|--------------------------------|------------------------------------------------------------------------------------|
|Allowed in supervised enrollment|iOS, macOS, visionOS, watchOS                                                       |
|Allowed in device enrollment    |iOS, visionOS                                                                       |
|Allowed in user enrollment      |iOS, visionOS                                                                       |
|Allowed in local enrollment     |iOS, macOS, visionOS, watchOS                                                       |
|Allowed in system scope         |iOS, macOS, visionOS, watchOS                                                       |
|Allowed in user scope           |macOS                                                                               |
|Apply                           |Multiple configurations are combined and applied as a single effective configuration|

### Configuration examples

**Complex:**

This configuration applies a complex passcode policy.

```json
{
    "Type": "com.apple.configuration.passcode.settings",
    "Identifier": "EB13EE2B-5D63-4EBA-810F-5B81D07F5017",
    "ServerToken": "E180CA9A-F089-4FA3-BBDF-94CC159C4AE8",
    "Payload": {
        "RequirePasscode": true,
        "RequireComplexPasscode": true,
        "MinimumLength": 10,
        "MaximumInactivityInMinutes": 1
    }
}
```

**Regular expression:**

This configuration applies a passcode policy using a regular expression.

```json
{
    "Type": "com.apple.configuration.passcode.settings",
    "Identifier": "EB13EE2B-5D63-4EBA-810F-5B81D07F5017",
    "ServerToken": "E180CA9A-F089-4FA3-BBDF-94CC159C4AE8",
    "Payload": {
        "CustomRegex": {
            "Regex": "^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{8,}$",
            "Description": {
                "default": "Default: Minimum 8 characters, 1 number, 1 uppercase, 1 lowercase.",
                "en-US": "Minimum 8 characters, 1 number, 1 uppercase, 1 lowercase.",
                "fr": "Minimum 8 caractères, 1 chiffre, 1 majuscule, 1 minuscule."
            }
        }
    }
}
```

## Topics

### Objects

[`PasscodeSettingsCustomRegexObject`](/documentation/DeviceManagement/PasscodeSettingsCustomRegexObject)

Specifies a regular expression, and its description, to enforce password compliance. Use the simpler passcode settings 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.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)