import * as z from "zod/v4"; import { Result as SafeParseResult } from "../types/fp.js"; import { ContentFilterBuiltinEntry } from "./contentfilterbuiltinentry.js"; import { ContentFilterEntry } from "./contentfilterentry.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { GuardrailDataRegion } from "./guardraildataregion.js"; import { GuardrailInterval } from "./guardrailinterval.js"; export type Guardrail = { /** * Data regions through which requests governed by this guardrail must arrive. `global` is https://openrouter.ai, `europe` is https://eu.openrouter.ai, and `us` is https://us.openrouter.ai. Requests arriving through any other region are rejected. `null` leaves the ingress region unrestricted. When several guardrails apply (workspace default, member, API key), the effective regions are the intersection of every non-null value. */ allowedDataRegions?: Array | null | undefined; /** * Array of model canonical_slugs (immutable identifiers) */ allowedModels?: Array | null | undefined; /** * List of allowed provider IDs */ allowedProviders?: Array | null | undefined; /** * Builtin content filters applied to requests. Includes PII detectors and the regex-based prompt injection detector. */ contentFilterBuiltins?: Array | null | undefined; /** * Custom regex content filters applied to request messages */ contentFilters?: Array | null | undefined; /** * ISO 8601 timestamp of when the guardrail was created */ createdAt: string; /** * Description of the guardrail */ description?: string | null | undefined; /** * Whether this guardrail allows free endpoints that publish prompts. */ enableFreeModelPublication?: boolean | null | undefined; /** * Whether this guardrail allows free endpoints that train on request data. */ enableFreeModelTraining?: boolean | null | undefined; /** * Whether this guardrail allows paid endpoints that train on request data. */ enablePaidModelTraining?: boolean | null | undefined; /** * Deprecated. Use enforce_zdr_anthropic, enforce_zdr_openai, enforce_zdr_google, enforce_zdr_xai, 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. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ enforceZdr?: boolean | null | undefined; /** * Whether to enforce zero data retention for Anthropic models. Falls back to enforce_zdr when not provided. */ enforceZdrAnthropic?: boolean | null | undefined; /** * Whether to enforce zero data retention for Google models. Falls back to enforce_zdr when not provided. */ enforceZdrGoogle?: boolean | null | undefined; /** * Whether to enforce zero data retention for OpenAI models. Falls back to enforce_zdr when not provided. */ enforceZdrOpenai?: boolean | null | undefined; /** * Whether to enforce zero data retention for models that are not from Anthropic, OpenAI, Google, or xAI. Falls back to enforce_zdr when not provided. */ enforceZdrOther?: boolean | null | undefined; /** * Whether to enforce zero data retention for xAI models. Falls back to enforce_zdr when not provided. */ enforceZdrXai?: boolean | null | undefined; /** * Unique identifier for the guardrail */ id: string; /** * Array of model canonical_slugs to exclude from routing */ ignoredModels?: Array | null | undefined; /** * List of provider IDs to exclude from routing */ ignoredProviders?: Array | null | undefined; /** * Whether BYOK (bring-your-own-key) inference spend counts toward this guardrail's limit_usd, in addition to OpenRouter credit spend. */ includeByokInBudgets: boolean; /** * Spending limit in USD */ limitUsd?: number | null | undefined; /** * Name of the guardrail */ name: string; /** * Interval at which the limit resets (daily, weekly, monthly) */ resetInterval?: GuardrailInterval | null | undefined; /** * ISO 8601 timestamp of when the guardrail was last updated */ updatedAt?: string | null | undefined; /** * The workspace this guardrail belongs to, or `null` for an unscoped legacy guardrail predating workspaces. Workspace membership organizes the guardrail; it does not apply the guardrail to the workspace's traffic. A `null` value does not mean the default workspace, and does not apply the guardrail across every workspace. */ workspaceId: string | null; }; /** @internal */ export declare const Guardrail$inboundSchema: z.ZodType; export declare function guardrailFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=guardrail.d.ts.map