---
title: "List Guardrail Rules"
method: POST
path: "/guardrails/search"
tags: ["Guardrails"]
---

# List Guardrail Rules

`POST /guardrails/search`

Returns a list of guardrails rules based on filter criteria

## Query parameters

- `page` integer
- `pageSize` integer

## Request body

- ListGuardrailsRequest
  - `projection` string[] — Fields to include in the response
  - `searchValue` string — Value to search for across searchable fields
  - `filters` object
    - `createdBy` string[] — User names to filter by
    - `type` Type[] — Types of guardrail rules to filter
    - `labels` string[] — Labels to filter by
    - `repositories` string[] — Repository names to filter by
    - `workspaces` string[] — Workspace names to filter by
    - `branches` string[] — Branch names to filter by
    - `$or` ListGuardrailsFilters
      - `createdBy` string[] — User names to filter by
      - `type` Type[] — Types of guardrail rules to filter
      - `labels` string[] — Labels to filter by
      - `repositories` string[] — Repository names to filter by
      - `workspaces` string[] — Workspace names to filter by
      - `branches` string[] — Branch names to filter by
  - `sort` GuardrailSortField[]
    - `createdAt` SortConfig
      - `order` -1 | 1 — Sort order (-1 for descending, 1 for ascending)
    - `accountId` SortConfig
      - `order` -1 | 1 — Sort order (-1 for descending, 1 for ascending)
    - `createdBy` SortConfig
      - `order` -1 | 1 — Sort order (-1 for descending, 1 for ascending)
    - `name` SortConfig
      - `order` -1 | 1 — Sort order (-1 for descending, 1 for ascending)
    - `severity` SortConfig
      - `order` -1 | 1 — Sort order (-1 for descending, 1 for ascending)

## Response `200`

List of guardrail rules retrieved successfully

- GuardrailRule[]
  - `id` string — Unique identifier of the guardrail rule
  - `accountId` string — Unique identifier of the associated account
  - `createdBy` string — Name of the user who created the rule
  - `name` string — Name of the guardrail rule
  - `type` 'policy' | 'cost' | 'resource' | 'tag' — Type of the guardrail rule
  - `scope` object — Scope of the guardrail rule
    - `workspaces` object, required — A pattern for including and excluding items using wildcards
      - `include` string[], required — List of patterns to include
      - `exclude` string[] — List of patterns to exclude
    - `repositories` object, required — A pattern for including and excluding items using wildcards
      - `include` string[], required — List of patterns to include
      - `exclude` string[] — List of patterns to exclude
    - `branches` object, required — A pattern for including and excluding items using wildcards
      - `include` string[], required — List of patterns to include
      - `exclude` string[] — List of patterns to exclude
    - `labels` object, required — A pattern for including and excluding items using wildcards
      - `include` string[], required — List of patterns to include
      - `exclude` string[] — List of patterns to exclude
  - `criteria` Criteria
    - `cost` union
      - object
        - `thresholdAmount` number, float, required — Absolute threshold amount (in USD) for cost criteria
        - `thresholdPercentage` number, float — Percentage threshold for cost criteria
      - object
        - `thresholdAmount` number, float — Absolute threshold amount (in USD) for cost criteria
        - `thresholdPercentage` number, float, required — Percentage threshold for cost criteria
    - `policy` PolicyCriteria
      - `severity` string — Severity level for policy criteria
      - `policies` Policies — List of policies to include or exclude
        - `include` string[] — List of patterns to include
        - `exclude` string[] — List of patterns to exclude
    - `resource` ResourceCriteria
      - `actions` ResourceActionEnum[], required
      - `regions` object, required — List of regions to include or exclude
        - `include` string[], required — List of patterns to include
        - `exclude` string[] — List of patterns to exclude
      - `assetTypes` object, required — List of asset types to include or exclude
        - `include` string[], required — List of patterns to include
        - `exclude` string[] — List of patterns to exclude
      - `specificResources` string[] — List of specific resources
    - `tag` union
      - AnyTagsCriteria
        - `tagEnforcementMode` 'anyTags', required — Mode of tag enforcement
      - RequiredTagsCriteria
        - `tagEnforcementMode` 'requiredTags', required — Mode of tag enforcement
        - `requiredTags` string[], required — List of required tags
      - RequiredValuesCriteria
        - `tagEnforcementMode` 'requiredValues', required — Mode of tag enforcement
        - `requiredValues` object, required — Map of tag keys to required values
  - `isEnabled` boolean — Whether the rule is enabled
  - `createdAt` string, date-time — Timestamp when the rule was created
  - `updatedAt` string, date-time — Timestamp when the rule was last updated
  - `notificationId` string — Unique identifier of the associated notification configuration
  - `severity` 0 | 1 | 2 | 3 | 4 — Severity level of the guardrail rule
  - `enforceOnNoOp` boolean — Whether to enforce the rule on no-op assets

## Other responses

- `400` — Bad Request Error
- `401` — Unauthorized Error
- `403` — Insufficient permissions
- `404` — Not Found Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/firefly/apis/api-gateway.md) · [All operations](https://skmtc.net/firefly/apis/api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/firefly/api-gateway/revisions/eea119b4113f/schema)
