> 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/application-security/application-security-posture-management-aspm/application-security-rules/api-workflows-for-rules.md).

# API workflows for rules

Manage Application Security rule definitions through the public API.

Manage Application Security rule definitions through the public API. Use it to audit inventory, create, validate, clone, update, and delete custom IaC and Secrets rules, manage labels, and synchronize definitions across tenants.

The API manages rule definitions and metadata. It does not execute scans, create issues, or enforce policies.

**Required license:** Cortex Cloud Posture Management or Cortex Cloud Runtime Security with Application Security add-on.

For complete API details, see [Rules](/cortex-cloud-api/aspm-cicd-and-application-security/rules.md). It includes required headers, permissions, query parameters, request and response schemas, and endpoint-specific guidance.

## Supported endpoints

| Endpoint                                      | Description                                                                        |
| --------------------------------------------- | ---------------------------------------------------------------------------------- |
| `GET /public_api/appsec/v1/rules`             | List AppSec rules with filtering, sorting, and pagination                          |
| `POST /public_api/appsec/v1/rules`            | Create a custom IaC or Secrets rule, including a rule cloned from an existing rule |
| `GET /public_api/appsec/v1/rules/{ruleId}`    | Get one AppSec rule by its identifier                                              |
| `PATCH /public_api/appsec/v1/rules/{ruleId}`  | Update a custom rule, or update labels on an out-of-the-box rule                   |
| `DELETE /public_api/appsec/v1/rules/{ruleId}` | Delete an AppSec rule                                                              |
| `GET /public_api/appsec/v1/rules/rule-labels` | List available AppSec rule labels                                                  |
| `POST /public_api/appsec/v1/rules/validate`   | Validate a custom rule definition before creating or updating it                   |


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/application-security/application-security-posture-management-aspm/application-security-rules/api-workflows-for-rules.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
