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

# Guardrail - Go SDK

> Guardrail type definition

<Warning>
  The Go SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/go-sdk/issues).
</Warning>

## Fields

| Field                   | Type                                                                                                                                          | Required             | Description                                                                                                                                                                                                                                                                                                                                                                             | Example                                                                                                                    |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `AllowedModels`         | optionalnullable.OptionalNullable\[\[]`string`]                                                                                               | :heavy\_minus\_sign: | Array of model canonical\_slugs (immutable identifiers)                                                                                                                                                                                                                                                                                                                                 | \[<br />"openai/gpt-5.2-20251211",<br />"anthropic/claude-4.5-opus-20251124",<br />"deepseek/deepseek-r1-0528:free"<br />] |
| `AllowedProviders`      | optionalnullable.OptionalNullable\[\[]`string`]                                                                                               | :heavy\_minus\_sign: | List of allowed provider IDs                                                                                                                                                                                                                                                                                                                                                            | \[<br />"openai",<br />"anthropic",<br />"google"<br />]                                                                   |
| `ContentFilterBuiltins` | optionalnullable.OptionalNullable\[\[][components.ContentFilterBuiltinEntry](/client-sdks/go/api-reference/models/contentfilterbuiltinentry)] | :heavy\_minus\_sign: | Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector.                                                                                                                                                                                                                                                                      | \[<br />`{"action": "redact","label": "[EMAIL]","slug": "email"}`<br />]                                                   |
| `ContentFilters`        | optionalnullable.OptionalNullable\[\[][components.ContentFilterEntry](/client-sdks/go/api-reference/models/contentfilterentry)]               | :heavy\_minus\_sign: | Custom regex content filters applied to request messages                                                                                                                                                                                                                                                                                                                                | \[<br />`{"action": "redact","label": "[API_KEY]","pattern": "\\b(sk-[a-zA-Z0-9]{48}`)\b"<br />}<br />]                    |
| `CreatedAt`             | `string`                                                                                                                                      | :heavy\_check\_mark: | ISO 8601 timestamp of when the guardrail was created                                                                                                                                                                                                                                                                                                                                    | 2025-08-24T10:30:00Z                                                                                                       |
| `Description`           | optionalnullable.OptionalNullable\[`string`]                                                                                                  | :heavy\_minus\_sign: | Description of the guardrail                                                                                                                                                                                                                                                                                                                                                            | Guardrail for production environment                                                                                       |
| ~~`EnforceZdr`~~        | optionalnullable.OptionalNullable\[`bool`]                                                                                                    | :heavy\_minus\_sign: | : warning: \*\* DEPRECATED \*\*: This will be removed in a future release, please migrate away from it as soon as possible.<br /><br />Deprecated. Use enforce\_zdr\_anthropic, enforce\_zdr\_openai, enforce\_zdr\_google, and enforce\_zdr\_other instead. When provided, its value is copied into any of those per-provider fields that are not explicitly specified on the request. | false                                                                                                                      |
| `EnforceZdrAnthropic`   | optionalnullable.OptionalNullable\[`bool`]                                                                                                    | :heavy\_minus\_sign: | Whether to enforce zero data retention for Anthropic models. Falls back to enforce\_zdr when not provided.                                                                                                                                                                                                                                                                              | false                                                                                                                      |
| `EnforceZdrGoogle`      | optionalnullable.OptionalNullable\[`bool`]                                                                                                    | :heavy\_minus\_sign: | Whether to enforce zero data retention for Google models. Falls back to enforce\_zdr when not provided.                                                                                                                                                                                                                                                                                 | false                                                                                                                      |
| `EnforceZdrOpenai`      | optionalnullable.OptionalNullable\[`bool`]                                                                                                    | :heavy\_minus\_sign: | Whether to enforce zero data retention for OpenAI models. Falls back to enforce\_zdr when not provided.                                                                                                                                                                                                                                                                                 | false                                                                                                                      |
| `EnforceZdrOther`       | optionalnullable.OptionalNullable\[`bool`]                                                                                                    | :heavy\_minus\_sign: | Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, or Google. Falls back to enforce\_zdr when not provided.                                                                                                                                                                                                                                         | false                                                                                                                      |
| `ID`                    | `string`                                                                                                                                      | :heavy\_check\_mark: | Unique identifier for the guardrail                                                                                                                                                                                                                                                                                                                                                     | 550e8400-e29b-41d4-a716-446655440000                                                                                       |
| `IgnoredModels`         | optionalnullable.OptionalNullable\[\[]`string`]                                                                                               | :heavy\_minus\_sign: | Array of model canonical\_slugs to exclude from routing                                                                                                                                                                                                                                                                                                                                 | \[<br />"openai/gpt-4o-mini-2024-07-18"<br />]                                                                             |
| `IgnoredProviders`      | optionalnullable.OptionalNullable\[\[]`string`]                                                                                               | :heavy\_minus\_sign: | List of provider IDs to exclude from routing                                                                                                                                                                                                                                                                                                                                            | \[<br />"azure"<br />]                                                                                                     |
| `LimitUsd`              | optionalnullable.OptionalNullable\[`float64`]                                                                                                 | :heavy\_minus\_sign: | Spending limit in USD                                                                                                                                                                                                                                                                                                                                                                   | 100                                                                                                                        |
| `Name`                  | `string`                                                                                                                                      | :heavy\_check\_mark: | Name of the guardrail                                                                                                                                                                                                                                                                                                                                                                   | Production Guardrail                                                                                                       |
| `ResetInterval`         | optionalnullable.OptionalNullable\[[components.GuardrailInterval](/client-sdks/go/api-reference/models/guardrailinterval)]                    | :heavy\_minus\_sign: | Interval at which the limit resets (daily, weekly, monthly)                                                                                                                                                                                                                                                                                                                             | monthly                                                                                                                    |
| `UpdatedAt`             | optionalnullable.OptionalNullable\[`string`]                                                                                                  | :heavy\_minus\_sign: | ISO 8601 timestamp of when the guardrail was last updated                                                                                                                                                                                                                                                                                                                               | 2025-08-24T15:45:00Z                                                                                                       |
| `WorkspaceID`           | `string`                                                                                                                                      | :heavy\_check\_mark: | The workspace ID this guardrail belongs to.                                                                                                                                                                                                                                                                                                                                             | 0df9e665-d932-5740-b2c7-b52af166bc11                                                                                       |
