Skip to main content

Class: RedTeamClient

Defined in: src/red-team/client.ts:73

Client for AIRS Red Teaming API operations. Uses two base URLs: data plane for scans/reports, management plane for targets/custom attacks.

Example

import { RedTeamClient } from '@cdot65/prisma-airs-sdk';
// Reads PANW_RED_TEAM_* env vars (falls back to PANW_MGMT_*).
const rt = new RedTeamClient();

const scans = await rt.scans.list({ limit: 5 });
// scans =>
// { pagination: { total_items: 12 }, data: [{ uuid: '550e8400-...', status: 'COMPLETED', job_type: 'STATIC' }] }

Constructors

Constructor

new RedTeamClient(opts?): RedTeamClient;

Defined in: src/red-team/client.ts:94

Parameters

ParameterType
optsRedTeamClientOptions

Returns

RedTeamClient

Properties

scans

readonly scans: RedTeamScansClient;

Defined in: src/red-team/client.ts:75

Data plane scan operations.


reports

readonly reports: RedTeamReportsClient;

Defined in: src/red-team/client.ts:77

Data plane report operations.


customAttackReports

readonly customAttackReports: RedTeamCustomAttackReportsClient;

Defined in: src/red-team/client.ts:79

Data plane custom attack report operations.


targets

readonly targets: RedTeamTargetsClient;

Defined in: src/red-team/client.ts:81

Management plane target operations.


customAttacks

readonly customAttacks: RedTeamCustomAttacksClient;

Defined in: src/red-team/client.ts:83

Management plane custom attack/prompt set operations.


eula

readonly eula: RedTeamEulaClient;

Defined in: src/red-team/client.ts:85

Management plane EULA operations.


instances

readonly instances: RedTeamInstancesClient;

Defined in: src/red-team/client.ts:87

Management plane instance/licensing operations.

Methods

getScanStatistics()

