Class: ModelSecurityRulesClient
Defined in: src/model-security/security-rules-client.ts:29
Client for Model Security management plane security rule operations (read-only).
Constructors
Constructor
new ModelSecurityRulesClient(opts): ModelSecurityRulesClient;
Defined in: src/model-security/security-rules-client.ts:34
Parameters
| Parameter | Type |
|---|---|
opts | ModelSecurityRulesClientOptions |
Returns
ModelSecurityRulesClient
Methods
list()
list(opts?): Promise<objectOutputType<{
pagination: ZodObject<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, ZodTypeAny, "passthrough">>;
rules: ZodArray<ZodObject<{
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<...>>;
dropdown_values: ZodOptional<ZodNullable<...>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, "passthrough", ZodTypeAny, objectOutputType<{
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">, objectInputType<{
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>;
Defined in: src/model-security/security-rules-client.ts:58
List available security rules.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts? | ModelSecurityRuleListOptions | Pagination + filter options. |
Returns
Promise<objectOutputType<{
pagination: ZodObject<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
total_items: ZodOptional<ZodNullable<ZodNumber>>;
}, ZodTypeAny, "passthrough">>;
rules: ZodArray<ZodObject<{
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<...>>;
dropdown_values: ZodOptional<ZodNullable<...>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, "passthrough", ZodTypeAny, objectOutputType<{
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">, objectInputType<{
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<..., ...>;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<...>;
dropdown_values: ZodOptional<...>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ...;
type: ...;
display_name: ...;
display_type: ...;
description: ...;
dropdown_values: ...;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>
Paginated list of security rules.
Example
import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
const ms = new ModelSecurityClient();
const rules = await ms.securityRules.list({
limit: 20,
source_type: 'HUGGING_FACE',
search_query: 'pickle',
});
// rules.rules =>
// [{ uuid: '550e8400-...', name: 'Pickle Scan', rule_type: 'ARTIFACT', default_state: 'BLOCKING', ... }]
get()
get(uuid): Promise<objectOutputType<{
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<{
value: ...;
label: ...;
}, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">>;
Defined in: src/model-security/security-rules-client.ts:88
Get a single security rule by UUID.
Parameters
| Parameter | Type | Description |
|---|---|---|
uuid | string | Security rule UUID. |
Returns
Promise<objectOutputType<{
uuid: ZodString;
name: ZodString;
description: ZodString;
rule_type: ZodString;
compatible_sources: ZodArray<ZodString, "many">;
default_state: ZodString;
remediation: ZodObject<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
description: ZodString;
steps: ZodArray<ZodString, "many">;
url: ZodString;
}, ZodTypeAny, "passthrough">>;
editable_fields: ZodArray<ZodObject<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<{
value: ...;
label: ...;
}, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">>>;
}, "passthrough", ZodTypeAny, objectOutputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, ZodTypeAny, "passthrough">, objectInputType<{
attribute_name: ZodString;
type: ZodString;
display_name: ZodString;
display_type: ZodString;
description: ZodOptional<ZodNullable<ZodString>>;
dropdown_values: ZodOptional<ZodNullable<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>>;
}, ZodTypeAny, "passthrough">>, "many">;
constant_values: ZodRecord<ZodString, ZodUnknown>;
default_values: ZodRecord<ZodString, ZodUnknown>;
}, ZodTypeAny, "passthrough">>
The security rule.
Example
import { ModelSecurityClient } from '@cdot65/prisma-airs-sdk';
const ms = new ModelSecurityClient();
const rule = await ms.securityRules.get('550e8400-e29b-41d4-a716-446655440000');
// rule =>
// { uuid: '550e8400-...', name: 'Pickle Scan', rule_type: 'ARTIFACT', default_state: 'BLOCKING', ... }