<!--
{
  "availability" : [
    "macCatalyst: 17.4.0 -",
    "macOS: 14.4.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "LightweightCodeRequirements",
  "identifier" : "/documentation/LightweightCodeRequirements/SecTaskValidateForRequirement(task:requirement:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "LightweightCodeRequirements"
    ],
    "preciseIdentifier" : "s:27LightweightCodeRequirements29SecTaskValidateForRequirement4task11requirementSbSo0dE3Refa_AA07ProcessbH0VtKF"
  },
  "title" : "SecTaskValidateForRequirement(task:requirement:)"
}
-->

# SecTaskValidateForRequirement(task:requirement:)

Tests whether a task’s executable satisfies a lightweight code requirement.

```
func SecTaskValidateForRequirement(task: SecTask, requirement: ProcessCodeRequirement) throws -> Bool
```

## Parameters

`task`

An object that represents the running task.

`requirement`

The lightweight code requirement to test.

## Return Value

If the requirement matches the process, then `true`; `false` if it doesn’t.

## Discussion

This function throws a value from [`ConstraintError`](/documentation/LightweightCodeRequirements/ConstraintError) if it can’t evaluate whether the executable satisfies the lightweight code requirement.

---

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)