getScanStatistics(params?): Promise<objectOutputType<{
total_scans: ZodNumber;
targets_scanned: ZodNumber;
targets_scanned_by_type: ZodOptional<ZodArray<ZodObject<{
name: ZodString;
count: ZodNumber;
}, "passthrough", ZodTypeAny, objectOutputType<{
name: ZodString;
count: ZodNumber;
}, ZodTypeAny, "passthrough">, objectInputType<{
name: ZodString;
count: ZodNumber;
}, ZodTypeAny, "passthrough">>, "many">>;
scan_status: ZodOptional<ZodArray<ZodObject<{
name: ZodString;
count: ZodNumber;
}, "passthrough", ZodTypeAny, objectOutputType<{
name: ZodString;
count: ZodNumber;
}, ZodTypeAny, "passthrough">, objectInputType<{
name: ZodString;
count: ZodNumber;
}, ZodTypeAny, "passthrough">>, "many">>;
risk_profile: ZodOptional<ZodArray<ZodObject<{
risk_rating: ZodString;
total: ZodNumber;
targets_by_type: ZodOptional<ZodArray<ZodObject<{
name: ...;
count: ...;
}, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">>;
}, "passthrough", ZodTypeAny, objectOutputType<{
risk_rating: ZodString;
total: ZodNumber;
targets_by_type: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>;
}, ZodTypeAny, "passthrough">, objectInputType<{
risk_rating: ZodString;
total: ZodNumber;
targets_by_type: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>;
}, ZodTypeAny, "passthrough">>, "many">>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/red-team/client.ts:152

Get scan statistics and risk profile (data plane dashboard).

Parameters

ParameterTypeDescription
params?{ date_range?: string; target_id?: string; }Optional date range and target ID filters.
params.date_range?string-
params.target_id?string-

Returns

Promise<objectOutputType<{ total_scans: ZodNumber; targets_scanned: ZodNumber; targets_scanned_by_type: ZodOptional<ZodArray<ZodObject<{ name: ZodString; count: ZodNumber; }, "passthrough", ZodTypeAny, objectOutputType<{ name: ZodString; count: ZodNumber; }, ZodTypeAny, "passthrough">, objectInputType<{ name: ZodString; count: ZodNumber; }, ZodTypeAny, "passthrough">>, "many">>; scan_status: ZodOptional<ZodArray<ZodObject<{ name: ZodString; count: ZodNumber; }, "passthrough", ZodTypeAny, objectOutputType<{ name: ZodString; count: ZodNumber; }, ZodTypeAny, "passthrough">, objectInputType<{ name: ZodString; count: ZodNumber; }, ZodTypeAny, "passthrough">>, "many">>; risk_profile: ZodOptional<ZodArray<ZodObject<{ risk_rating: ZodString; total: ZodNumber; targets_by_type: ZodOptional<ZodArray<ZodObject<{ name: ...; count: ...; }, "passthrough", ZodTypeAny, objectOutputType<..., ..., ...>, objectInputType<..., ..., ...>>, "many">>; }, "passthrough", ZodTypeAny, objectOutputType<{ risk_rating: ZodString; total: ZodNumber; targets_by_type: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>; }, ZodTypeAny, "passthrough">, objectInputType<{ risk_rating: ZodString; total: ZodNumber; targets_by_type: ZodOptional<ZodArray<ZodObject<..., ..., ..., ..., ...>, "many">>; }, ZodTypeAny, "passthrough">>, "many">>; }, ZodTypeAny, "passthrough">>

The scan statistics response.

Example

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

const stats = await rt.getScanStatistics({ date_range: '30d' });
// stats =>
// { total_scans: 10, targets_scanned: 5 }

getScoreTrend()

getScoreTrend(targetId): Promise<objectOutputType<{
labels: ZodArray<ZodString, "many">;
series: ZodArray<ZodObject<{
label: ZodString;
data: ZodArray<ZodNullable<ZodNumber>, "many">;
}, "passthrough", ZodTypeAny, objectOutputType<{
label: ZodString;
data: ZodArray<ZodNullable<ZodNumber>, "many">;
}, ZodTypeAny, "passthrough">, objectInputType<{
label: ZodString;
data: ZodArray<ZodNullable<ZodNumber>, "many">;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>;

Defined in: src/red-team/client.ts:185

Get score trend for a target (data plane dashboard).

Parameters

ParameterTypeDescription
targetIdstringThe target UUID.

Returns

Promise<objectOutputType<{ labels: ZodArray<ZodString, "many">; series: ZodArray<ZodObject<{ label: ZodString; data: ZodArray<ZodNullable<ZodNumber>, "many">; }, "passthrough", ZodTypeAny, objectOutputType<{ label: ZodString; data: ZodArray<ZodNullable<ZodNumber>, "many">; }, ZodTypeAny, "passthrough">, objectInputType<{ label: ZodString; data: ZodArray<ZodNullable<ZodNumber>, "many">; }, ZodTypeAny, "passthrough">>, "many">; }, ZodTypeAny, "passthrough">>

The score trend response.

Example

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

const trend = await rt.getScoreTrend('550e8400-e29b-41d4-a716-446655440000');
// trend =>
// { labels: ['2026-04', '2026-05'], series: [{ name: 'risk', data: [42, 38] }] }

getQuota()

getQuota(): Promise<objectOutputType<{
static: ZodObject<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, "passthrough", ZodTypeAny, objectOutputType<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, ZodTypeAny, "passthrough">, objectInputType<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, ZodTypeAny, "passthrough">>;
dynamic: ZodObject<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, "passthrough", ZodTypeAny, objectOutputType<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, ZodTypeAny, "passthrough">, objectInputType<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, ZodTypeAny, "passthrough">>;
custom: ZodObject<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, "passthrough", ZodTypeAny, objectOutputType<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, ZodTypeAny, "passthrough">, objectInputType<{
allocated: ZodNumber;
unlimited: ZodBoolean;
consumed: ZodNumber;
}, ZodTypeAny, "passthrough">>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/red-team/client.ts:211

Get quota summary.

Returns

Promise<objectOutputType<{ static: ZodObject<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, "passthrough", ZodTypeAny, objectOutputType<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, ZodTypeAny, "passthrough">, objectInputType<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, ZodTypeAny, "passthrough">>; dynamic: ZodObject<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, "passthrough", ZodTypeAny, objectOutputType<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, ZodTypeAny, "passthrough">, objectInputType<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, ZodTypeAny, "passthrough">>; custom: ZodObject<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, "passthrough", ZodTypeAny, objectOutputType<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, ZodTypeAny, "passthrough">, objectInputType<{ allocated: ZodNumber; unlimited: ZodBoolean; consumed: ZodNumber; }, ZodTypeAny, "passthrough">>; }, ZodTypeAny, "passthrough">>

The quota summary.

Example

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

const quota = await rt.getQuota();
// quota =>
// { static: { allocated: 100, unlimited: false, consumed: 5 }, dynamic: {...}, custom: {...} }

getErrorLogs()

getErrorLogs(jobId, 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">>;
data: ZodArray<ZodObject<{
created_at: ZodString;
updated_at: ZodString;
job_id: ZodOptional<ZodNullable<ZodString>>;
target_id: ZodOptional<ZodNullable<ZodString>>;
target_version: ZodOptional<ZodNullable<ZodNumber>>;
attack_id: ZodOptional<ZodNullable<ZodString>>;
error_type: ZodOptional<ZodNullable<ZodString>>;
error_source: ZodOptional<ZodNullable<ZodString>>;
error_message: ZodOptional<ZodNullable<ZodString>>;
target_object: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
extra_info: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
version: ZodOptional<ZodNumber>;
}, "passthrough", ZodTypeAny, objectOutputType<{
created_at: ZodString;
updated_at: ZodString;
job_id: ZodOptional<ZodNullable<ZodString>>;
target_id: ZodOptional<ZodNullable<ZodString>>;
target_version: ZodOptional<ZodNullable<ZodNumber>>;
attack_id: ZodOptional<ZodNullable<ZodString>>;
error_type: ZodOptional<ZodNullable<ZodString>>;
error_source: ZodOptional<ZodNullable<ZodString>>;
error_message: ZodOptional<ZodNullable<ZodString>>;
target_object: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
extra_info: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
version: ZodOptional<ZodNumber>;
}, ZodTypeAny, "passthrough">, objectInputType<{
created_at: ZodString;
updated_at: ZodString;
job_id: ZodOptional<ZodNullable<ZodString>>;
target_id: ZodOptional<ZodNullable<ZodString>>;
target_version: ZodOptional<ZodNullable<ZodNumber>>;
attack_id: ZodOptional<ZodNullable<ZodString>>;
error_type: ZodOptional<ZodNullable<ZodString>>;
error_source: ZodOptional<ZodNullable<ZodString>>;
error_message: ZodOptional<ZodNullable<ZodString>>;
target_object: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
extra_info: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>;
version: ZodOptional<ZodNumber>;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>;

Defined in: src/red-team/client.ts:237

List error logs for a scan job.

Parameters

ParameterTypeDescription
jobIdstringThe job UUID.
opts?ListingOptionsOptional pagination and search 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">>; data: ZodArray<ZodObject<{ created_at: ZodString; updated_at: ZodString; job_id: ZodOptional<ZodNullable<ZodString>>; target_id: ZodOptional<ZodNullable<ZodString>>; target_version: ZodOptional<ZodNullable<ZodNumber>>; attack_id: ZodOptional<ZodNullable<ZodString>>; error_type: ZodOptional<ZodNullable<ZodString>>; error_source: ZodOptional<ZodNullable<ZodString>>; error_message: ZodOptional<ZodNullable<ZodString>>; target_object: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>; extra_info: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>; version: ZodOptional<ZodNumber>; }, "passthrough", ZodTypeAny, objectOutputType<{ created_at: ZodString; updated_at: ZodString; job_id: ZodOptional<ZodNullable<ZodString>>; target_id: ZodOptional<ZodNullable<ZodString>>; target_version: ZodOptional<ZodNullable<ZodNumber>>; attack_id: ZodOptional<ZodNullable<ZodString>>; error_type: ZodOptional<ZodNullable<ZodString>>; error_source: ZodOptional<ZodNullable<ZodString>>; error_message: ZodOptional<ZodNullable<ZodString>>; target_object: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>; extra_info: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>; version: ZodOptional<ZodNumber>; }, ZodTypeAny, "passthrough">, objectInputType<{ created_at: ZodString; updated_at: ZodString; job_id: ZodOptional<ZodNullable<ZodString>>; target_id: ZodOptional<ZodNullable<ZodString>>; target_version: ZodOptional<ZodNullable<ZodNumber>>; attack_id: ZodOptional<ZodNullable<ZodString>>; error_type: ZodOptional<ZodNullable<ZodString>>; error_source: ZodOptional<ZodNullable<ZodString>>; error_message: ZodOptional<ZodNullable<ZodString>>; target_object: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>; extra_info: ZodOptional<ZodNullable<ZodRecord<ZodString, ZodUnknown>>>; version: ZodOptional<ZodNumber>; }, ZodTypeAny, "passthrough">>, "many">; }, ZodTypeAny, "passthrough">>

The paginated list of error logs.

Example

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

const logs = await rt.getErrorLogs('550e8400-e29b-41d4-a716-446655440000', { limit: 10 });
// logs =>
// { pagination: { total_items: 1 }, data: [{ error_type: 'TIMEOUT', error_message: '...', created_at: '2025-01-01T00:00:00Z' }] }

updateSentiment()

updateSentiment(body): Promise<objectOutputType<{
job_id: ZodString;
up_vote: ZodOptional<ZodBoolean>;
down_vote: ZodOptional<ZodBoolean>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/red-team/client.ts:267

Update sentiment for a scan report.

Parameters

ParameterTypeDescription
bodyobjectOutputTypeThe sentiment request body.

Returns

Promise<objectOutputType<{ job_id: ZodString; up_vote: ZodOptional<ZodBoolean>; down_vote: ZodOptional<ZodBoolean>; }, ZodTypeAny, "passthrough">>

The sentiment response.

Example

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

const result = await rt.updateSentiment({
job_id: '550e8400-e29b-41d4-a716-446655440000',
up_vote: true,
});
// result =>
// { job_id: '550e8400-...', up_vote: true }

getSentiment()

getSentiment(jobId): Promise<objectOutputType<{
job_id: ZodString;
up_vote: ZodOptional<ZodBoolean>;
down_vote: ZodOptional<ZodBoolean>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/red-team/client.ts:293

Get sentiment for a scan report.

Parameters

ParameterTypeDescription
jobIdstringThe job UUID.

Returns

Promise<objectOutputType<{ job_id: ZodString; up_vote: ZodOptional<ZodBoolean>; down_vote: ZodOptional<ZodBoolean>; }, ZodTypeAny, "passthrough">>

The sentiment response.

Example

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

const sentiment = await rt.getSentiment('550e8400-e29b-41d4-a716-446655440000');
// sentiment =>
// { job_id: '550e8400-...', up_vote: true }

getDashboardOverview()

getDashboardOverview(): Promise<objectOutputType<{
total_targets: ZodNumber;
targets_by_type: ZodOptional<ZodArray<ZodObject<{
name: ZodString;
count: ZodNumber;
}, "passthrough", ZodTypeAny, objectOutputType<{
name: ZodString;
count: ZodNumber;
}, ZodTypeAny, "passthrough">, objectInputType<{
name: ZodString;
count: ZodNumber;
}, ZodTypeAny, "passthrough">>, "many">>;
}, ZodTypeAny, "passthrough">>;

Defined in: src/red-team/client.ts:322

Get management dashboard overview.

Returns

Promise<objectOutputType<{ total_targets: ZodNumber; targets_by_type: ZodOptional<ZodArray<ZodObject<{ name: ZodString; count: ZodNumber; }, "passthrough", ZodTypeAny, objectOutputType<{ name: ZodString; count: ZodNumber; }, ZodTypeAny, "passthrough">, objectInputType<{ name: ZodString; count: ZodNumber; }, ZodTypeAny, "passthrough">>, "many">>; }, ZodTypeAny, "passthrough">>

The dashboard overview response.

Example

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

const overview = await rt.getDashboardOverview();
// overview =>
// { total_targets: 7, targets_by_type: [{ type: 'API', count: 4 }] }