> ## Documentation Index
> Fetch the complete documentation index at: https://zerodrift.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Custom Rule

> Return the full editable definition for a customer-owned custom rule

Return the full editable definition for a customer-owned custom rule.

## Path Parameters

<ParamField path="rule_id" type="string" required>
  Custom rule identifier (typically prefixed with `cust_`)
</ParamField>

## Response

<ResponseField name="rule_id" type="string">
  Rule identifier
</ResponseField>

<ResponseField name="name" type="string">
  Human-readable rule name
</ResponseField>

<ResponseField name="type" type="string">
  `AI_SIGNAL`, `REGEX`, or `REQUIRE_NEAR`
</ResponseField>

<ResponseField name="action" type="string">
  `fix` or `flag`
</ResponseField>

<ResponseField name="severity" type="string">
  `do_not_send` or `send_with_caution`
</ResponseField>

<ResponseField name="suggested_text" type="string">
  Stored suggested replacement or warning guidance when present
</ResponseField>

<ResponseField name="source" type="string">
  Always `custom`
</ResponseField>

<ResponseField name="active" type="boolean">
  Whether the rule currently runs during validation
</ResponseField>

<ResponseField name="fix_note" type="string">
  Remediation guidance when present
</ResponseField>

<ResponseField name="prompt" type="string">
  AI instruction (`AI_SIGNAL` only)
</ResponseField>

<ResponseField name="keywords" type="array">
  Keyword gate (`AI_SIGNAL` only)
</ResponseField>

<ResponseField name="window" type="string">
  `sentence`, `paragraph`, or `document` (`AI_SIGNAL` only)
</ResponseField>

<ResponseField name="regex_pattern" type="string">
  Regex pattern (`REGEX` only)
</ResponseField>

<ResponseField name="anchor" type="string">
  Anchor regex (`REQUIRE_NEAR` only)
</ResponseField>

<ResponseField name="near" type="array">
  Near-pattern regexes (`REQUIRE_NEAR` only)
</ResponseField>

<ResponseField name="distance_chars" type="integer">
  Character distance (`REQUIRE_NEAR`)
</ResponseField>

<ResponseField name="direction" type="string">
  `before`, `after`, or `either` (`REQUIRE_NEAR`)
</ResponseField>

<ResponseField name="case_insensitive" type="boolean">
  Case-insensitive matching (`REQUIRE_NEAR`)
</ResponseField>

<ResponseField name="mode" type="string">
  `document` or `page` (`REQUIRE_NEAR`)
</ResponseField>

<ResponseField name="min_hits" type="integer">
  Minimum near hits (`REQUIRE_NEAR`)
</ResponseField>

<ResponseField name="import_id" type="string">
  Source import ID when the rule was created via policy import
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 creation timestamp
</ResponseField>

<ResponseField name="updated_at" type="string">
  ISO 8601 last-update timestamp when present
</ResponseField>

## Errors

| Status | Meaning               |
| ------ | --------------------- |
| `403`  | Forbidden             |
| `404`  | Custom rule not found |

## Example

```bash theme={null}
curl "https://api.zerodrift.ai/api/policies/rules/cust_abc123_no_misleading_claims" \
  -H "x-api-key: YOUR_API_KEY"
```
