---
title: "List Policy Rules"
method: GET
path: "/api/policies/v1/deployments/{deploymentId}/{policyId}/rules"
tags: ["PoliciesService"]
---

# List Policy Rules

`GET /api/policies/v1/deployments/{deploymentId}/{policyId}/rules`

List the rules for a given policy.

## Path parameters

- `deploymentId` string, int64, required — The unique numerical identifier for the deployment.
- `policyId` string, int64, required — The unique numerical identifier for the policy. Find your policy's ID via the [List Policies](/api/v2/docs/#tag/PoliciesService/operation/PoliciesService_ListPolicies) endpoint.

## Query parameters

- `cursor` string — Cursor to paginate through the rules. Provide a cursor value from the response to retrieve the next page.
- `limit` integer — Page size to paginate through the rules. The default page size is `500` and the maximum allowed page size is `2000`.

## Response `200`

OK

- ProtosPoliciesV1ListPolicyRulesResponse
  - `policy` ProtosCommonV1Policy
    - `id` string, int64 — ID of the Policy.
    - `isDefault` boolean — When True, the Policy applies to all repositories.
    - `name` string — Name of the Policy.
    - `productType` 'PRODUCT_TYPE_SAST' | 'PRODUCT_TYPE_SECRETS', enum — Product type the Policy applies to. | value | description | |-------|---------------| | PRODUCT_TYPE_SAST | The product type for Code rules. | | PRODUCT_TYPE_SECRETS | The product type for Secrets rules. |
    - `slug` string — Sanitized machine-readable name of the Policy.
  - `rules` ProtosCommonV1Rule[] — List of Rules for the given Policy.
    - `id` string, int64 — ID of the Rule.
    - `category` string — Category the Rule is associated with.
    - `confidence` 'CONFIDENCE_HIGH' | 'CONFIDENCE_MEDIUM' | 'CONFIDENCE_LOW', enum — Confidence based on the Rule's false-positive rate. | value | description | |-------|---------------| | CONFIDENCE_HIGH | | | CONFIDENCE_MEDIUM | | | CONFIDENCE_LOW | |
    - `cweCategories` string[] — The CWE associated with the Rule.
    - `hasValidators` boolean — When True, the secrets rule has validators.
    - `languages` string[] — Languages the Rule applies to.
    - `lastChangeAt` string, date-time — Timestamp of when the Rule was last changed.
    - `lastChangeBy` string — Username of who last changed the Rule.
    - `owaspCategories` string[] — Owasp categories the Rule is associated with.
    - `path` string — Full path of the Rule.
    - `policyMode` 'MODE_MONITOR' | 'MODE_COMMENT' | 'MODE_BLOCK' | 'MODE_DISABLED', enum — Mode behavior: Monitor / Comment / Block / Disabled | value | description | |-------|---------------| | MODE_MONITOR | Monitor mode, silently report findings | | MODE_COMMENT | Comment mode, leaves PR comments but does not block | | MODE_BLOCK | Block mode, leaves PR comments and blocks PR | | MODE_DISABLED | Disabled mode, not active |
    - `registryMaintainer` string — The Registry maintainer associated with the Rule (if applicable).
    - `rulesets` string[] — Rulesets to which the Rule belongs (if applicable).
    - `secretType` string — The secret type (if applicable).
    - `severity` 'SEVERITY_HIGH' | 'SEVERITY_MEDIUM' | 'SEVERITY_LOW' | 'SEVERITY_CRITICAL', enum — Severity level ("seriousness" of the finding) | value | description | |-------|---------------| | SEVERITY_HIGH | | | SEVERITY_MEDIUM | | | SEVERITY_LOW | | | SEVERITY_CRITICAL | |
    - `source` 'SOURCE_PRO' | 'SOURCE_COMMUNITY' | 'SOURCE_CUSTOM', enum — Source of the Rule | value | description | |-------|---------------| | SOURCE_PRO | From Pro rules | | SOURCE_COMMUNITY | From Semgrep Community rules | | SOURCE_CUSTOM | From Custom rules |
    - `technologies` string[] — Technologies the Rule is associated with.
    - `url` string — The URL of the Rule.
    - `vulnerabilityClass` string[] — Vulnerability classes the Rule is associated with.
  - `cursor` string — Cursor to paginate through the rules.

---

[API](https://skmtc.net/semgrep/apis/semgrep-web-app.md) · [All operations](https://skmtc.net/semgrep/apis/semgrep-web-app/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/semgrep/semgrep-web-app/revisions/6483eeecd582/schema)
