<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LocalAuthentication",
  "identifier" : "/documentation/LocalAuthentication/LAContext/evaluatePolicy(_:localizedReason:reply:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Local Authentication"
    ],
    "preciseIdentifier" : "c:objc(cs)LAContext(im)evaluatePolicy:localizedReason:reply:"
  },
  "title" : "evaluatePolicy(_:localizedReason:reply:)"
}
-->

# evaluatePolicy(_:localizedReason:reply:)

Evaluates the specified policy.

```
func evaluatePolicy(_ policy: LAPolicy, localizedReason: String, reply: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

## Parameters

`policy`

The policy to evaluate. For possible values, see [`LAPolicy`](/documentation/LocalAuthentication/LAPolicy).

`localizedReason`

The app-provided reason for requesting authentication, which displays in the authentication dialog presented to the user.

`reply`

A closure that is executed when policy evaluation finishes. This is evaluated on a private queue internal to the framework in an unspecified threading context. You must not call [`canEvaluatePolicy(_:error:)`](/documentation/LocalAuthentication/LAContext/canEvaluatePolicy(_:error:)) in this block, because doing so could lead to deadlock.

- success: <doc://com.apple.documentation/documentation/Swift/true> if policy evaluation succeeded, otherwise <doc://com.apple.documentation/documentation/Swift/false>.
- error: `nil` if policy evaluation succeeded, an error object that should be presented to the user otherwise. See [`LAError.Code`](/documentation/LocalAuthentication/LAError-swift.struct/Code) for possible error codes

## Discussion

> Important:
> You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:
> 
> ```swift
> func evaluatePolicy(_ policy: LAPolicy, localizedReason: String) async throws -> Bool
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

This method asynchronously evaluates an authentication policy. Evaluating a policy may involve prompting the user for various kinds of interaction or authentication. The actual behavior is dependent on the evaluated policy and the device type. The behavior can also be affected by installed configuration profiles.

> Note:
> To control the authentication prompt on devices that support it, attach the associated local authentication context to an <doc://com.apple.documentation/documentation/LocalAuthenticationEmbeddedUI/LAAuthenticationView> instance before calling this method.

In the localized string you present to the user in the authentication dialog, provide a clear reason for the authentication request, and describe the resulting action. Make the message short and clear, and provide it in the user’s language. Don’t include the app name, which already appears in the authentication dialog (in macOS, in the title of the dialog; in iOS, in the subtitle).

Don’t assume that a previous successful policy evaluation means that future evaluations will also succeed. Policy evaluation can fail for various reasons, including cancellation by the user or the system.

---

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)