Skip to main content

Class: AIGatewayAuditLogsClient

Defined in: src/ai-gateway/audit-logs-client.ts:17

Client for AI Gateway audit logs (admin plane).

Constructors

Constructor

new AIGatewayAuditLogsClient(opts): AIGatewayAuditLogsClient;

Defined in: src/ai-gateway/audit-logs-client.ts:22

Parameters

ParameterType
optsAIGatewaySubClientOptions

Returns

AIGatewayAuditLogsClient

Methods

list()

list(opts): Promise<objectOutputType<{
records: ZodArray<ZodObject<{
timestamp: ZodString;
method: ZodString;
uri: ZodString;
request_id: ZodString;
request_body: ZodString;
query_params: ZodString;
request_headers: ZodString;
user_id: ZodString;
user_type: ZodString;
organisation_id: ZodString;
workspace_id: ZodString;
response_status_code: ZodNumber;
resource_type: ZodString;
action: ZodString;
client_ip: ZodString;
country: ZodString;
}, "passthrough", ZodTypeAny, objectOutputType<{
timestamp: ZodString;
method: ZodString;
uri: ZodString;
request_id: ZodString;
request_body: ZodString;
query_params: ZodString;
request_headers: ZodString;
user_id: ZodString;
user_type: ZodString;
organisation_id: ZodString;
workspace_id: ZodString;
response_status_code: ZodNumber;
resource_type: ZodString;
action: ZodString;
client_ip: ZodString;
country: ZodString;
}, ZodTypeAny, "passthrough">, objectInputType<{
timestamp: ZodString;
method: ZodString;
uri: ZodString;
request_id: ZodString;
request_body: ZodString;
query_params: ZodString;
request_headers: ZodString;
user_id: ZodString;
user_type: ZodString;
organisation_id: ZodString;
workspace_id: ZodString;
response_status_code: ZodNumber;
resource_type: ZodString;
action: ZodString;
client_ip: ZodString;
country: ZodString;
}, ZodTypeAny, "passthrough">>, "many">;
}, ZodTypeAny, "passthrough">>;

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

Read organisation audit logs.

Parameters

ParameterTypeDescription
optsAIGatewayAuditLogListOptionsInclusive start and end of the window.

Returns

Promise<objectOutputType<{ records: ZodArray<ZodObject<{ timestamp: ZodString; method: ZodString; uri: ZodString; request_id: ZodString; request_body: ZodString; query_params: ZodString; request_headers: ZodString; user_id: ZodString; user_type: ZodString; organisation_id: ZodString; workspace_id: ZodString; response_status_code: ZodNumber; resource_type: ZodString; action: ZodString; client_ip: ZodString; country: ZodString; }, "passthrough", ZodTypeAny, objectOutputType<{ timestamp: ZodString; method: ZodString; uri: ZodString; request_id: ZodString; request_body: ZodString; query_params: ZodString; request_headers: ZodString; user_id: ZodString; user_type: ZodString; organisation_id: ZodString; workspace_id: ZodString; response_status_code: ZodNumber; resource_type: ZodString; action: ZodString; client_ip: ZodString; country: ZodString; }, ZodTypeAny, "passthrough">, objectInputType<{ timestamp: ZodString; method: ZodString; uri: ZodString; request_id: ZodString; request_body: ZodString; query_params: ZodString; request_headers: ZodString; user_id: ZodString; user_type: ZodString; organisation_id: ZodString; workspace_id: ZodString; response_status_code: ZodNumber; resource_type: ZodString; action: ZodString; client_ip: ZodString; country: ZodString; }, ZodTypeAny, "passthrough">>, "many">; }, ZodTypeAny, "passthrough">>

Audit records, newest first.

Remarks

Handle the result as sensitive. The API returns each entry's request_body unredacted, so records for credential-bearing calls (integrations, plugins) can contain live secrets — private keys, provider API keys — in plaintext. The sibling request_headers field is masked, but request_body is not. The SDK returns the response faithfully rather than altering it; never log these records wholesale, and never forward them to a third-party sink. Note that setting PANW_AI_SEC_DEBUG will print the raw response — including these unredacted secrets — to the SDK's own debug log regardless of this warning.

Example

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

const logs = await gw.auditLogs.list({
start: new Date('2026-07-20T00:00:00Z'),
end: new Date(),
});
// Safe projection — never log the whole record.
const summary = logs.records.map((r) => `${r.timestamp} ${r.method} ${r.uri}`);