> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-cloud-api/aspm-cicd-and-application-security/policy-exceptions.md).

# Policy Exceptions

APIs for managing policy exceptions. Exceptions apply to Application Security (`appsec`) policies. An exception takes effect only while it is `APPROVED` and has not expired.

## List all policy exceptions

> Retrieves the policy exceptions, optionally filtered by ID, status, or creator. Each item in the response is the complete exception, with the same fields as the create and update responses. Filters are combined with a logical AND. The array is empty when no exception matches.\
> \
> The response is not paginated. All matching exceptions are returned in a single response.\
> \
> \*\*Required role:\*\* Any role with Posture Policy Exceptions (\`posture\_policy\_exceptions\_view\` or \`posture\_policy\_exceptions\_edit\`) set to View/Edit, or Posture Policy Exceptions Approval (\`posture\_policy\_exceptions\_approval\`) set to Edit.\
> \
> \> #### Required license:\
> \>\
> \> Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex Cloud"},"tags":[{"name":"Policy Exceptions","description":"APIs for managing policy exceptions. Exceptions apply to Application Security (`appsec`) policies. An exception takes effect only while it is `APPROVED` and has not expired."}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/policies/exceptions":{"get":{"operationId":"ListPolicyExceptions","summary":"List all policy exceptions","tags":["Policy Exceptions"],"description":"Retrieves the policy exceptions, optionally filtered by ID, status, or creator. Each item in the response is the complete exception, with the same fields as the create and update responses. Filters are combined with a logical AND. The array is empty when no exception matches.\n\nThe response is not paginated. All matching exceptions are returned in a single response.\n\n**Required role:** Any role with Posture Policy Exceptions (`posture_policy_exceptions_view` or `posture_policy_exceptions_edit`) set to View/Edit, or Posture Policy Exceptions Approval (`posture_policy_exceptions_approval`) set to Edit.\n\n> #### Required license:\n>\n> Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.","parameters":[{"in":"header","name":"Authorization","required":true,"description":"{api_key}","schema":{"type":"string"}},{"in":"header","name":"x-xdr-auth-id","required":true,"description":"{api_key_id}","schema":{"type":"string"}},{"in":"query","name":"id","required":false,"schema":{"type":"string","format":"uuid"},"description":"Return only the exception with this ID."},{"in":"query","name":"status","required":false,"schema":{"$ref":"#/components/schemas/PolicyExceptionStatus"},"description":"Return only exceptions with this status: `PENDING_APPROVAL`, `APPROVED`, or `REJECTED`."},{"in":"query","name":"createdBy","required":false,"schema":{"type":"string"},"description":"Return only exceptions created by this user or API key (for example, `API Token 1`)."}],"responses":{"200":{"description":"OK. An array of policy exceptions.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PolicyException"}}}}},"401":{"description":"Unauthorized. The `Authorization` or `x-xdr-auth-id` header is missing or invalid. The response has no body."},"422":{"description":"Unprocessable Entity. A query parameter has an invalid value.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}}}}}},"components":{"schemas":{"PolicyExceptionStatus":{"enum":["PENDING_APPROVAL","APPROVED","REJECTED"],"type":"string","description":"Review status of a policy exception.\n- `PENDING_APPROVAL` — Waiting for review. The exception has no effect yet.\n- `APPROVED` — Approved. The exception is in effect.\n- `REJECTED` — Rejected. The exception has no effect."},"PolicyException":{"properties":{"userSbac":{"items":{"type":"number","format":"double"},"type":"array","description":"Asset group IDs that scope the caller's access when the exception was saved. `-1` means all asset groups."},"reviewReason":{"type":"string","description":"Optional approval note. Saved only if the exception is approved when it's created, which happens when the caller has the `posture_policy_exceptions_approval` permission or is an administrator. Otherwise this value is ignored."},"dateReviewed":{"type":"string","format":"date-time","description":"Date and time of the last review."},"reviewedBy":{"type":"string","description":"User or API key that last approved or rejected the exception."},"modifiedBy":{"type":"string","description":"User or API key that last modified the exception."},"dateModified":{"type":"string","format":"date-time","description":"Date and time the exception was last modified."},"dateCreated":{"type":"string","format":"date-time","description":"Date and time the exception was created."},"createdBy":{"type":"string","description":"User or API key that created the exception."},"dateExpires":{"type":"string","format":"date-time","description":"Date and time the exception expires."},"status":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionStatus"}],"description":"Review status of the exception."},"assetGroupIds":{"items":{"type":"number","format":"double"},"type":"array","description":"IDs of the asset groups the exception is limited to. When empty, the exception is not limited to asset groups."},"conditions":{"items":{"$ref":"#/components/schemas/CortexCondition"},"type":"array","description":"Conditions that select the findings to exclude. Each condition must include a `Finding Type` field."},"bindings":{"items":{"$ref":"#/components/schemas/PolicyExceptionBinding"},"type":"array","description":"The policies that the exception applies to, one binding per policy type."},"reasonCategory":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionReasonCategory"}],"description":"Reason for the exception."},"description":{"type":"string","description":"Description of the exception, at most 2000 characters."},"name":{"type":"string","description":"Name of the exception. It must be unique and at most 200 characters."},"id":{"type":"string","description":"Unique identifier (UUID) of the exception."}},"required":["userSbac","dateModified","dateCreated","createdBy","status","assetGroupIds","conditions","bindings","reasonCategory","name","id"],"type":"object","description":"A policy exception."},"CortexCondition":{"type":"object","title":"CortexCondition","description":"Condition or scope filter for the policy. ","additionalProperties":false,"properties":{"SEARCH_FIELD":{"type":"string","description":"Field the condition filter matches."},"SEARCH_TYPE":{"$ref":"#/components/schemas/ConditionOperators"},"SEARCH_VALUE":{"description":"The value compared against. The type of this field will differ depending on the `SEARCH_FIELD` that was specified.","anyOf":[{"type":"boolean"},{"$ref":"#/components/schemas/ConditionValue"},{"type":"number","format":"double"},{"type":"string"}]},"AND":{"type":"array","items":{"$ref":"#/components/schemas/CortexCondition"}},"OR":{"type":"array","items":{"$ref":"#/components/schemas/CortexCondition"}}}},"ConditionOperators":{"type":"string","enum":["ARRAY_CONTAINS","ARRAY_NOT_CONTAINS","CONTAINS","CONTAINS_IN_LIST","EQ","GT","GTE","IN","JSON_WILDCARD","JSON_WILDCARD_NOT","LTE","LT","NCONTAINS","NEQ","NIN","NOT_CONTAINS_IN_LIST","RANGE","RELATIVE_TIMESTAMP","STARTS_WITH","WILDCARD","WILDCARD_NOT","withinGracePeriod"],"title":"ConditionOperators","description":"Condition operator for this filter."},"ConditionValue":{"properties":{"from":{"type":"number","format":"double","description":"The lower bound of a range query."},"to":{"type":"number","format":"double","description":"The upper bound of a range query."},"key":{"type":"string","description":"The key for key-value pair matching."},"value":{"type":"string","description":"The value for key-value pair matching."}},"type":"object","additionalProperties":false,"description":"A structured condition value used for range queries or key-value pair matching."},"PolicyExceptionBinding":{"properties":{"policies":{"items":{"$ref":"#/components/schemas/PolicyExceptionPolicyRef"},"type":"array","description":"The policies to bind the exception to. Used with the `SPECIFIC` mode. The policy IDs are not validated."},"mode":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionBindingType"}],"description":"`GLOBAL` binds the exception to all policies of the type. `SPECIFIC` binds it to the policies in `policies`."},"policyType":{"anyOf":[{"$ref":"#/components/schemas/PolicyExceptionPolicyType"},{"type":"string"}],"description":"Type of policy the binding applies to. Use `appsec` for Application Security policies."}},"required":["mode","policyType"],"type":"object","description":"Binds an exception to the policies of one policy type. A policy type can appear only once in `bindings`."},"PolicyExceptionPolicyRef":{"properties":{"policyName":{"type":"string","description":"Name of the policy."},"policyId":{"type":"string","description":"ID of the policy."}},"required":["policyName","policyId"],"type":"object","description":"Reference to a policy that an exception is bound to."},"PolicyExceptionBindingType":{"enum":["GLOBAL","SPECIFIC"],"type":"string","description":"How an exception is bound to policies of a policy type.\n- `GLOBAL` — The exception applies to all policies of the policy type.\n- `SPECIFIC` — The exception applies only to the policies listed in `policies`."},"PolicyExceptionPolicyType":{"enum":["appsec","cloud_workload","cloud_security","vulnerability_management"],"type":"string","description":"Type of policy that an exception can be bound to. Application Security exceptions use `appsec`. Only `appsec` exceptions are applied during scans.\n- `appsec` — Application Security policies.\n- `cloud_workload` — Cloud workload policies.\n- `cloud_security` — Cloud security policies.\n- `vulnerability_management` — Vulnerability management policies."},"PolicyExceptionReasonCategory":{"enum":["RISK_ACCEPTED","VENDOR_DEPENDENCY","PLANNED_REMEDIATION","COMPENSATING_CONTROL","FALSE_POSITIVE","OTHER"],"type":"string","description":"Reason for the exception.\n- `RISK_ACCEPTED` — The organization accepts the risk.\n- `VENDOR_DEPENDENCY` — The risk depends on a vendor fix.\n- `PLANNED_REMEDIATION` — The finding will be fixed as planned.\n- `COMPENSATING_CONTROL` — Another control mitigates the risk.\n- `FALSE_POSITIVE` — The finding is not a real issue.\n- `OTHER` — Another reason."},"ValidationErrorResponse":{"type":"object","required":["errorCode","message","details"],"properties":{"errorCode":{"type":"string","enum":["ValidateError"],"description":"Always `ValidateError`."},"message":{"type":"string","description":"Always `Validation Failed`."},"details":{"type":"object","additionalProperties":{"type":"object","properties":{"message":{"type":"string"},"value":{}}},"description":"The failed fields. Each key is the path of a field, and each value has the validation `message` and the rejected `value`."}},"description":"Error returned when the request does not match the schema.","additionalProperties":false}}}}
```

## Create a policy exception

> A policy exception excludes the findings that match its conditions from the policies it is bound to, so those findings no longer trigger the policy actions. \
> \
> Creates a policy exception. The \`name\` must be unique, \`description\` is required, and \`conditions\` must contain at least one condition that includes a Finding Type. Use \`bindings\` to bind the exception globally to all policies of a policy type (\`GLOBAL\`) or to specific policies (\`SPECIFIC\`); each policy type can appear once.\
> \
> The status of the new exception depends on the caller's permissions:\
> \
> \- If the caller has the \`posture\_policy\_exceptions\_approval\` permission or is an administrator, the exception is created as \`APPROVED\` and takes effect immediately.\
> \- Otherwise, the exception is created as \`PENDING\_APPROVAL\` and has no effect until it is approved.\
> \
> \*\*Limitations:\*\*\
> \- A \`SPECIFIC\` binding is not checked against existing policies. An unknown policy ID is accepted and binds nothing.\
> \- An exception excuses the policy it is bound to, not the action. When several policies trigger the same action on a finding, the action is suppressed only if every one of those policies is excepted.\
> \- \`assetGroupIds\` limits the exception to those asset groups. IDs that no longer exist are ignored; if none of them resolve, the exception never matches.\
> \
> \*\*Required role:\*\* Any role with Posture Policy Exceptions (\`posture\_policy\_exceptions\_edit\`) set to Edit, or Posture Policy Exceptions Approval (\`posture\_policy\_exceptions\_approval\`) set to Edit.\
> \
> \*\*Required license:\*\* Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex Cloud"},"tags":[{"name":"Policy Exceptions","description":"APIs for managing policy exceptions. Exceptions apply to Application Security (`appsec`) policies. An exception takes effect only while it is `APPROVED` and has not expired."}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/policies/exceptions":{"post":{"operationId":"CreatePolicyException","summary":"Create a policy exception","tags":["Policy Exceptions"],"parameters":[{"in":"header","name":"Authorization","required":true,"description":"{api_key}","schema":{"type":"string"}},{"in":"header","name":"x-xdr-auth-id","required":true,"description":"{api_key_id}","schema":{"type":"string"}}],"description":"A policy exception excludes the findings that match its conditions from the policies it is bound to, so those findings no longer trigger the policy actions. \n\nCreates a policy exception. The `name` must be unique, `description` is required, and `conditions` must contain at least one condition that includes a Finding Type. Use `bindings` to bind the exception globally to all policies of a policy type (`GLOBAL`) or to specific policies (`SPECIFIC`); each policy type can appear once.\n\nThe status of the new exception depends on the caller's permissions:\n\n- If the caller has the `posture_policy_exceptions_approval` permission or is an administrator, the exception is created as `APPROVED` and takes effect immediately.\n- Otherwise, the exception is created as `PENDING_APPROVAL` and has no effect until it is approved.\n\n**Limitations:**\n- A `SPECIFIC` binding is not checked against existing policies. An unknown policy ID is accepted and binds nothing.\n- An exception excuses the policy it is bound to, not the action. When several policies trigger the same action on a finding, the action is suppressed only if every one of those policies is excepted.\n- `assetGroupIds` limits the exception to those asset groups. IDs that no longer exist are ignored; if none of them resolve, the exception never matches.\n\n**Required role:** Any role with Posture Policy Exceptions (`posture_policy_exceptions_edit`) set to Edit, or Posture Policy Exceptions Approval (`posture_policy_exceptions_approval`) set to Edit.\n\n**Required license:** Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.","requestBody":{"required":true,"description":"The policy exception to create.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePolicyExceptionRequest"}}}},"responses":{"201":{"description":"Created. The new policy exception.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyException"}}}},"401":{"description":"Unauthorized. The `Authorization` or `x-xdr-auth-id` header is missing or invalid. The response has no body."},"422":{"description":"Unprocessable Entity. The request body failed validation.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/PolicyExceptionValidationErrorResponse"}]}}}}}}}},"components":{"schemas":{"CreatePolicyExceptionRequest":{"properties":{"reviewReason":{"type":"string","description":"Reason recorded with the review when the exception is approved at creation."},"dateExpires":{"type":"string","description":"Date and time the exception expires. It must be in the future."},"assetGroupIds":{"items":{"type":"number","format":"double"},"type":"array","description":"IDs of the asset groups the exception is limited to. When empty, the exception is not limited to asset groups."},"conditions":{"items":{"$ref":"#/components/schemas/CortexCondition"},"type":"array","description":"Conditions that select the findings to exclude. Each condition must include a `Finding Type` field."},"bindings":{"items":{"$ref":"#/components/schemas/PolicyExceptionBinding"},"type":"array","description":"The policies that the exception applies to, one binding per policy type."},"reasonCategory":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionReasonCategory"}],"description":"Reason for the exception."},"description":{"type":"string","maxLength":2000,"description":"Description of the exception, at most 2000 characters."},"name":{"type":"string","maxLength":200,"description":"Name of the exception. It must be unique and at most 200 characters."}},"required":["description","conditions","bindings","reasonCategory","name"],"type":"object","description":"Request body to create a policy exception."},"CortexCondition":{"type":"object","title":"CortexCondition","description":"Condition or scope filter for the policy. ","additionalProperties":false,"properties":{"SEARCH_FIELD":{"type":"string","description":"Field the condition filter matches."},"SEARCH_TYPE":{"$ref":"#/components/schemas/ConditionOperators"},"SEARCH_VALUE":{"description":"The value compared against. The type of this field will differ depending on the `SEARCH_FIELD` that was specified.","anyOf":[{"type":"boolean"},{"$ref":"#/components/schemas/ConditionValue"},{"type":"number","format":"double"},{"type":"string"}]},"AND":{"type":"array","items":{"$ref":"#/components/schemas/CortexCondition"}},"OR":{"type":"array","items":{"$ref":"#/components/schemas/CortexCondition"}}}},"ConditionOperators":{"type":"string","enum":["ARRAY_CONTAINS","ARRAY_NOT_CONTAINS","CONTAINS","CONTAINS_IN_LIST","EQ","GT","GTE","IN","JSON_WILDCARD","JSON_WILDCARD_NOT","LTE","LT","NCONTAINS","NEQ","NIN","NOT_CONTAINS_IN_LIST","RANGE","RELATIVE_TIMESTAMP","STARTS_WITH","WILDCARD","WILDCARD_NOT","withinGracePeriod"],"title":"ConditionOperators","description":"Condition operator for this filter."},"ConditionValue":{"properties":{"from":{"type":"number","format":"double","description":"The lower bound of a range query."},"to":{"type":"number","format":"double","description":"The upper bound of a range query."},"key":{"type":"string","description":"The key for key-value pair matching."},"value":{"type":"string","description":"The value for key-value pair matching."}},"type":"object","additionalProperties":false,"description":"A structured condition value used for range queries or key-value pair matching."},"PolicyExceptionBinding":{"properties":{"policies":{"items":{"$ref":"#/components/schemas/PolicyExceptionPolicyRef"},"type":"array","description":"The policies to bind the exception to. Used with the `SPECIFIC` mode. The policy IDs are not validated."},"mode":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionBindingType"}],"description":"`GLOBAL` binds the exception to all policies of the type. `SPECIFIC` binds it to the policies in `policies`."},"policyType":{"anyOf":[{"$ref":"#/components/schemas/PolicyExceptionPolicyType"},{"type":"string"}],"description":"Type of policy the binding applies to. Use `appsec` for Application Security policies."}},"required":["mode","policyType"],"type":"object","description":"Binds an exception to the policies of one policy type. A policy type can appear only once in `bindings`."},"PolicyExceptionPolicyRef":{"properties":{"policyName":{"type":"string","description":"Name of the policy."},"policyId":{"type":"string","description":"ID of the policy."}},"required":["policyName","policyId"],"type":"object","description":"Reference to a policy that an exception is bound to."},"PolicyExceptionBindingType":{"enum":["GLOBAL","SPECIFIC"],"type":"string","description":"How an exception is bound to policies of a policy type.\n- `GLOBAL` — The exception applies to all policies of the policy type.\n- `SPECIFIC` — The exception applies only to the policies listed in `policies`."},"PolicyExceptionPolicyType":{"enum":["appsec","cloud_workload","cloud_security","vulnerability_management"],"type":"string","description":"Type of policy that an exception can be bound to. Application Security exceptions use `appsec`. Only `appsec` exceptions are applied during scans.\n- `appsec` — Application Security policies.\n- `cloud_workload` — Cloud workload policies.\n- `cloud_security` — Cloud security policies.\n- `vulnerability_management` — Vulnerability management policies."},"PolicyExceptionReasonCategory":{"enum":["RISK_ACCEPTED","VENDOR_DEPENDENCY","PLANNED_REMEDIATION","COMPENSATING_CONTROL","FALSE_POSITIVE","OTHER"],"type":"string","description":"Reason for the exception.\n- `RISK_ACCEPTED` — The organization accepts the risk.\n- `VENDOR_DEPENDENCY` — The risk depends on a vendor fix.\n- `PLANNED_REMEDIATION` — The finding will be fixed as planned.\n- `COMPENSATING_CONTROL` — Another control mitigates the risk.\n- `FALSE_POSITIVE` — The finding is not a real issue.\n- `OTHER` — Another reason."},"PolicyException":{"properties":{"userSbac":{"items":{"type":"number","format":"double"},"type":"array","description":"Asset group IDs that scope the caller's access when the exception was saved. `-1` means all asset groups."},"reviewReason":{"type":"string","description":"Optional approval note. Saved only if the exception is approved when it's created, which happens when the caller has the `posture_policy_exceptions_approval` permission or is an administrator. Otherwise this value is ignored."},"dateReviewed":{"type":"string","format":"date-time","description":"Date and time of the last review."},"reviewedBy":{"type":"string","description":"User or API key that last approved or rejected the exception."},"modifiedBy":{"type":"string","description":"User or API key that last modified the exception."},"dateModified":{"type":"string","format":"date-time","description":"Date and time the exception was last modified."},"dateCreated":{"type":"string","format":"date-time","description":"Date and time the exception was created."},"createdBy":{"type":"string","description":"User or API key that created the exception."},"dateExpires":{"type":"string","format":"date-time","description":"Date and time the exception expires."},"status":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionStatus"}],"description":"Review status of the exception."},"assetGroupIds":{"items":{"type":"number","format":"double"},"type":"array","description":"IDs of the asset groups the exception is limited to. When empty, the exception is not limited to asset groups."},"conditions":{"items":{"$ref":"#/components/schemas/CortexCondition"},"type":"array","description":"Conditions that select the findings to exclude. Each condition must include a `Finding Type` field."},"bindings":{"items":{"$ref":"#/components/schemas/PolicyExceptionBinding"},"type":"array","description":"The policies that the exception applies to, one binding per policy type."},"reasonCategory":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionReasonCategory"}],"description":"Reason for the exception."},"description":{"type":"string","description":"Description of the exception, at most 2000 characters."},"name":{"type":"string","description":"Name of the exception. It must be unique and at most 200 characters."},"id":{"type":"string","description":"Unique identifier (UUID) of the exception."}},"required":["userSbac","dateModified","dateCreated","createdBy","status","assetGroupIds","conditions","bindings","reasonCategory","name","id"],"type":"object","description":"A policy exception."},"PolicyExceptionStatus":{"enum":["PENDING_APPROVAL","APPROVED","REJECTED"],"type":"string","description":"Review status of a policy exception.\n- `PENDING_APPROVAL` — Waiting for review. The exception has no effect yet.\n- `APPROVED` — Approved. The exception is in effect.\n- `REJECTED` — Rejected. The exception has no effect."},"ValidationErrorResponse":{"type":"object","required":["errorCode","message","details"],"properties":{"errorCode":{"type":"string","enum":["ValidateError"],"description":"Always `ValidateError`."},"message":{"type":"string","description":"Always `Validation Failed`."},"details":{"type":"object","additionalProperties":{"type":"object","properties":{"message":{"type":"string"},"value":{}}},"description":"The failed fields. Each key is the path of a field, and each value has the validation `message` and the rejected `value`."}},"description":"Error returned when the request does not match the schema.","additionalProperties":false},"PolicyExceptionValidationErrorResponse":{"type":"object","required":["errorCode","message","details"],"properties":{"errorCode":{"type":"string","enum":["PolicyExceptionValidationError"],"description":"Always `PolicyExceptionValidationError`."},"message":{"type":"string","description":"Summary of the failed rules."},"details":{"type":"string","description":"JSON-encoded array of objects with the `field` and the `message` of each failed rule."}},"description":"Error returned when a policy exception breaks a field rule.","additionalProperties":false}}}}
```

## Delete a policy exception

> Permanently deletes the policy exception. This action can't be undone. The exception is also removed from every policy it was bound to.\
> \
> \*\*Required role:\*\* Any role with Posture Policy Exceptions (\`posture\_policy\_exceptions\_edit\`) set to Edit, or Posture Policy Exceptions Approval (\`posture\_policy\_exceptions\_approval\`) set to Edit.\
> \
> \*\*Required license\*\*: Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex Cloud"},"tags":[{"name":"Policy Exceptions","description":"APIs for managing policy exceptions. Exceptions apply to Application Security (`appsec`) policies. An exception takes effect only while it is `APPROVED` and has not expired."}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/policies/exceptions/{id}":{"delete":{"operationId":"DeletePolicyException","summary":"Delete a policy exception","tags":["Policy Exceptions"],"parameters":[{"in":"header","name":"Authorization","required":true,"description":"{api_key}","schema":{"type":"string"}},{"in":"header","name":"x-xdr-auth-id","required":true,"description":"{api_key_id}","schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"Unique identifier (UUID) of the policy exception. You can retrieve this value from the `id` field in the response of the **List all policy exceptions** endpoint."}],"description":"Permanently deletes the policy exception. This action can't be undone. The exception is also removed from every policy it was bound to.\n\n**Required role:** Any role with Posture Policy Exceptions (`posture_policy_exceptions_edit`) set to Edit, or Posture Policy Exceptions Approval (`posture_policy_exceptions_approval`) set to Edit.\n\n**Required license**: Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.","responses":{"204":{"description":"No Content. The policy exception was deleted. The response has no body."},"401":{"description":"Unauthorized. The `Authorization` or `x-xdr-auth-id` header is missing or invalid. The response has no body."},"404":{"description":"Not Found. No policy exception exists with the specified ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ErrorResponse":{"type":"object","required":["errorCode","message"],"properties":{"errorCode":{"type":"string","description":"Error type, for example `BadParamsError`, `ForbiddenError`, `NotFoundError` or `ConflictError`.","not":{"enum":["ValidateError","PolicyExceptionValidationError"]}},"message":{"type":"string","description":"Description of the error."}},"description":"Error returned for a business-rule failure, a permission problem, a conflict, or a missing object.","additionalProperties":false}}}}
```

## Update a policy exception

> Updates a policy exception. Send only the fields you want to change; omitted fields keep their current values. To remove the expiry date, send \`dateExpires: null\`.\
> \
> Any user with the \`posture\_policy\_exceptions\_edit\` permission can edit an exception in \`PENDING\_APPROVAL\` status. Editing an exception in \`APPROVED\` or \`REJECTED\` status requires the \`posture\_policy\_exceptions\_approval\` permission. Editing an exception doesn't change its status. The name must stay unique.\
> \
> \*\*Required role:\*\* Any role with Posture Policy Exceptions (\`posture\_policy\_exceptions\_edit\`) set to Edit, or Posture Policy Exceptions Approval (\`posture\_policy\_exceptions\_approval\`) set to Edit.\
> \
> \> #### Required license:\
> \>\
> \> Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex Cloud"},"tags":[{"name":"Policy Exceptions","description":"APIs for managing policy exceptions. Exceptions apply to Application Security (`appsec`) policies. An exception takes effect only while it is `APPROVED` and has not expired."}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/policies/exceptions/{id}":{"patch":{"operationId":"UpdatePolicyException","summary":"Update a policy exception","tags":["Policy Exceptions"],"parameters":[{"in":"header","name":"Authorization","required":true,"description":"{api_key}","schema":{"type":"string"}},{"in":"header","name":"x-xdr-auth-id","required":true,"description":"{api_key_id}","schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"Unique identifier (UUID) of the policy exception. You can retrieve this value from the `id` field in the response of the **List all policy exceptions** endpoint."}],"description":"Updates a policy exception. Send only the fields you want to change; omitted fields keep their current values. To remove the expiry date, send `dateExpires: null`.\n\nAny user with the `posture_policy_exceptions_edit` permission can edit an exception in `PENDING_APPROVAL` status. Editing an exception in `APPROVED` or `REJECTED` status requires the `posture_policy_exceptions_approval` permission. Editing an exception doesn't change its status. The name must stay unique.\n\n**Required role:** Any role with Posture Policy Exceptions (`posture_policy_exceptions_edit`) set to Edit, or Posture Policy Exceptions Approval (`posture_policy_exceptions_approval`) set to Edit.\n\n> #### Required license:\n>\n> Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.","requestBody":{"required":true,"description":"The fields to change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePolicyExceptionRequest"}}}},"responses":{"200":{"description":"OK. The updated policy exception.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyException"}}}},"401":{"description":"Unauthorized. The `Authorization` or `x-xdr-auth-id` header is missing or invalid. The response has no body."},"403":{"description":"Forbidden. The exception is `APPROVED` or `REJECTED` and the API key lacks the policy exception approval permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found. No policy exception exists with the specified ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity. The request body failed validation.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/PolicyExceptionValidationErrorResponse"}]}}}}}}}},"components":{"schemas":{"UpdatePolicyExceptionRequest":{"properties":{"dateExpires":{"type":"string","nullable":true,"description":"Date and time the exception expires. It must be in the future. Set to `null` to remove the expiry date."},"assetGroupIds":{"items":{"type":"number","format":"double"},"type":"array","description":"IDs of the asset groups the exception is limited to. When empty, the exception is not limited to asset groups."},"conditions":{"items":{"$ref":"#/components/schemas/CortexCondition"},"type":"array","description":"Conditions that select the findings to exclude. Each condition must include a `Finding Type` field."},"bindings":{"items":{"$ref":"#/components/schemas/PolicyExceptionBinding"},"type":"array","description":"The policies that the exception applies to, one binding per policy type."},"reasonCategory":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionReasonCategory"}],"description":"Reason for the exception."},"description":{"type":"string","maxLength":2000,"description":"Description of the exception, at most 2000 characters."},"name":{"type":"string","maxLength":200,"description":"Name of the exception. It must be unique and at most 200 characters."}},"type":"object","description":"Request body to update a policy exception. All fields are optional; omitted fields keep their current values."},"CortexCondition":{"type":"object","title":"CortexCondition","description":"Condition or scope filter for the policy. ","additionalProperties":false,"properties":{"SEARCH_FIELD":{"type":"string","description":"Field the condition filter matches."},"SEARCH_TYPE":{"$ref":"#/components/schemas/ConditionOperators"},"SEARCH_VALUE":{"description":"The value compared against. The type of this field will differ depending on the `SEARCH_FIELD` that was specified.","anyOf":[{"type":"boolean"},{"$ref":"#/components/schemas/ConditionValue"},{"type":"number","format":"double"},{"type":"string"}]},"AND":{"type":"array","items":{"$ref":"#/components/schemas/CortexCondition"}},"OR":{"type":"array","items":{"$ref":"#/components/schemas/CortexCondition"}}}},"ConditionOperators":{"type":"string","enum":["ARRAY_CONTAINS","ARRAY_NOT_CONTAINS","CONTAINS","CONTAINS_IN_LIST","EQ","GT","GTE","IN","JSON_WILDCARD","JSON_WILDCARD_NOT","LTE","LT","NCONTAINS","NEQ","NIN","NOT_CONTAINS_IN_LIST","RANGE","RELATIVE_TIMESTAMP","STARTS_WITH","WILDCARD","WILDCARD_NOT","withinGracePeriod"],"title":"ConditionOperators","description":"Condition operator for this filter."},"ConditionValue":{"properties":{"from":{"type":"number","format":"double","description":"The lower bound of a range query."},"to":{"type":"number","format":"double","description":"The upper bound of a range query."},"key":{"type":"string","description":"The key for key-value pair matching."},"value":{"type":"string","description":"The value for key-value pair matching."}},"type":"object","additionalProperties":false,"description":"A structured condition value used for range queries or key-value pair matching."},"PolicyExceptionBinding":{"properties":{"policies":{"items":{"$ref":"#/components/schemas/PolicyExceptionPolicyRef"},"type":"array","description":"The policies to bind the exception to. Used with the `SPECIFIC` mode. The policy IDs are not validated."},"mode":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionBindingType"}],"description":"`GLOBAL` binds the exception to all policies of the type. `SPECIFIC` binds it to the policies in `policies`."},"policyType":{"anyOf":[{"$ref":"#/components/schemas/PolicyExceptionPolicyType"},{"type":"string"}],"description":"Type of policy the binding applies to. Use `appsec` for Application Security policies."}},"required":["mode","policyType"],"type":"object","description":"Binds an exception to the policies of one policy type. A policy type can appear only once in `bindings`."},"PolicyExceptionPolicyRef":{"properties":{"policyName":{"type":"string","description":"Name of the policy."},"policyId":{"type":"string","description":"ID of the policy."}},"required":["policyName","policyId"],"type":"object","description":"Reference to a policy that an exception is bound to."},"PolicyExceptionBindingType":{"enum":["GLOBAL","SPECIFIC"],"type":"string","description":"How an exception is bound to policies of a policy type.\n- `GLOBAL` — The exception applies to all policies of the policy type.\n- `SPECIFIC` — The exception applies only to the policies listed in `policies`."},"PolicyExceptionPolicyType":{"enum":["appsec","cloud_workload","cloud_security","vulnerability_management"],"type":"string","description":"Type of policy that an exception can be bound to. Application Security exceptions use `appsec`. Only `appsec` exceptions are applied during scans.\n- `appsec` — Application Security policies.\n- `cloud_workload` — Cloud workload policies.\n- `cloud_security` — Cloud security policies.\n- `vulnerability_management` — Vulnerability management policies."},"PolicyExceptionReasonCategory":{"enum":["RISK_ACCEPTED","VENDOR_DEPENDENCY","PLANNED_REMEDIATION","COMPENSATING_CONTROL","FALSE_POSITIVE","OTHER"],"type":"string","description":"Reason for the exception.\n- `RISK_ACCEPTED` — The organization accepts the risk.\n- `VENDOR_DEPENDENCY` — The risk depends on a vendor fix.\n- `PLANNED_REMEDIATION` — The finding will be fixed as planned.\n- `COMPENSATING_CONTROL` — Another control mitigates the risk.\n- `FALSE_POSITIVE` — The finding is not a real issue.\n- `OTHER` — Another reason."},"PolicyException":{"properties":{"userSbac":{"items":{"type":"number","format":"double"},"type":"array","description":"Asset group IDs that scope the caller's access when the exception was saved. `-1` means all asset groups."},"reviewReason":{"type":"string","description":"Optional approval note. Saved only if the exception is approved when it's created, which happens when the caller has the `posture_policy_exceptions_approval` permission or is an administrator. Otherwise this value is ignored."},"dateReviewed":{"type":"string","format":"date-time","description":"Date and time of the last review."},"reviewedBy":{"type":"string","description":"User or API key that last approved or rejected the exception."},"modifiedBy":{"type":"string","description":"User or API key that last modified the exception."},"dateModified":{"type":"string","format":"date-time","description":"Date and time the exception was last modified."},"dateCreated":{"type":"string","format":"date-time","description":"Date and time the exception was created."},"createdBy":{"type":"string","description":"User or API key that created the exception."},"dateExpires":{"type":"string","format":"date-time","description":"Date and time the exception expires."},"status":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionStatus"}],"description":"Review status of the exception."},"assetGroupIds":{"items":{"type":"number","format":"double"},"type":"array","description":"IDs of the asset groups the exception is limited to. When empty, the exception is not limited to asset groups."},"conditions":{"items":{"$ref":"#/components/schemas/CortexCondition"},"type":"array","description":"Conditions that select the findings to exclude. Each condition must include a `Finding Type` field."},"bindings":{"items":{"$ref":"#/components/schemas/PolicyExceptionBinding"},"type":"array","description":"The policies that the exception applies to, one binding per policy type."},"reasonCategory":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionReasonCategory"}],"description":"Reason for the exception."},"description":{"type":"string","description":"Description of the exception, at most 2000 characters."},"name":{"type":"string","description":"Name of the exception. It must be unique and at most 200 characters."},"id":{"type":"string","description":"Unique identifier (UUID) of the exception."}},"required":["userSbac","dateModified","dateCreated","createdBy","status","assetGroupIds","conditions","bindings","reasonCategory","name","id"],"type":"object","description":"A policy exception."},"PolicyExceptionStatus":{"enum":["PENDING_APPROVAL","APPROVED","REJECTED"],"type":"string","description":"Review status of a policy exception.\n- `PENDING_APPROVAL` — Waiting for review. The exception has no effect yet.\n- `APPROVED` — Approved. The exception is in effect.\n- `REJECTED` — Rejected. The exception has no effect."},"ErrorResponse":{"type":"object","required":["errorCode","message"],"properties":{"errorCode":{"type":"string","description":"Error type, for example `BadParamsError`, `ForbiddenError`, `NotFoundError` or `ConflictError`.","not":{"enum":["ValidateError","PolicyExceptionValidationError"]}},"message":{"type":"string","description":"Description of the error."}},"description":"Error returned for a business-rule failure, a permission problem, a conflict, or a missing object.","additionalProperties":false},"ValidationErrorResponse":{"type":"object","required":["errorCode","message","details"],"properties":{"errorCode":{"type":"string","enum":["ValidateError"],"description":"Always `ValidateError`."},"message":{"type":"string","description":"Always `Validation Failed`."},"details":{"type":"object","additionalProperties":{"type":"object","properties":{"message":{"type":"string"},"value":{}}},"description":"The failed fields. Each key is the path of a field, and each value has the validation `message` and the rejected `value`."}},"description":"Error returned when the request does not match the schema.","additionalProperties":false},"PolicyExceptionValidationErrorResponse":{"type":"object","required":["errorCode","message","details"],"properties":{"errorCode":{"type":"string","enum":["PolicyExceptionValidationError"],"description":"Always `PolicyExceptionValidationError`."},"message":{"type":"string","description":"Summary of the failed rules."},"details":{"type":"string","description":"JSON-encoded array of objects with the `field` and the `message` of each failed rule."}},"description":"Error returned when a policy exception breaks a field rule.","additionalProperties":false}}}}
```

## Approve or reject a policy exception

> Reviews a policy exception by approving or rejecting it.\
> \
> Allowed transitions:\
> \- \`PENDING\_APPROVAL\` to \`APPROVED\` or \`REJECTED\`.\
> \- \`APPROVED\` to \`REJECTED\`.\
> \- \`REJECTED\` to \`APPROVED\`.\
> \
> Setting the status the exception already has returns \`409\`. A \`reason\` is required when you reject an exception and optional when you approve it. Exceptions created by a caller with the approval permission are approved at creation, so they don't need this call.\
> \
> \*\*Required role:\*\* Any role with Posture Policy Exceptions Approval (\`posture\_policy\_exceptions\_approval\`) set to Edit.\
> \
> \> #### Required license:\
> \>\
> \> Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.

```json
{"openapi":"3.0.0","info":{"title":"ASPM, CICD and Application Security APIs","version":"Cortex Cloud"},"tags":[{"name":"Policy Exceptions","description":"APIs for managing policy exceptions. Exceptions apply to Application Security (`appsec`) policies. An exception takes effect only while it is `APPROVED` and has not expired."}],"servers":[{"url":"https://api-yourfqdn"}],"security":[],"paths":{"/public_api/appsec/v1/policies/exceptions/{id}/status":{"post":{"operationId":"UpdatePolicyExceptionStatus","summary":"Approve or reject a policy exception","tags":["Policy Exceptions"],"parameters":[{"in":"header","name":"Authorization","required":true,"description":"{api_key}","schema":{"type":"string"}},{"in":"header","name":"x-xdr-auth-id","required":true,"description":"{api_key_id}","schema":{"type":"string"}},{"in":"path","name":"id","required":true,"schema":{"type":"string","format":"uuid"},"description":"Unique identifier (UUID) of the policy exception. You can retrieve this value from the `id` field in the response of the **List all policy exceptions** endpoint."}],"description":"Reviews a policy exception by approving or rejecting it.\n\nAllowed transitions:\n- `PENDING_APPROVAL` to `APPROVED` or `REJECTED`.\n- `APPROVED` to `REJECTED`.\n- `REJECTED` to `APPROVED`.\n\nSetting the status the exception already has returns `409`. A `reason` is required when you reject an exception and optional when you approve it. Exceptions created by a caller with the approval permission are approved at creation, so they don't need this call.\n\n**Required role:** Any role with Posture Policy Exceptions Approval (`posture_policy_exceptions_approval`) set to Edit.\n\n> #### Required license:\n>\n> Cortex Cloud Posture Management or Cortex Cloud Runtime Security, together with the Application Security add-on.","requestBody":{"required":true,"description":"The new review status and, for a rejection, the reason.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyExceptionStatusRequest"}}}},"responses":{"204":{"description":"No Content. The status was changed. The response has no body."},"401":{"description":"Unauthorized. The `Authorization` or `x-xdr-auth-id` header is missing or invalid. The response has no body."},"403":{"description":"Forbidden. The API key lacks the policy exception approval permission.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found. No policy exception exists with the specified ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Conflict. The exception is already in the requested status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity. The request body failed validation.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationErrorResponse"},{"$ref":"#/components/schemas/PolicyExceptionValidationErrorResponse"}]}}}}}}}},"components":{"schemas":{"PolicyExceptionStatusRequest":{"properties":{"reason":{"type":"string","description":"Reason for the review. Required when `status` is `REJECTED`; optional otherwise."},"status":{"allOf":[{"$ref":"#/components/schemas/PolicyExceptionReviewStatus"}],"description":"New review status: `APPROVED` or `REJECTED`."}},"required":["status"],"type":"object","description":"Request body to approve or reject a policy exception."},"PolicyExceptionReviewStatus":{"anyOf":[{"$ref":"#/components/schemas/PolicyExceptionStatus.Approved"},{"$ref":"#/components/schemas/PolicyExceptionStatus.Rejected"}],"description":"Status that a reviewer can set: `APPROVED` or `REJECTED`."},"PolicyExceptionStatus.Approved":{"enum":["APPROVED"],"type":"string","description":"The approved status.\n- `APPROVED` — Approved. The exception is in effect."},"PolicyExceptionStatus.Rejected":{"enum":["REJECTED"],"type":"string","description":"The rejected status.\n- `REJECTED` — Rejected. The exception has no effect."},"ErrorResponse":{"type":"object","required":["errorCode","message"],"properties":{"errorCode":{"type":"string","description":"Error type, for example `BadParamsError`, `ForbiddenError`, `NotFoundError` or `ConflictError`.","not":{"enum":["ValidateError","PolicyExceptionValidationError"]}},"message":{"type":"string","description":"Description of the error."}},"description":"Error returned for a business-rule failure, a permission problem, a conflict, or a missing object.","additionalProperties":false},"ValidationErrorResponse":{"type":"object","required":["errorCode","message","details"],"properties":{"errorCode":{"type":"string","enum":["ValidateError"],"description":"Always `ValidateError`."},"message":{"type":"string","description":"Always `Validation Failed`."},"details":{"type":"object","additionalProperties":{"type":"object","properties":{"message":{"type":"string"},"value":{}}},"description":"The failed fields. Each key is the path of a field, and each value has the validation `message` and the rejected `value`."}},"description":"Error returned when the request does not match the schema.","additionalProperties":false},"PolicyExceptionValidationErrorResponse":{"type":"object","required":["errorCode","message","details"],"properties":{"errorCode":{"type":"string","enum":["PolicyExceptionValidationError"],"description":"Always `PolicyExceptionValidationError`."},"message":{"type":"string","description":"Summary of the failed rules."},"details":{"type":"string","description":"JSON-encoded array of objects with the `field` and the `message` of each failed rule."}},"description":"Error returned when a policy exception breaks a field rule.","additionalProperties":false}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/cortex-cloud-api/aspm-cicd-and-application-security/policy-exceptions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
