Skip to main content

Class: AIGatewayGuardrailsClient

Defined in: src/ai-gateway/guardrails-client.ts:32

Client for AI Gateway guardrail operations (data plane).

Constructors

Constructor

new AIGatewayGuardrailsClient(opts): AIGatewayGuardrailsClient;

Defined in: src/ai-gateway/guardrails-client.ts:37

Parameters

ParameterType
optsAIGatewaySubClientOptions

Returns

AIGatewayGuardrailsClient

Methods

list()

list(opts): Promise<objectOutputType<{
object: ZodString;
total: ZodNumber;
has_more: ZodOptional<ZodBoolean>;
data: ZodArray<ZodObject<{
id: ZodString;
name: ZodString;
slug: ZodString;
organisation_id: ZodString;
status: ZodString;
owner_id: ZodString;
updated_by: ZodNullable<ZodString>;
created_at: ZodString;
last_updated_at: ZodString;
workspace_id: ZodString;
object: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
id: ZodString;
name: ZodString;
slug: ZodString;
organisation_id: ZodString;
status: ZodString;
owner_id: ZodString;
updated_by: ZodNullable<ZodString>;
created_at: ZodString;
last_updated_at: ZodString;
workspace_id: ZodString;
object: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
id: ZodString;
name: ZodString;
slug: ZodString;
organisation_id: ZodString;
status: ZodString;
owner_id: ZodString;
updated_by: ZodNullable<ZodString>;
created_at: ZodString;
last_updated_at: ZodString;
workspace_id: ZodString;
object: ZodString;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>;

Defined in: src/ai-gateway/guardrails-client.ts:56

List guardrails in a workspace.

Parameters

ParameterTypeDescription
optsAIGatewayWorkspaceScopedListOptionsMust include the workspace UUID.

Returns

Promise<objectOutputType<{ object: ZodString; total: ZodNumber; has_more: ZodOptional<ZodBoolean>; data: ZodArray<ZodObject<{ id: ZodString; name: ZodString; slug: ZodString; organisation_id: ZodString; status: ZodString; owner_id: ZodString; updated_by: ZodNullable<ZodString>; created_at: ZodString; last_updated_at: ZodString; workspace_id: ZodString; object: ZodString; }, "passthrough", ZodTypeAny, objectOutputType<{ id: ZodString; name: ZodString; slug: ZodString; organisation_id: ZodString; status: ZodString; owner_id: ZodString; updated_by: ZodNullable<ZodString>; created_at: ZodString; last_updated_at: ZodString; workspace_id: ZodString; object: ZodString; }, ZodTypeAny, "passthrough">, objectInputType<{ id: ZodString; name: ZodString; slug: ZodString; organisation_id: ZodString; status: ZodString; owner_id: ZodString; updated_by: ZodNullable<ZodString>; created_at: ZodString; last_updated_at: ZodString; workspace_id: ZodString; object: ZodString; }, ZodTypeAny, "passthrough">>, "many">; }, ZodTypeAny, "passthrough">>

Guardrails defined on that workspace.

Example

import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
const gw = new AIGatewayClient();

const g = await gw.guardrails.list({ workspaceId: '16f7e90d-382a-4e78-b577-1b01eb5f8297' });
// g.data[0].id => 'pg-prisma-099a16'

get()

get(guardrailId): Promise<objectOutputType<{
id: ZodString;
name: ZodString;
slug: ZodString;
organisation_id: ZodString;
status: ZodString;
owner_id: ZodString;
updated_by: ZodNullable<ZodString>;
created_at: ZodString;
last_updated_at: ZodString;
workspace_id: ZodString;
object: ZodString;
} & {
checks: ZodArray<ZodObject<{
id: ZodString;
parameters: ZodRecord<ZodString, ZodUnknown>;
is_enabled: ZodBoolean;
}, "passthrough", ZodTypeAny, objectOutputType<{
id: ZodString;
parameters: ZodRecord<ZodString, ZodUnknown>;
is_enabled: ZodBoolean;
}, ZodTypeAny, "passthrough">, objectInputType<{
id: ZodString;
parameters: ZodRecord<ZodString, ZodUnknown>;
is_enabled: ZodBoolean;
}, ZodTypeAny, "passthrough">>, "many">;
actions: ZodObject<{
deny: ZodBoolean;
async: ZodBoolean;
sequential: ZodBoolean;
on_success: ZodOptional<ZodObject<{
feedback: ZodObject<{
value: ...;
weight: ...;
metadata: ...;
}, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
feedback: ZodObject<..., ..., ..., ..., ...>;
}, ZodTypeAny, "passthrough">, objectInputType<{
feedback: ZodObject<..., ..., ..., ..., ...>;
}, ZodTypeAny, "passthrough">>>;
on_fail: ZodOptional<ZodObject<{
feedback: ZodObject<{
value: ...;
weight: ...;
metadata: ...;
}, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
feedback: ZodObject<..., ..., ..., ..., ...>;
}, ZodTypeAny, "passthrough">, objectInputType<{
feedback: ZodObject<..., ..., ..., ..., ...>;
}, ZodTypeAny, "passthrough">>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
deny: ZodBoolean;
async: ZodBoolean;
sequential: ZodBoolean;
on_success: ZodOptional<ZodObject<{
feedback: ZodObject<..., ..., ..., ..., ...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
feedback: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
feedback: ...;
}, ZodTypeAny, "passthrough">>>;
on_fail: ZodOptional<ZodObject<{
feedback: ZodObject<..., ..., ..., ..., ...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
feedback: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
feedback: ...;
}, ZodTypeAny, "passthrough">>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
deny: ZodBoolean;
async: ZodBoolean;
sequential: ZodBoolean;
on_success: ZodOptional<ZodObject<{
feedback: ZodObject<..., ..., ..., ..., ...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
feedback: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
feedback: ...;
}, ZodTypeAny, "passthrough">>>;
on_fail: ZodOptional<ZodObject<{
feedback: ZodObject<..., ..., ..., ..., ...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
feedback: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
feedback: ...;
}, ZodTypeAny, "passthrough">>>;
}, ZodTypeAny, "passthrough">>;
version_id: ZodString;
}, ZodTypeAny, "passthrough">>;

Defined in: src/ai-gateway/guardrails-client.ts:83

Fetch one guardrail.

Parameters

ParameterTypeDescription
guardrailIdstringGuardrail UUID.

Returns

Promise<objectOutputType<{ id: ZodString; name: ZodString; slug: ZodString; organisation_id: ZodString; status: ZodString; owner_id: ZodString; updated_by: ZodNullable<ZodString>; created_at: ZodString; last_updated_at: ZodString; workspace_id: ZodString; object: ZodString; } & { checks: ZodArray<ZodObject<{ id: ZodString; parameters: ZodRecord<ZodString, ZodUnknown>; is_enabled: ZodBoolean; }, "passthrough", ZodTypeAny, objectOutputType<{ id: ZodString; parameters: ZodRecord<ZodString, ZodUnknown>; is_enabled: ZodBoolean; }, ZodTypeAny, "passthrough">, objectInputType<{ id: ZodString; parameters: ZodRecord<ZodString, ZodUnknown>; is_enabled: ZodBoolean; }, ZodTypeAny, "passthrough">>, "many">; actions: ZodObject<{ deny: ZodBoolean; async: ZodBoolean; sequential: ZodBoolean; on_success: ZodOptional<ZodObject<{ feedback: ZodObject<{ value: ...; weight: ...; metadata: ...; }, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>; }, "passthrough", ZodTypeAny, objectOutputType<{ feedback: ZodObject<..., ..., ..., ..., ...>; }, ZodTypeAny, "passthrough">, objectInputType<{ feedback: ZodObject<..., ..., ..., ..., ...>; }, ZodTypeAny, "passthrough">>>; on_fail: ZodOptional<ZodObject<{ feedback: ZodObject<{ value: ...; weight: ...; metadata: ...; }, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>; }, "passthrough", ZodTypeAny, objectOutputType<{ feedback: ZodObject<..., ..., ..., ..., ...>; }, ZodTypeAny, "passthrough">, objectInputType<{ feedback: ZodObject<..., ..., ..., ..., ...>; }, ZodTypeAny, "passthrough">>>; }, "passthrough", ZodTypeAny, objectOutputType<{ deny: ZodBoolean; async: ZodBoolean; sequential: ZodBoolean; on_success: ZodOptional<ZodObject<{ feedback: ZodObject<..., ..., ..., ..., ...>; }, "passthrough", ZodTypeAny, objectOutputType<{ feedback: ...; }, ZodTypeAny, "passthrough">, objectInputType<{ feedback: ...; }, ZodTypeAny, "passthrough">>>; on_fail: ZodOptional<ZodObject<{ feedback: ZodObject<..., ..., ..., ..., ...>; }, "passthrough", ZodTypeAny, objectOutputType<{ feedback: ...; }, ZodTypeAny, "passthrough">, objectInputType<{ feedback: ...; }, ZodTypeAny, "passthrough">>>; }, ZodTypeAny, "passthrough">, objectInputType<{ deny: ZodBoolean; async: ZodBoolean; sequential: ZodBoolean; on_success: ZodOptional<ZodObject<{ feedback: ZodObject<..., ..., ..., ..., ...>; }, "passthrough", ZodTypeAny, objectOutputType<{ feedback: ...; }, ZodTypeAny, "passthrough">, objectInputType<{ feedback: ...; }, ZodTypeAny, "passthrough">>>; on_fail: ZodOptional<ZodObject<{ feedback: ZodObject<..., ..., ..., ..., ...>; }, "passthrough", ZodTypeAny, objectOutputType<{ feedback: ...; }, ZodTypeAny, "passthrough">, objectInputType<{ feedback: ...; }, ZodTypeAny, "passthrough">>>; }, ZodTypeAny, "passthrough">>; version_id: ZodString; }, ZodTypeAny, "passthrough">>

Guardrail detail — adds checks, actions, and version_id on top of the list row.

Example

import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
const gw = new AIGatewayClient();

const g = await gw.guardrails.get('9f6c2a8e-2b3d-4e5f-8a9b-0c1d2e3f4a5b');
// g.checks[0].id => 'panw-prisma-airs.intercept'

create()

create(body): Promise<objectOutputType<{
id: ZodString;
version_id: ZodString;
slug: ZodString;
object: ZodString;
}, ZodTypeAny, "passthrough">>;

Defined in: src/ai-gateway/guardrails-client.ts:119

Create a guardrail.

Parameters

ParameterTypeDescription
bodyGatewayGuardrailCreateRequestWorkspace UUID, name, checks, and pass/fail actions.

Returns

Promise<objectOutputType<{ id: ZodString; version_id: ZodString; slug: ZodString; object: ZodString; }, ZodTypeAny, "passthrough">>

The creation receipt.

Remarks

The response is a creation receipt{ id, version_id, slug, object } — not a GatewayGuardrailDetail. Call get for the full record. Verified live 2026-07-28.

Example

import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
const gw = new AIGatewayClient();

const receipt = await gw.guardrails.create({
workspace_id: '16f7e90d-382a-4e78-b577-1b01eb5f8297',
name: 'PrismaAIRS',
checks: [{ id: 'panw-prisma-airs.intercept', parameters: { profile_name: 'AI Gateway - Strict' }, is_enabled: true }],
actions: { deny: false, async: false, sequential: false },
});
// receipt => { id: '...', version_id: '...', slug: 'pg-sdk-ve-874b62', object: 'guardrail' }

delete()

delete(guardrailId): Promise<void>;

Defined in: src/ai-gateway/guardrails-client.ts:151

Delete a guardrail.

Parameters

ParameterTypeDescription
guardrailIdstringGuardrail UUID.

Returns

Promise<void>

Nothing.

Remarks

This is a hard delete — unlike deployments.delete (which archives), the guardrail disappears from list entirely. Verified live 2026-07-28. No organisation_id query param is required, unlike deployments/integrations.

Example

import { AIGatewayClient } from '@cdot65/prisma-airs-sdk';
const gw = new AIGatewayClient();

await gw.guardrails.delete('9f6c2a8e-2b3d-4e5f-8a9b-0c1d2e3f4a5b');
// the guardrail no longer appears in gw.guardrails.list()