> 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/xsiam-api/compliance-controls/rules.md).

# Rules

Operations for managing compliance rules

## Add compliance rules to a compliance control

> Add compliance rules to the specific compliance control. \
> \
> \*\*Required license:\*\* Cortex Cloud Runtime Security or Cortex Cloud Posture Management

```json
{"openapi":"3.0.3","info":{"title":"Compliance Controls API","version":"Cortex XSIAM 3.5"},"tags":[{"name":"Rules","description":"Operations for managing compliance rules"}],"servers":[{"url":"https://{tenant}.xdr.{region}.paloaltonetworks.com","description":"Cortex tenant","variables":{"tenant":{"default":"api","description":"Tenant-specific subdomain"},"region":{"default":"us","description":"Deployment region","enum":["us","eu","uk","sg","jp","ca","au","in","gov"]}}}],"security":[{"XDRAuth":[],"XDRAuthToken":[]}],"components":{"securitySchemes":{"XDRAuth":{"type":"apiKey","in":"header","name":"x-xdr-auth-id","description":"API Key ID for authentication"}},"schemas":{"Rule":{"type":"object","required":["name","type","logical_id","scannable_assets","generate_findings","generate_issues","generate_scan_logs"],"properties":{"name":{"type":"string","description":"Rule name"},"description":{"type":"string","description":"Description of the rule"},"type":{"type":"string","description":"Rule type","enum":["Identity"]},"logical_id":{"type":"string","description":"Logical identifier for the rule"},"severity":{"type":"string","description":"Rule severity level","enum":["low","medium","high","critical"],"default":"low"},"scannable_assets":{"type":"array","description":"List of scannable asset types","items":{"type":"string"}},"remediation_steps":{"type":"string","description":"Steps to remediate violations"},"generate_findings":{"type":"boolean","description":"Whether to generate findings for this rule"},"generate_issues":{"type":"boolean","description":"Whether to generate issues for this rule"},"generate_scan_logs":{"type":"boolean","description":"Whether to generate scan logs for this rule"}}},"Error":{"type":"object","properties":{"reply":{"type":"object","properties":{"err_code":{"type":"integer","description":"Error code"},"err_msg":{"type":"string","description":"Error message"},"err_extra":{"type":"object","description":"Additional error details"}}}}}},"responses":{"BadRequest":{"description":"Bad request - invalid input parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/public_api/v1/compliance/add_rules_to_control":{"post":{"summary":"Add compliance rules to a compliance control","description":"Add compliance rules to the specific compliance control. \n\n**Required license:** Cortex Cloud Runtime Security or Cortex Cloud Posture Management","operationId":"addRulesToControl","tags":["Rules"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["request_data"],"properties":{"request_data":{"type":"object","required":["control_id","rules"],"properties":{"control_id":{"type":"string","description":"Compliance control ID"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}}}}}}}}},"responses":{"200":{"description":"Rules added successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the rules were added successfully"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```

## Delete rules from control

> Remove specific rules from the specified compliance control.\
> \
> \*\*Required license:\*\* Cortex Cloud Runtime Security or Cortex Cloud Posture Management

```json
{"openapi":"3.0.3","info":{"title":"Compliance Controls API","version":"Cortex XSIAM 3.5"},"tags":[{"name":"Rules","description":"Operations for managing compliance rules"}],"servers":[{"url":"https://{tenant}.xdr.{region}.paloaltonetworks.com","description":"Cortex tenant","variables":{"tenant":{"default":"api","description":"Tenant-specific subdomain"},"region":{"default":"us","description":"Deployment region","enum":["us","eu","uk","sg","jp","ca","au","in","gov"]}}}],"security":[{"XDRAuth":[],"XDRAuthToken":[]}],"components":{"securitySchemes":{"XDRAuth":{"type":"apiKey","in":"header","name":"x-xdr-auth-id","description":"API Key ID for authentication"}},"responses":{"BadRequest":{"description":"Bad request - invalid input parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"reply":{"type":"object","properties":{"err_code":{"type":"integer","description":"Error code"},"err_msg":{"type":"string","description":"Error message"},"err_extra":{"type":"object","description":"Additional error details"}}}}}}},"paths":{"/public_api/v1/compliance/delete_rules_from_control":{"post":{"summary":"Delete rules from control","description":"Remove specific rules from the specified compliance control.\n\n**Required license:** Cortex Cloud Runtime Security or Cortex Cloud Posture Management","operationId":"deleteRulesFromControl","tags":["Rules"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["request_data"],"properties":{"request_data":{"type":"object","required":["control_id","rules_ids"],"properties":{"control_id":{"type":"string","description":"Compliance control ID"},"rules_ids":{"type":"array","description":"List of rule IDs to delete","items":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Rules deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Whether the rules were successfully deleted from the compliance control"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}}}
```


---

# 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/xsiam-api/compliance-controls/rules.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.
